Create a webhook endpoint
Registers the project's webhook endpoint. The response contains the signing `secret` (`whsec_…`) — **shown only once**; store it. The endpoint starts in status `pending` and receives nothing until it is verified from the dashboard: Wire sends a signed `endpoint.verification` ping and your URL must answer `2xx`. **Errors** (besides the common ones): - `409 webhook_endpoint_exists` — the project already has its one endpoint; update it instead. - `400 webhook_url_invalid` (`url`) — not an absolute `http(s)` URL, or it points at `localhost` / a private, loopback or link-local IP. - `400 enabled_events_invalid` (`enabled_events`) — an unknown event name, or more than 20 entries.
/v1/webhook_endpointsAuthorization
bearerAuth Secret API key as a bearer token: Authorization: Bearer sk_live_….
Test keys (sk_test_…) are refused with 401 test_mode_unavailable.
Keys are issued per project in the dashboard. Never expose a secret
key in browser or mobile code.
In: header
Header Parameters
Required on every POST and DELETE (missing → 400 parameter_missing; longer than 255 characters → 400 parameter_invalid). Use one stable key per logical operation, e.g. your order id plus the action. A retry with the same key and the same body returns the recorded response (header Idempotent-Replayed: true) instead of acting twice. The same key with a different body or path → 409 idempotency_key_in_use. While the first request is still running, a duplicate gets 409 idempotency_in_flight — wait a moment and retry. Successful (2xx) and declined (402) responses are recorded for 48 hours; other errors are not, so a retry after fixing a 400 runs normally. Keys are scoped to the API key's project.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/webhook_endpoints" \ -H "Idempotency-Key: order-1001-create" \ -H "Content-Type: application/json" \ -d '{ "url": "https://yourshop.mn/webhooks/wire" }'{
"id": "we_t5kz2m7qx3wn4vbc6rjy2dfa6h",
"object": "webhook_endpoint",
"url": "https://yourshop.mn/webhooks/wire",
"enabled_events": [
"*"
],
"status": "pending",
"secret": "whsec_REPLACE_WITH_YOUR_SECRET",
"livemode": true,
"created": 1791770400
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "amount is required",
"param": "amount",
"request_id": "req_8f3a1c9e5b7d2f4a6c0e9b1d"
}
}{
"error": {
"type": "api_error",
"code": "test_mode_unavailable",
"message": "test keys are not accepted by this API; use a live secret key",
"request_id": "req_8f3a1c9e5b7d2f4a6c0e9b1d"
}
}{
"error": {
"type": "invalid_request_error",
"code": "webhook_endpoint_exists",
"message": "The project already has a webhook endpoint. Update the existing one instead.",
"request_id": "req_8f3a1c9e5b7d2f4a6c0e9b1d"
}
}