Skip to content

API reference

Webhooks

Endpoints Anyrow posts batch events to, signed with your secret.

The Webhook object

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired

    1 to 48 characters.

  • namestringRequirednullable

    Up to 64 characters.

  • organization_idstringRequired

    1 to 48 characters.

  • urlstringRequired

    Up to 2048 characters.

  • secret_rotated_atintegerRequirednullable

    At least 0.

  • activebooleanRequired
The Webhook objectjson
{  "created_at": 1711468800000,  "updated_at": 1711468800000,  "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",  "name": "string",  "organization_id": "string",  "url": "https://example.com",  "secret_rotated_at": 1711468800000,  "active": true,  "failure_count": 42,  "last_triggered_at": 1711468800000,  "events": [    "batch.complete"  ]}

List webhooks

GET/v1/organizations/{organization_id}/webhooks

Path parameters

  • organization_idstringRequired

Query parameters

  • cursorstringoptional

    Opaque cursor for forward pagination. Pass the nextCursor from the previous response with the same order. Takes precedence over page when both are sent.

  • pageintegeroptional

    1-based page number for offset pagination. Ignored when cursor is present.

    At least 1.

  • orderstringoptional

    Sort keys, comma-separated, each field[.asc|.desc][.nullsfirst|.nullslast]; at most 3. Sortable: created_at, active. Default: created_at.desc. Nulls sort last ascending and first descending unless stated.

    Matches
    ^(?:created_at|active)(?:\.(?:asc|desc))?(?:\.(?:nullsfirst|nullslast))?(?:,(?:created_at|active)(?:\.(?:asc|desc))?(?:\.(?:nullsfirst|nullslast))?){0,2}$
  • filterstringoptional

    Filter expression field.op.value; , joins conditions with AND; group with or(...) and and(...). Fields: active (boolean: eq, ne, neq, is); created_at (number: eq, ne, neq, gt, gte, lt, lte, in, nin, is); id (string: eq, ne, neq, like, ilike, in, nin, is); name (string: eq, ne, neq, like, ilike, in, nin, is). like is case-sensitive and ilike ignores ASCII case; * is the wildcard. in/nin take (a,b); is takes null or notnull. At most 20 conditions, 3 nested groups, 100 in/nin values.

  • qstringoptional

    Free-text search over: name, url. Whitespace-separated terms must all match.

    Up to 200 characters.

  • limitintegeroptional

    Maximum number of items per page. Defaults to 20, capped by the endpoint's maxLimit.

    Default
    20

    Between 1 and 100.

Returns

200application/json

  • countintegerRequired

    At least 0.

  • hasMorebooleanRequired
  • limitintegerRequired

    At least 1.

  • nextCursorstringRequirednullable
  • pageintegerRequirednullable

    At least 1.

  • webhooksarray of objectsRequired
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.list({  params: {    organization_id: "{organization_id}"  },})
{  "count": 0,  "hasMore": true,  "limit": 1,  "nextCursor": "string",  "page": 1,  "webhooks": [    {      "created_at": 1711468800000,      "updated_at": 1711468800000,      "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",      "name": "string",      "organization_id": "string",      "url": "https://example.com",      "secret_rotated_at": 1711468800000,      "active": true,      "failure_count": 42,      "last_triggered_at": 1711468800000,      "events": [        "batch.complete"      ]    }  ]}

Create webhook

POST/v1/organizations/{organization_id}/webhooks

Path parameters

  • organization_idstringRequired

Request body

application/json

  • eventsarray of stringsRequired

    At least 1 items.

  • namestringoptional

    Up to 64 characters.

  • urlstringRequired
    Matches
    ^https:\/\/.*

    Up to 2048 characters.

Returns

