Skip to content

Webhooks

Examples use $SPAVIK_BASE_URL and $SPAVIK_API_KEY, set in Get started.

GET /v1/webhooks

List webhooks

Authentication : API key (X-API-Key) or web session (Authorization: Bearer)

Responses

CodeDescription
200Success
401Authentication required, or invalid token.
403This caller is not allowed to perform this action.

Example

sh
curl -X GET "$SPAVIK_BASE_URL/v1/webhooks" \
  -H 'X-API-Key: sk-spv-api-...'

POST /v1/webhooks

Register a webhook

Authentication : API key (X-API-Key) or web session (Authorization: Bearer)

Request body

NameTypeDescription
urlstringrequired
eventsmodel.trained | model.stale | model.refreshed | credits.low[]optional

Responses

CodeDescription
201Created (the secret is returned once and only once)
401Authentication required, or invalid token.
403This caller is not allowed to perform this action.
409TOO_MANY_WEBHOOKS: workspace limit reached; WEBHOOK_URL_EXISTS: this URL is already registered here (update the existing webhook instead).

Example

sh
curl -X POST "$SPAVIK_BASE_URL/v1/webhooks" \
  -H 'X-API-Key: sk-spv-api-...' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://exemple.test/spavik-webhook",
  "events": [
    "model.trained",
    "credits.low"
  ]
}'

PATCH /v1/webhooks/{id}

Update a webhook

Authentication : API key (X-API-Key) or web session (Authorization: Bearer)

Request body

NameTypeDescription
urlstringoptional
eventsstring[]optional
activebooleanoptional

Responses

CodeDescription
200Success
401Authentication required, or invalid token.
403This caller is not allowed to perform this action.
404Unknown webhook.
409WEBHOOK_URL_EXISTS: this URL is already registered on another webhook of the workspace.

Example

sh
curl -X PATCH "$SPAVIK_BASE_URL/v1/webhooks/{id}" \
  -H 'X-API-Key: sk-spv-api-...' \
  -H 'Content-Type: application/json' \
  -d '{
  "active": false
}'

DELETE /v1/webhooks/{id}

Delete a webhook

Authentication : API key (X-API-Key) or web session (Authorization: Bearer)

Responses

CodeDescription
204Deleted
401Authentication required, or invalid token.
403This caller is not allowed to perform this action.

Example

sh
curl -X DELETE "$SPAVIK_BASE_URL/v1/webhooks/{id}" \
  -H 'X-API-Key: sk-spv-api-...'

Part of this documentation is generated from the OpenAPI contract.