Authentication
All view endpoints require an alert token in the X-Alert-Token header. Obtain a token via the Get Alert Token endpoint.
X-Alert-Token: <your-alert-token>
List Views
Retrieve all saved views for the authenticated user.
Response
Returns an array of view objects.
Geographic scope (US or UK).
Array of selected driver identifiers.
Saved investigation question.
curl "https://api.consumersignals.io/api/views" \
-H "X-Alert-Token: YOUR_ALERT_TOKEN"
import requests
response = requests.get(
"https://api.consumersignals.io/api/views",
headers={"X-Alert-Token": "YOUR_ALERT_TOKEN"}
)
views = response.json()
const response = await fetch(
"https://api.consumersignals.io/api/views",
{
headers: {
"X-Alert-Token": "YOUR_ALERT_TOKEN",
},
}
);
const views = await response.json();
[
{
"id": "view_xyz789",
"name": "US Energy Impact",
"geography": "US",
"driver_ids": ["gas_price", "cpi_energy"],
"question": "How are energy costs affecting consumer spending?"
}
]
Create View
Create a new saved view.
Request Body
Geographic scope. One of US or UK.
Array of driver identifiers to include in the view.
Investigation question to associate with the view.
curl -X POST "https://api.consumersignals.io/api/views" \
-H "X-Alert-Token: YOUR_ALERT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "US Energy Impact",
"geography": "US",
"driver_ids": ["gas_price", "cpi_energy"],
"question": "How are energy costs affecting consumer spending?"
}'
import requests
response = requests.post(
"https://api.consumersignals.io/api/views",
headers={
"X-Alert-Token": "YOUR_ALERT_TOKEN",
"Content-Type": "application/json"
},
json={
"name": "US Energy Impact",
"geography": "US",
"driver_ids": ["gas_price", "cpi_energy"],
"question": "How are energy costs affecting consumer spending?"
}
)
view = response.json()
const response = await fetch(
"https://api.consumersignals.io/api/views",
{
method: "POST",
headers: {
"X-Alert-Token": "YOUR_ALERT_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "US Energy Impact",
geography: "US",
driver_ids: ["gas_price", "cpi_energy"],
question: "How are energy costs affecting consumer spending?",
}),
}
);
const view = await response.json();
{
"id": "view_xyz789",
"name": "US Energy Impact",
"geography": "US",
"driver_ids": ["gas_price", "cpi_energy"],
"question": "How are energy costs affecting consumer spending?"
}
Delete View
Delete a saved view by its ID.
Path Parameters
The unique identifier of the view to delete.
Response
Returns 204 No Content on successful deletion.
curl -X DELETE "https://api.consumersignals.io/api/views/view_xyz789" \
-H "X-Alert-Token: YOUR_ALERT_TOKEN"
import requests
response = requests.delete(
"https://api.consumersignals.io/api/views/view_xyz789",
headers={"X-Alert-Token": "YOUR_ALERT_TOKEN"}
)
# 204 No Content on success
const response = await fetch(
"https://api.consumersignals.io/api/views/view_xyz789",
{
method: "DELETE",
headers: {
"X-Alert-Token": "YOUR_ALERT_TOKEN",
},
}
);
// 204 No Content on success