201application/json

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired

    1 to 48 characters.

  • namestringRequirednullable

    Up to 64 characters.

  • organization_idstringRequired

    1 to 48 characters.

  • urlstringRequired

    Up to 2048 characters.

  • secret_rotated_atintegerRequirednullable

    At least 0.

  • activebooleanRequired
  • failure_countintegerRequired

    At least 0.

  • last_triggered_atintegerRequirednullable

    At least 0.

  • eventsarray of stringsRequired

    At least 1 items.

  • secretstringRequired
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.create({  params: {    organization_id: "{organization_id}"  },  json: {    events: [      "batch.complete"    ],    name: "string",    url: "https://example.com"  },})
{  "created_at": 1711468800000,  "updated_at": 1711468800000,  "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",  "name": "string",  "organization_id": "string",  "url": "https://example.com",  "secret_rotated_at": 1711468800000,  "active": true,  "failure_count": 42,  "last_triggered_at": 1711468800000,  "events": [    "batch.complete"  ],  "secret": "string"}

Get webhook

GET/v1/organizations/{organization_id}/webhooks/{id}

Path parameters

  • organization_idstringRequired
  • idstringRequired

Returns

200application/json

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired

    1 to 48 characters.

  • namestringRequirednullable

    Up to 64 characters.

  • organization_idstringRequired

    1 to 48 characters.

  • urlstringRequired

    Up to 2048 characters.

  • secret_rotated_atintegerRequirednullable

    At least 0.

  • activebooleanRequired
  • failure_countintegerRequired

    At least 0.

  • last_triggered_atintegerRequirednullable

    At least 0.

  • eventsarray of stringsRequired

    At least 1 items.

Errors

  • 404not_foundwebhook_not_found
Errors every endpoint can return
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.get({  params: {    organization_id: "{organization_id}",    id: "{id}"  },})
{  "created_at": 1711468800000,  "updated_at": 1711468800000,  "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",  "name": "string",  "organization_id": "string",  "url": "https://example.com",  "secret_rotated_at": 1711468800000,  "active": true,  "failure_count": 42,  "last_triggered_at": 1711468800000,  "events": [    "batch.complete"  ]}

Update webhook

PATCH/v1/organizations/{organization_id}/webhooks/{id}

Path parameters

  • organization_idstringRequired
  • idstringRequired

Request body

application/json

  • activebooleanoptional
  • eventsarray of stringsoptional

    At least 1 items.

  • namestringoptional

    Up to 64 characters.

  • urlstringoptional
    Matches
    ^https:\/\/.*

    Up to 2048 characters.

Returns

200application/json

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired

    1 to 48 characters.

  • namestringRequirednullable

    Up to 64 characters.

  • organization_idstringRequired

    1 to 48 characters.

  • urlstringRequired

    Up to 2048 characters.

  • secret_rotated_atintegerRequirednullable

    At least 0.

  • activebooleanRequired
  • failure_countintegerRequired

    At least 0.

  • last_triggered_atintegerRequirednullable

    At least 0.

  • eventsarray of stringsRequired

    At least 1 items.

Errors

  • 404not_foundwebhook_not_found
Errors every endpoint can return
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.update({  params: {    organization_id: "{organization_id}",    id: "{id}"  },  json: {    active: true,    events: [      "batch.complete"    ],    name: "string",    url: "https://example.com"  },})
{  "created_at": 1711468800000,  "updated_at": 1711468800000,  "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",  "name": "string",  "organization_id": "string",  "url": "https://example.com",  "secret_rotated_at": 1711468800000,  "active": true,  "failure_count": 42,  "last_triggered_at": 1711468800000,  "events": [    "batch.complete"  ]}

Delete webhook

DELETE/v1/organizations/{organization_id}/webhooks/{id}

Path parameters

  • organization_idstringRequired
  • idstringRequired

Returns

200application/json

  • idstringRequired

Errors

  • 404not_foundwebhook_not_found
Errors every endpoint can return
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.delete({  params: {    organization_id: "{organization_id}",    id: "{id}"  },})
{  "id": "string"}

List webhook deliveries

GET/v1/organizations/{organization_id}/webhooks/{id}/deliveries

Path parameters

  • organization_idstringRequired
  • idstringRequired

