POST
/
webhooks
Register or update webhook configuration
curl --request POST \
  --url https://api.godiligent.ai/webhooks \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '{
  "webhook_url": "<string>",
  "is_active": true,
  "secret": "<string>",
  "events": [
    "cdd_state_changed"
  ]
}'

Endpoint

POST /webhooks Creates or updates the webhook configuration for the authenticated customer. Only one webhook per customer is supported; repeated calls update the existing webhook.

Request Body

JSON object with the following fields:
FieldTypeRequiredDescription
webhook_urlstringYesHTTPS URL to receive webhook events. Must start with https://.
secretstringNoSecret used to sign webhook payloads. Empty string is treated as null.
is_activebooleanNoWhether the webhook is active. Defaults to true.
eventsstring[]NoList of event types to subscribe to. Defaults to all supported events.

Supported Event Types

  • cdd_state_changed: When the state of a CDD changes to either inconclusive or complete.
  • monitoring_alert_fired: When a monitoring alert is fired on failure.

Example Request

{
  "webhook_url": "https://www.testing-webhooks.com",
  "is_active": true,
  "secret": "some-secret",
  "events": ["cdd_state_changed", "monitoring_alert_fired"]
}

Responses

204 No Content

Webhook was created or updated successfully. No response body.

400 Bad Request

Input validation failed.
{
  "error": [
    {
      "code": "invalid_type",
      "expected": "string",
      "received": "number",
      "path": ["webhook_url"],
      "message": "Expected string, received number"
    }
  ]
}

500 Internal Server Error

Unexpected error occurred.
{
  "error": "Internal server error"
}

Authentication

This endpoint requires authentication. The webhook is associated with the authenticated customer.

Authorizations

X-API-KEY
string
header
required

Body

application/json

Response

200

Webhook configuration created or updated.