Create a webhook endpoint

Add an endpoint, and get its signing secret once

POST/v1/webhook-endpoints

Adds an endpoint in the call's project and environment, and answers its signing secret, signingSecret, in this answer only: no request returns it again, so store it now, and check each delivery's signature with it. It needs the webhooks:write scope on the token and the developer or admin role.

This route takes a personal access token only, and works in the project named by x-mapier-project and the environment named by x-mapier-environment (live when not sent). An endpoint of another project or environment is a 404, the same answer an id that never existed gets.

Body

FieldMeans
urlWhere to POST each event: https in live, http or https in test. Required
eventTypesThe event types to send it, at least one. Nothing else reaches it. Required
descriptionWhat it is for, up to 500 characters

No URL may carry a username or password or point at a private address. A project holds five endpoints in each environment; a sixth is a 409 limit_reached.

Example request

curl -X POST https://api.mapier.ai/v1/webhook-endpoints \
  -H "Authorization: Bearer $MAPIER_TOKEN" \
  -H "x-mapier-project: 0192a7b0-1c2d-7e3f-8a4b-5c6d7e8f9a0b" \
  -H "x-mapier-version: 2026-12-01" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/mapier/webhooks",
    "description": "Support bot inbox",
    "eventTypes": ["message.received", "message.failed"]
  }'

Response

201 Created
{
  "id": "0192a7f0-3c4d-7e5f-8a60-7c8d9e0f1a2b",
  "url": "https://example.com/mapier/webhooks",
  "description": "Support bot inbox",
  "eventTypes": ["message.received", "message.failed"],
  "enabled": true,
  "signingSecretPreview": "whsec_exam",
  "previousSecretExpiresAt": null,
  "lastDeliveryAt": null,
  "lastDeliveryStatus": null,
  "createdAt": "2026-09-02T14:10:00.000Z",
  "updatedAt": "2026-09-02T14:10:00.000Z",
  "signingSecret": "whsec_example-not-a-real-secret"
}

Errors

StatusCodeReasonWhenChannels
400bad_requestThe body is not valid JSON, the channel rejected the request as malformed, or a header the call needs is missing.All
401invalid_credentialsThe API key or personal access token is missing, malformed, unknown, revoked or expired.All
403forbiddenThe credential may not make this call here. details.reason says why.All
403insufficient_scopeThe key or token does not carry the scope this route needs.All
404not_foundNothing with that id exists in this project.All
409limit_reachedA limit is reached: a test line's daily cap, or the dedicated lines your organization pays for.All
409project_archivedThe key's project is archived.All
413payload_too_largeThe body is over 65,536 bytes.All
422validation_failedA field is wrong, and details names each one at its path.All
429rate_limitedToo many requests for this route's budget.All
500internal_errorMapier failed on its side, and has been alerted.All
503service_busyMapier is busy and did nothing with this request. details.retryAfter says how many seconds to wait.All
503upstream_unavailableThe channel did not take the command, or gave no answer Mapier could use.All