CapyDB Docs
ReferenceAPI

Webhooks

Outbound webhook endpoints and delivery history.

GET
/v1/organizations/{orgID}/webhook-endpoints

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/organizations/string/webhook-endpoints"
{  "webhook_endpoints": [    {      "created_at": "2019-08-24T14:15:22Z",      "description": "string",      "event_types": [        "string"      ],      "id": "string",      "is_active": true,      "organization_id": "string",      "updated_at": "2019-08-24T14:15:22Z",      "url": "http://example.com",      "health": "healthy"    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/organizations/{orgID}/webhook-endpoints

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/organizations/string/webhook-endpoints" \  -H "Content-Type: application/json" \  -d '{    "url": "http://example.com"  }'
{  "webhook_endpoint": {    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "event_types": [      "string"    ],    "id": "string",    "is_active": true,    "organization_id": "string",    "updated_at": "2019-08-24T14:15:22Z",    "url": "http://example.com"  },  "plaintext_secret": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
PATCH
/v1/organizations/{orgID}/webhook-endpoints/{endpointID}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

endpointID*string

Webhook endpoint id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/v1/organizations/string/webhook-endpoints/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "webhook_endpoint": {    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "event_types": [      "string"    ],    "id": "string",    "is_active": true,    "organization_id": "string",    "updated_at": "2019-08-24T14:15:22Z",    "url": "http://example.com"  }}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
DELETE
/v1/organizations/{orgID}/webhook-endpoints/{endpointID}

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

endpointID*string

Webhook endpoint id.

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://example.com/v1/organizations/string/webhook-endpoints/string"
{  "deleted": true}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
POST
/v1/organizations/{orgID}/webhook-endpoints/{endpointID}/rotate-secret

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

endpointID*string

Webhook endpoint id.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/organizations/string/webhook-endpoints/string/rotate-secret"
{  "webhook_endpoint": {    "created_at": "2019-08-24T14:15:22Z",    "description": "string",    "event_types": [      "string"    ],    "id": "string",    "is_active": true,    "organization_id": "string",    "updated_at": "2019-08-24T14:15:22Z",    "url": "http://example.com"  },  "plaintext_secret": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
GET
/v1/organizations/{orgID}/webhook-endpoints/{endpointID}/deliveries

Authorization

AuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

In: header

Path Parameters

orgID*string

Organization id.

endpointID*string

Webhook endpoint id.

Query Parameters

limit?integer

Maximum number of deliveries to return (default 50).

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/organizations/string/webhook-endpoints/string/deliveries"
{  "deliveries": [    {      "attempts": 0,      "created_at": "2019-08-24T14:15:22Z",      "delivered_at": "2019-08-24T14:15:22Z",      "endpoint_id": "string",      "event_type": "string",      "id": "string",      "last_error": "string",      "max_attempts": 0,      "next_attempt_at": "2019-08-24T14:15:22Z",      "organization_id": "string",      "payload": null,      "response_status": 0,      "state": "pending",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}
{  "error": "string"}