Levain LabsLevain Labs
API ReferenceOrganization

Create Webhook Endpoint

Register an HTTPS endpoint to receive org events.

Register an HTTPS endpoint to receive org events.

The signing secret is returned once, on creation only. Each event is POSTed as JSON with id, type, created_at, and data fields, and carries an x-levain-signature header of the form t=<unix>,v1=<hex>, where v1 is the HMAC-SHA256 of "{t}.{body}" under the secret — verify it before trusting a payload.

Event types: run.succeeded, run.failed, run.cancelled, credential.revoked. Failed deliveries are retried on a backoff schedule, from 1 minute up to 12 hours between attempts, then marked dead. An org can register up to 10 active endpoints.

POST
/api/v1/org/webhooks

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/org/webhooks" \  -H "Content-Type: application/json" \  -d '{    "url": "stringstring"  }'
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "url": "string",
  "event_types": [
    "string"
  ],
  "is_active": true,
  "secret": "string",
  "created_at": "2019-08-24T14:15:22Z"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}