# Create a webhook endpoint

[All field references](/en/developers/field-reference) · [Webhooks](/en/developers/fields-group-webhooks)

`POST /v1/webhook-endpoints`

Registers an https URL to which Meykt sends events about the orders of this channel (order.received, order.production_started, order.production_completed, order.production_failed, order.cancelled, order_item.completed, ping). The response contains the signing secret EXACTLY ONCE — use it to verify the X-Meykt-Signature header (t=<unix>,v1=<hmac-sha256 over "t.body">, tolerance ±5 min, constant-time comparison). Delivery is "at least once": discard duplicates by event id. At most 5 active URLs per connection; URLs with persistent failures are switched off automatically. Requires a live API key.

Required scopes: `"webhooks:manage"`.

[How to read these tables](/en/developers/field-reference#reading-the-field-tables)

## Request body

Request body required.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | Examples: `[{"url":"https://erp.example.com/meykt/events","description":"ERP event receiver"}]`. Additional properties are not allowed. |
| url | string | Required when parent is present | Not allowed | Public HTTPS webhook receiver URL. Credentials, private networks and unsafe destinations are rejected before registration. minLength: `12`. maxLength: `2000`. format: `"uri"`. |
| description | string | Optional | Not allowed | Display label identifying this webhook receiver in Meykt. minLength: `1`. maxLength: `200`. |

## Response 201

201: Success

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | — |
| data | object | Required when parent is present | Not allowed | Authorized response payload or documented event data. |
| data.endpoint | object | Required when parent is present | Not allowed | Webhook endpoint configuration for this connection. |
| data.endpoint.id | string | Required when parent is present | Not allowed | Stable entry identifier. format: `"uuid"`. |
| data.endpoint.url | string | Required when parent is present | Not allowed | Registered public HTTPS webhook receiver URL. format: `"uri"`. |
| data.endpoint.description | string | Optional | Not allowed | Human-readable description of the record or goods being reported. |
| data.endpoint.is_active | boolean | Required when parent is present | Not allowed | Whether this entry is currently active and available for ordinary use. |
| data.endpoint.disabled_reason | string | Optional | Not allowed | too_many_failures = switched off automatically after persistent delivery failures. enum: `["manual","too_many_failures"]`. |
| data.endpoint.consecutive_failures | integer | Optional | Not allowed | Number of consecutive failed delivery attempts for this endpoint. |
| data.endpoint.last_success_at | string | Optional | Not allowed | Time of the latest successful delivery to this endpoint. format: `"date-time"`. |
| data.endpoint.last_failure_at | string | Optional | Not allowed | Time of the latest failed delivery to this endpoint. format: `"date-time"`. |
| data.endpoint.created_at | string | Required when parent is present | Not allowed | Created at, with time-zone offset. format: `"date-time"`. |
| data.secret | string | Required when parent is present | Not allowed | Signing secret (whsec_…). Shown only this one time — store it securely. Example: `"whsec_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"`. |

## Response 400, 401, 403, 413, 422, 429, 500, 503

400: The request is not valid JSON. 401: The key is missing, unknown, revoked or expired. 403: The key lacks a required scope, or the operation requires a live key. 413: The JSON request exceeds 256 KiB. 422: Content validation failed. The response lists all affected locations at once. 429: A rate limit was reached and the request did not run. Wait for Retry-After, then repeat it unchanged. X-RateLimit-Scope names the limit: key (120 requests per minute), organization (300 per minute across all keys), write (1,000 at once, refilling at 60 per minute) or list (300 unfiltered list pages at once, refilling at 10 per minute). 500: Unexpected error on our side. 503: Temporarily unavailable. Repeat the same request with the same business identity.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | — |
| error | object | Required when parent is present | Not allowed | Machine-readable error code; use it to select the documented recovery path. |
| error.code | string | Required when parent is present | Not allowed | Machine-readable, permanently stable error code. Program against it, not against message. |
| error.message | string | Required when parent is present | Not allowed | Explanation for humans. May change at any time. |
| error.field | string | Optional | Not allowed | Affected location in the request, if it can be determined. |
| error.doc_url | string | Required when parent is present | Not allowed | Documentation link explaining this API error. format: `"uri"`. |
