Skip to content
AISARAISAR
REST API

Webhook settings

A webhook-type integration subscribes to a set of platform events (see the webhook events reference) and, whenever they fire, POSTs a signed body to the given URL. Through this group you create and configure AISAR outbound webhooks, manage their secrets, and read delivery logs. Bitrix24 and amoCRM connect through their own OAuth flows in the my.aisar.app dashboard and are not covered by this reference.

Authentication, retries, and filters

Bearer/basic auth on the receiving end, retry with a bounded attempt count, and channel filtering are all supported.

Providers catalog and summary

The available providers catalog is returned by GET /v1/integration-providers, and a per-type summary of active integrations by GET /v1/integrations/summary.

Event source

The event keys for the selectedEventKeys field come from the system-events catalog GET /v1/system-events — the single source of events a webhook can subscribe to (full payload schemas live in the webhook events reference).

Secret rotation

Integration secrets (signingSecret, bearerToken, basicUsername, basicPassword) are rotated with a PATCH carrying a new secrets object; the response updates credential.rotated_at.

Endpoints

MethodPath
GET/v1/integrations

List integrations (filterable by type, status)

POST/v1/integrations

Create a webhook integration

GET/v1/integrations/{integration}

Get an integration (with credential and mappings)

PATCH/v1/integrations/{integration}

Update an integration

DELETE/v1/integrations/{integration}

Delete an integration

GET/v1/integrations/{integration}/logs

Webhook delivery logs

POST/v1/integrations/test-webhook

Send a one-off test delivery to a given URL (no integration saved)

GET/v1/integration-providers

Integration providers catalog (query: published)

GET/v1/integrations/summary

Integration counts grouped by type

GET/v1/system-events

System-events catalog — the source of event keys for webhooks (query: type, group)

Examples

Create a webhook integration

Request

bash
curl -X POST https://api.aisar.app/v1/integrations \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "webhook",
    "name": "n8n Production",
    "status": "active",
    "settings": {
      "url": "https://example.com/webhook",
      "authType": "bearer",
      "selectedEventKeys": ["message.created", "conversation.created"],
      "channelFilter": "all",
      "timeoutSeconds": 30,
      "retryEnabled": true,
      "maxAttempts": 6
    },
    "secrets": { "bearerToken": "your-receiving-endpoint-secret" }
  }'

Response

json
{
  "data": {
    "id": 14,
    "type": "webhook",
    "name": "n8n Production",
    "status": "active",
    "health": {
      "last_success_at": null,
      "last_failure_at": null,
      "last_error": null,
      "consecutive_failures": 0
    },
    "settings": {
      "url": "https://example.com/webhook",
      "authType": "bearer",
      "selectedEventKeys": ["message.created", "conversation.created"],
      "channelFilter": "all",
      "timeoutSeconds": 30,
      "retryEnabled": true,
      "maxAttempts": 6
    },
    "credential": {
      "secrets": { "bearerToken": "your-receiving-endpoint-secret" },
      "expires_at": null,
      "last_refreshed_at": null,
      "rotated_at": null,
      "created_at": "2026-03-15T10:00:00.000000Z",
      "updated_at": "2026-03-15T10:00:00.000000Z"
    },
    "external_entities": [],
    "mappings": [],
    "funnel_mappings": [],
    "created_at": "2026-03-15T10:00:00.000000Z",
    "updated_at": "2026-03-15T10:00:00.000000Z"
  }
}

Webhook delivery logs

Request

bash
curl "https://api.aisar.app/v1/integrations/14/logs?limit=50" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": [
    {
      "id": 8801,
      "level": "info",
      "code": "webhook.delivery",
      "message": "Webhook delivered.",
      "context": {
        "event_key": "message.created",
        "status": "success",
        "status_code": 200,
        "duration_ms": 420
      },
      "created_at": "2026-03-15T10:05:00.000000Z"
    }
  ]
}

Integration providers catalog

Request

bash
curl "https://api.aisar.app/v1/integration-providers?published=1" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": [
    {
      "id": 1,
      "key": "webhook",
      "name": "Webhook",
      "description": "Outbound webhook integration",
      "is_published": true,
      "created_at": "2026-03-01T09:00:00.000000Z",
      "updated_at": "2026-03-01T09:00:00.000000Z"
    },
    {
      "id": 2,
      "key": "bitrix24",
      "name": "Bitrix24",
      "description": "Bitrix24 CRM connector",
      "is_published": true,
      "created_at": "2026-03-01T09:00:00.000000Z",
      "updated_at": "2026-03-01T09:00:00.000000Z"
    }
  ]
}

Integration summary by type

Request

bash
curl "https://api.aisar.app/v1/integrations/summary" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": [
    { "type": "webhook", "count": 2 },
    { "type": "bitrix24", "count": 1 }
  ]
}

Rotate integration secrets (switch to basic auth)

Request

bash
curl -X PATCH https://api.aisar.app/v1/integrations/14 \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "settings": {
      "url": "https://example.com/webhook",
      "description": "Production automation",
      "signatureHeader": "X-AISAR-Signature",
      "authType": "basic",
      "selectedEventKeys": ["message.created", "conversation.created"],
      "channelFilter": "all",
      "timeoutSeconds": 30,
      "retryEnabled": true,
      "maxAttempts": 6,
      "concurrency": 4
    },
    "secrets": {
      "signingSecret": "YOUR_SIGNING_SECRET",
      "basicUsername": "webhook-user",
      "basicPassword": "YOUR_BASIC_PASSWORD"
    }
  }'

Response

json
{
  "data": {
    "id": 14,
    "type": "webhook",
    "name": "n8n Production",
    "status": "active",
    "settings": {
      "url": "https://example.com/webhook",
      "description": "Production automation",
      "signatureHeader": "X-AISAR-Signature",
      "authType": "basic",
      "selectedEventKeys": ["message.created", "conversation.created"],
      "channelFilter": "all",
      "timeoutSeconds": 30,
      "retryEnabled": true,
      "maxAttempts": 6,
      "concurrency": 4
    },
    "credential": {
      "secrets": {
        "signingSecret": "YOUR_SIGNING_SECRET",
        "basicUsername": "webhook-user",
        "basicPassword": "YOUR_BASIC_PASSWORD"
      },
      "expires_at": null,
      "last_refreshed_at": null,
      "rotated_at": "2026-03-16T08:30:00.000000Z",
      "created_at": "2026-03-15T10:00:00.000000Z",
      "updated_at": "2026-03-16T08:30:00.000000Z"
    },
    "external_entities": [],
    "mappings": [],
    "funnel_mappings": [],
    "created_at": "2026-03-15T10:00:00.000000Z",
    "updated_at": "2026-03-16T08:30:00.000000Z"
  }
}

System events — the webhook event source

Request

bash
curl "https://api.aisar.app/v1/system-events?group=Messages" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

json
{
  "data": [
    {
      "id": 1,
      "key": "message.created",
      "type": "message",
      "name": "Message created",
      "description": "A new message is created in a conversation.",
      "group": "Messages",
      "metadata": {},
      "created_at": "2026-03-01T09:00:00.000000Z",
      "updated_at": "2026-03-01T09:00:00.000000Z"
    },
    {
      "id": 2,
      "key": "message.updated",
      "type": "message",
      "name": "Message updated",
      "description": "A message is edited.",
      "group": "Messages",
      "metadata": {},
      "created_at": "2026-03-01T09:00:00.000000Z",
      "updated_at": "2026-03-01T09:00:00.000000Z"
    }
  ]
}