Skip to main content
POST
/
webhooks
Create a webhook subscription
curl --request POST \
  --url https://api-dev.narrative.io/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "webhook_subscription_app",
  "app_id": "32b83061-e41b-4789-8d62-f1d4f1faf07e",
  "url": "https://example.com/123",
  "name": "some_webhook"
}
'
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "secret": "8b6dba8c-9a8b-4a3a-8469-9dc7a33c3e17",
  "status": "active",
  "companyId": 42,
  "jobIds": [
    "d35a12c1-7a2f-46b9-8d60-9e0a2a84c205",
    "9a3cf334-4c6d-4d3f-a7d6-22b6e6f2ac1b"
  ],
  "jobStates": [
    "pending",
    "running",
    "completed"
  ],
  "jobTypes": [
    "forecast",
    "materialized-view"
  ],
  "url": "https://webhooks.mycompany.com/events",
  "createdAt": "2025-04-29T16:12:45.123456",
  "updatedAt": "2025-04-29T16:12:45.123456"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
type
enum<string>
required
Available options:
webhook_subscription_app
app_id
string<uuid>
required
url
string<uri>
required
name
string

Response

200 - application/json

Created

id
string<uuid>
required
secret
string<uuid>
required
status
enum<string>
required
Available options:
active,
archived
companyId
string
required
url
string<uri>
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
jobIds
enum<string>[]
Available options:
costs,
datasets_calculate_column_stats,
datasets_delete_table,
datasets_deliver_data,
datasets_sample,
datasets_suggest_mappings,
delete-snowflake-table,
forecast,
materialize-view,
models_deliver_model,
model_training_run,
nql-forecast,
upload-stats
jobStates
enum<string>[]
Available options:
pending,
running,
completed,
pending_cancellation,
cancelled,
failed
jobTypes
string[]