Query parameters

  • cursorstringoptional

    Opaque cursor for forward pagination. Pass the nextCursor from the previous response with the same order. Takes precedence over page when both are sent.

  • pageintegeroptional

    1-based page number for offset pagination. Ignored when cursor is present.

    At least 1.

  • orderstringoptional

    Sort keys, comma-separated, each field[.asc|.desc][.nullsfirst|.nullslast]; at most 3. Sortable: created_at, status. Default: created_at.desc. Nulls sort last ascending and first descending unless stated.

    Matches
    ^(?:created_at|status)(?:\.(?:asc|desc))?(?:\.(?:nullsfirst|nullslast))?(?:,(?:created_at|status)(?:\.(?:asc|desc))?(?:\.(?:nullsfirst|nullslast))?){0,2}$
  • limitintegeroptional

    Maximum number of items per page. Defaults to 20, capped by the endpoint's maxLimit.

    Default
    20

    Between 1 and 100.

  • eventstringoptional
    Allowed values
    batch.completebatch.failedbatch.partialping
  • statusstringoptional
    Allowed values
    pendingsuccessfailed

Returns

200application/json

  • countintegerRequired

    At least 0.

  • hasMorebooleanRequired
  • limitintegerRequired

    At least 1.

  • nextCursorstringRequirednullable
  • pageintegerRequirednullable

    At least 1.

  • deliveriesarray of objectsRequired

Errors

  • 404not_foundwebhook_not_found
Errors every endpoint can return
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.deliveries({  params: {    organization_id: "{organization_id}",    id: "{id}"  },})
{  "count": 0,  "hasMore": true,  "limit": 1,  "nextCursor": "string",  "page": 1,  "deliveries": [    {      "created_at": 1711468800000,      "id": "whdlv_01h5a3g8k9m2n4p6q8r0t2v4x6",      "webhook_id": "string",      "event": "batch.complete",      "payload_json": "string",      "status": "pending",      "http_status": 42,      "response_body": "string",      "attempt": 42,      "next_retry_at": 1711468800000,      "delivered_at": 1711468800000    }  ]}

Rotate webhook secret

POST/v1/organizations/{organization_id}/webhooks/{id}/rotate-secret

Path parameters

  • organization_idstringRequired
  • idstringRequired

Returns

200application/json

  • created_atintegerRequired

    At least 0.

  • updated_atintegerRequired

    At least 0.

  • idstringRequired

    1 to 48 characters.

  • namestringRequirednullable

    Up to 64 characters.

  • organization_idstringRequired

    1 to 48 characters.

  • urlstringRequired

    Up to 2048 characters.

  • secret_rotated_atintegerRequirednullable

    At least 0.

  • activebooleanRequired
  • failure_countintegerRequired

    At least 0.

  • last_triggered_atintegerRequirednullable

    At least 0.

  • eventsarray of stringsRequired

    At least 1 items.

  • secretstringRequired

Errors

  • 404not_foundwebhook_not_found
Errors every endpoint can return
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.rotateSecret({  params: {    organization_id: "{organization_id}",    id: "{id}"  },})
{  "created_at": 1711468800000,  "updated_at": 1711468800000,  "id": "whook_01h5a3g8k9m2n4p6q8r0t2v4x6",  "name": "string",  "organization_id": "string",  "url": "https://example.com",  "secret_rotated_at": 1711468800000,  "active": true,  "failure_count": 42,  "last_triggered_at": 1711468800000,  "events": [    "batch.complete"  ],  "secret": "string"}

Send test webhook

POST/v1/organizations/{organization_id}/webhooks/{id}/test

Path parameters

  • organization_idstringRequired
  • idstringRequired

Returns

200application/json

  • http_statusnumberRequirednullable
  • response_bodystringRequirednullable

    Up to 1024 characters.

  • statusstringRequired
    Allowed values
    errorsuccesstimeout

Errors

  • 404not_foundwebhook_not_found
Errors every endpoint can return
import { AnyrowSDK } from "@anyrow/sdk"const anyrow = new AnyrowSDK({  baseURL: "https://api.anyrow.ai",  headers: { Authorization: `ApiKey ${process.env.ANYROW_API_KEY}` },})const { data, error } = await anyrow.webhook.test({  params: {    organization_id: "{organization_id}",    id: "{id}"  },})
{  "http_status": 0,  "response_body": "string",  "status": "error"}