# Webhooks

> Canonical URL: https://docs.mountaya.com/en/apis/map-studio/reference/webhooks/
> Last updated: 2026-11-26
> Rules for agents: https://docs.mountaya.com/llms.txt#rules-for-agents

Where an organization's webhook events are delivered, and how reliably: its endpoints, every event recorded, every delivery made, to an endpoint or as a notification email, and the reliability report that keeps Mountaya's service availability apart from each endpoint's success.

 Every operation here needs a session token beside the key.

## The WebhookEndpoint object

A webhook endpoint: a URL of the organization's own that Mountaya delivers webhook events to, signed with the endpoint's secret. The secret is answered once, by `postOrganizationWebhookEndpoint`, and never by a read.

- `id` (string (uuid), required): Identifier of the endpoint, the `webhook_endpoint_id` a delivery names.

- `organization_id` (string (uuid), required): Identifier of the organization the endpoint belongs to.

- `url` (string (uri), required): The URL Mountaya delivers to: `https`, on a host that resolves to a public address, answered within 10 seconds. A redirect is never followed.

- `description` (string | null, required): What the endpoint is for, as the organization wrote it, null when it has none.

- `enabled_events` (array of string, required): The event types the endpoint is sent: each a member of `WebhookEventType`, a family followed by `.*` for every type of the family, such as `organization.member.*`, or `*` for every public type, those added to the contract later included.

- `status` (string, required, one of: `enabled`, `disabled`): Whether Mountaya delivers to the endpoint.

- `disabled_reason` (string | null, required, one of: `requested`, `failing`): Why the endpoint is disabled, null while it is enabled.

- `disabled_at` (string (date-time) | null, required): When the endpoint was disabled, null while it is enabled.

- `failing_since` (string (date-time) | null, required): When the endpoint's run of failed deliveries began, null while its last delivery succeeded. At 24 hours Mountaya records `organization.webhook_endpoint.failing` and emails the organization's owners and admins; at 72 hours it disables the endpoint. A delivery that succeeds after the run was reported records `organization.webhook_endpoint.recovered`. Read it before enabling a disabled endpoint again, which clears it, to redeliver from it.

- `etag` (string, required): The version of the endpoint, the one the `ETag` of a read of it carries, opaque and compared whole. It moves on every change to the endpoint's configuration and status, and never with its health: a delivery failing or succeeding again moves `failing_since` and leaves it as it is. Send it as `If-Match` to make `patchOrganizationWebhookEndpoint` or `deleteOrganizationWebhookEndpoint` conditional.

- `created_by` (RelationToUser | null, required): The member who created the endpoint, null when their account has been deleted.

  See [the RelationToUser object](https://docs.mountaya.com/en/apis/map-studio/reference/users.md#relation-to-user-object).

- `created_at` (string (date-time), required): When the endpoint was created.

- `updated_at` (string (date-time), required): When the endpoint's configuration or status last changed. Its health, `failing_since`, does not move it.

### An example WebhookEndpoint

```json
{
  "id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
  "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  "url": "https://hooks.example.com/mountaya",
  "description": "Membership sync",
  "enabled_events": [
    "organization.member.*",
    "organization.invitation.accepted"
  ],
  "status": "enabled",
  "disabled_reason": null,
  "disabled_at": null,
  "failing_since": null,
  "etag": "\"d6\"",
  "created_by": {
    "id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18"
  },
  "created_at": "2026-11-02T13:05:47Z",
  "updated_at": "2026-11-14T09:12:44Z"
}
```

## List an organization's webhook endpoints

### GET /v1/organizations/{organization_id}/webhook-endpoints

- Operation: `getOrganizationWebhookEndpoints`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns the organization's webhook endpoints, enabled and disabled, each with the event types it is sent, its status and when its run of failed deliveries began. A secret is never answered: `postOrganizationWebhookEndpoint` answers it once.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- The listing is paged, 50 endpoints a page unless `limit` says otherwise, oldest first. An organization holds 2 unless its agreement says otherwise, 6 at most, so one page holds them all. Send the page's `next_cursor` back as `cursor` for the next one; the last page reports `next_cursor: null`.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

**Query parameters**

- `cursor` (string, in query, optional): Where the page starts: the `next_cursor` the previous page reported at `extensions.metadata.pagination`, sent back unchanged. Omitted, the listing starts at its first item.

  A cursor is opaque: it is not an offset and not an identifier, and a client never builds or edits one, and it is never longer than 1024 characters. It is bound to the operation that issued it, to its filters and its `sort`, and to the scope it listed, such as the organization or the collection in the path or the key's own organization. On `getItineraries`, `getZones` and `getCollections`, whose scope `organization_id` may leave implicit, it is bound as well to the tier of the credential it was issued to, a key alone (or with a session token minted without `user_id`, which reads as one) or a key with a session token naming a member. The next page is asked for the same way. A cursor sent to another operation, with different filters, a different `sort`, another scope or, on those three, another tier of credential, or altered in any way, is a `400` at `["request", "query", "cursor"]`. On every listing, each page applies the read tier of the credential that asks for it. Paging is by position in the sort order rather than by count, so an item whose sort key does not change is never skipped or served twice, whatever is created or deleted between two pages.

- `limit` (integer (int32), in query, optional, default: `50`): How many items one page holds, between 1 and 100; 50 when omitted, on every listing that pages. `extensions.metadata.pagination.limit` reports the size the page was served at. A page shorter than `limit` is not how the end is told: the end is a `next_cursor` of `null`. The page is cut after authorization, so it never widens what a caller can read.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

One page of the organization's webhook endpoints, oldest first. `extensions.metadata.pagination.next_cursor` asks for the next page, and is `null` on the last.

- `extensions` (object, required): The envelope's second half, everything the answer carries that is not the answer itself. Here that is `metadata.pagination` alone: the `limit` this page was served at, and the `next_cursor` of the page after it, null on the last.
  - `metadata` (ListMetadata, required): The `extensions.metadata` object every listing that pages returns. It carries the page and nothing else, so `extensions.metadata.pagination` is the one path a client reads paging from. A listing that does not page, a catalog or a usage series, answers with no `extensions` at all.
    - `pagination` (object, required): The page this listing served, and the cursor of the next one.
      - `limit` (integer (int32), required): The page size the listing was served at: the `limit` sent, or 50 when none was.
      - `next_cursor` (string | null, required): The `cursor` that asks for the page after this one, with the same filters and `sort`, or null when this page is the last. A page that is not the last may hold fewer than `limit` items; the end is told by this field alone.

- `data` (array of WebhookEndpoint, required): See [the WebhookEndpoint object](https://docs.mountaya.com/en/apis/map-studio/reference/webhooks.md#webhook-endpoint-object).

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookEndpoints({ organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b" });

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": [
    {
      "id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
      "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
      "url": "https://hooks.example.com/mountaya",
      "description": "Membership sync",
      "enabled_events": [
        "organization.member.*",
        "organization.invitation.accepted"
      ],
      "status": "enabled",
      "disabled_reason": null,
      "disabled_at": null,
      "failing_since": null,
      "etag": "\"d6\"",
      "created_by": {
        "id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18"
      },
      "created_at": "2026-11-02T13:05:47Z",
      "updated_at": "2026-11-14T09:12:44Z"
    }
  ],
  "extensions": {
    "metadata": {
      "pagination": {
        "limit": 50,
        "next_cursor": "eyJ2IjoxLCJzIjoiLXVwZGF0ZWRfYXQifQ"
      }
    }
  }
}
```

## Create a webhook endpoint

### POST /v1/organizations/{organization_id}/webhook-endpoints

- Operation: `postOrganizationWebhookEndpoint`
- Requires: scope `management` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: answers within 30000 ms or times out

Creates an endpoint Mountaya delivers the organization's webhook events to: every event of a type its `enabled_events` names, from the next one recorded on, signed with a secret of its own, answered here once. A create sent twice without an `Idempotency-Key` makes two endpoints; with one, the second is not answered the first one's endpoint, since that answer carried the secret and is never kept: it is the `409` coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`. A create sent again with the key, after the first failed with a `5xx` once the endpoint was made, is that `409` too, whose `extensions.metadata.location` names the endpoint made, `/v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}`. This API answers a secret once: an owner or an admin reads that endpoint's again in Mountaya's web application, or deletes it and creates another.

- Owner or admin only (403 otherwise).
- `url` is `https`, written in printable ASCII, at most 2048 characters, with no credentials before its host and no fragment, its host, port included, at most 259 characters; and that host resolves to a public address: a private, loopback or link-local one is a `400` naming `url`, and so is one Mountaya cannot resolve. A redirect is never followed.
- `enabled_events` names types, families followed by `.*`, or `*`. A type or a family the contract does not publish is a `400` naming its position; `getWebhookEventTypes` lists them.
- An organization holds 2 endpoints, enabled and disabled, unless its agreement says otherwise, 6 at most: one more is refused at `webhook-endpoints`, a `429` coded `LIMIT_REACHED` with no `Retry-After`. Delete one first, or agree a higher limit. An organization whose limit was lowered below what it holds keeps its endpoints, and creates none until it holds fewer than the limit.
- It is limited, together with the organization's other endpoint writes the [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md) page lists, to 30 a minute per user and then 300 a minute per organization; past either, the answer is a `429` carrying `Retry-After`, and nothing is done.
- Mountaya delivers each event at least once, in no promised order, retrying a failed attempt for about 72 hours. The [Webhooks overview](https://docs.mountaya.com/en/webhooks.md) says how a delivery is signed, retried and recorded.

Requires a publishable key with the `management` scope AND a session token naming a user, a member with the owner or admin role, whom the request acts as. A session token minted without `user_id` is refused with **401**, and a publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Webhook events** [`organization.webhook_endpoint.created`](https://docs.mountaya.com/en/webhooks/events/organization-webhook-endpoint.md#organization-webhook-endpoint-created), recorded by the task `organization.webhook_endpoint.create`.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Body**

Where to deliver, and which event types.

- `url` (string (uri), in body, required): The URL Mountaya delivers to. It is `https`, written in printable ASCII, at most 2048 characters, with no credentials before its host and no fragment, its host, port included, at most 259 characters; and that host resolves to a public address: a private, loopback or link-local one is a `400` naming `url`, and so is one that cannot be resolved.

- `description` (string, in body, optional): What the endpoint is for, at most 100 characters, trimmed. Omitted, the endpoint has none.

- `enabled_events` (array of string, in body, required): The event types the endpoint is sent: each a member of `WebhookEventType`, a family followed by `.*`, or `*` for every public type, those added later included. A type or a family the contract does not publish is a `400` naming its position.

**Response** `201`

The endpoint as created, with its secret, shown here once. `Location` names it, `/v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}`, the path `getOrganizationWebhookEndpoint` reads it at.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookEndpointWithSecret, required): A webhook endpoint as `postOrganizationWebhookEndpoint` answers it: the endpoint, and the secret its deliveries are signed with. This is the one answer that carries the secret, and it is never kept for the request's `Idempotency-Key`, so store it before anything else.
  - `id` (string (uuid), required): Identifier of the endpoint, the `webhook_endpoint_id` a delivery names.
  - `organization_id` (string (uuid), required): Identifier of the organization the endpoint belongs to.
  - `url` (string (uri), required): The URL Mountaya delivers to: `https`, on a host that resolves to a public address, answered within 10 seconds. A redirect is never followed.
  - `description` (string | null, required): What the endpoint is for, as the organization wrote it, null when it has none.
  - `enabled_events` (array of string, required): The event types the endpoint is sent: each a member of `WebhookEventType`, a family followed by `.*` for every type of the family, such as `organization.member.*`, or `*` for every public type, those added to the contract later included.
  - `status` (string, required, one of: `enabled`, `disabled`): Whether Mountaya delivers to the endpoint.
  - `disabled_reason` (string | null, required, one of: `requested`, `failing`): Why the endpoint is disabled, null while it is enabled.
  - `disabled_at` (string (date-time) | null, required): When the endpoint was disabled, null while it is enabled.
  - `failing_since` (string (date-time) | null, required): When the endpoint's run of failed deliveries began, null while its last delivery succeeded. At 24 hours Mountaya records `organization.webhook_endpoint.failing` and emails the organization's owners and admins; at 72 hours it disables the endpoint. A delivery that succeeds after the run was reported records `organization.webhook_endpoint.recovered`. Read it before enabling a disabled endpoint again, which clears it, to redeliver from it.
  - `etag` (string, required): The version of the endpoint, the one the `ETag` of a read of it carries, opaque and compared whole. It moves on every change to the endpoint's configuration and status, and never with its health: a delivery failing or succeeding again moves `failing_since` and leaves it as it is. Send it as `If-Match` to make `patchOrganizationWebhookEndpoint` or `deleteOrganizationWebhookEndpoint` conditional.
  - `created_by` (RelationToUser | null, required): The member who created the endpoint, null when their account has been deleted.

    See [the RelationToUser object](https://docs.mountaya.com/en/apis/map-studio/reference/users.md#relation-to-user-object).
  - `created_at` (string (date-time), required): When the endpoint was created.
  - `updated_at` (string (date-time), required): When the endpoint's configuration or status last changed. Its health, `failing_since`, does not move it.
  - `secret` (string, required): The endpoint's signing secret: `whsk_` and 64 lowercase hexadecimal characters. Every delivery's `Mountaya-Signature` is the HMAC-SHA256 of the delivery keyed by it, as that header says. It is shown here once.

Response headers:

- `Location`: The path of what the request created, relative to this host. A part of an itinerary is addressed under its itinerary, so a new segment's is `/v1/itineraries/{itinerary_id}/segments/{segment_id}`.
- `ETag`: The version of the resource this answer returns, an opaque strong tag in double quotes, equal to that resource's `etag` field. Send it back as `If-Match` to make a write conditional on nobody having changed the resource since. It changes whenever what this read returns changes; compare it whole and never parse it. Present on every answer that returns the resource, and on the `412` that refuses a stale `If-Match`.
- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

**Errors** `400`, `401`, `403`, `404`, `409`, `413`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`. A `url` that is not `https`, or whose host resolves to an address Mountaya never delivers to, is refused at `url`; a type or a family the contract does not publish at its position in `enabled_events`. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the user the session token names is not a member of the key's organization, or is a member who is neither owner nor admin. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `409`: `IdempotencyKeyInUse`, given in full at the end of this page.
- `413`: Payload Too Large
- `429`: `TooManyRequestsOrLimitReached`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s -X POST https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://hooks.example.com/mountaya",
    "enabled_events": ["organization.member.*"]
  }' | jq '.data.secret'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.postOrganizationWebhookEndpoint({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  body: {
    url: "https://hooks.example.com/mountaya",
    enabled_events: ["organization.member.*"],
  },
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.post(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "url": "https://hooks.example.com/mountaya",
        "enabled_events": ["organization.member.*"],
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 201:

```json
{
  "data": {
    "id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "url": "https://hooks.example.com/mountaya",
    "description": "Membership sync",
    "enabled_events": [
      "organization.member.*",
      "organization.invitation.accepted"
    ],
    "status": "enabled",
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "etag": "\"d1\"",
    "created_by": {
      "id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18"
    },
    "created_at": "2026-11-02T13:05:47Z",
    "updated_at": "2026-11-02T13:05:47Z",
    "secret": "whsk_8f3c2a71b845d0e4c7a6b3f180d92e5a17c4e9b0d36f2a58e1c7b4093d6a2f15"
  }
}
```

## Retrieve a webhook endpoint

### GET /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}

- Operation: `getOrganizationWebhookEndpoint`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns one of the organization's webhook endpoints, as `getOrganizationWebhookEndpoints` lists it. Its secret is never answered.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- The answer's `ETag` is the endpoint's `etag`. Send it as `If-Match` on `patchOrganizationWebhookEndpoint` or `deleteOrganizationWebhookEndpoint` to make the change conditional on nobody having changed the endpoint since.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

- `webhook_endpoint_id` (string (uuid), in path, required): Identifier of the webhook endpoint, the `id` a `WebhookEndpoint` carries. One that names no endpoint of the organization, another organization's included, is answered `404`, so an endpoint id cannot be probed here.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

The endpoint, without its secret.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookEndpoint, required): A webhook endpoint: a URL of the organization's own that Mountaya delivers webhook events to, signed with the endpoint's secret. The secret is answered once, by `postOrganizationWebhookEndpoint`, and never by a read.

  See [the WebhookEndpoint object](https://docs.mountaya.com/en/apis/map-studio/reference/webhooks.md#webhook-endpoint-object).

Response headers:

- `ETag`: The version of the resource this answer returns, an opaque strong tag in double quotes, equal to that resource's `etag` field. Send it back as `If-Match` to make a write conditional on nobody having changed the resource since. It changes whenever what this read returns changes; compare it whole and never parse it. Present on every answer that returns the resource, and on the `412` that refuses a stale `If-Match`.

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: The organization has no webhook endpoint with the identifier given, one of another organization included, so an endpoint id cannot be probed here. Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints/e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85 \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookEndpoint({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  webhook_endpoint_id: "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
});

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints/e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "url": "https://hooks.example.com/mountaya",
    "description": "Membership sync",
    "enabled_events": [
      "organization.member.*",
      "organization.invitation.accepted"
    ],
    "status": "enabled",
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "etag": "\"d6\"",
    "created_by": {
      "id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18"
    },
    "created_at": "2026-11-02T13:05:47Z",
    "updated_at": "2026-11-14T09:12:44Z"
  }
}
```

## Update a webhook endpoint

### PATCH /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}

- Operation: `patchOrganizationWebhookEndpoint`
- Requires: scope `management` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Changes an endpoint's URL, description, event types or status. Each field is optional and an omitted one keeps its value; `enabled_events` is replaced whole. An empty object changes nothing and answers the endpoint as it stands.

- Owner or admin only (403 otherwise).
- `url` and `enabled_events` are held to the rules of a new endpoint's, and refused the same way.
- `status` `disabled` stops every delivery to the endpoint, the ones still retrying included, which end `canceled`. `enabled` starts them again from the next event recorded, and clears `failing_since`; the events recorded while it was disabled are not sent on their own, and `postOrganizationWebhookDelivery` redelivers those of the last 30 days.
- The secret is not changed here.
- `If-Match` makes the change conditional: send the endpoint's `etag`, and an endpoint changed since is refused with `412`, changing nothing.
- It is limited, together with the organization's other endpoint writes the [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md) page lists, to 30 a minute per user and then 300 a minute per organization; past either, the answer is a `429` carrying `Retry-After`, and nothing is done.

Requires a publishable key with the `management` scope AND a session token naming a user, a member with the owner or admin role, whom the request acts as. A session token minted without `user_id` is refused with **401**, and a publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Webhook events** [`organization.webhook_endpoint.updated`](https://docs.mountaya.com/en/webhooks/events/organization-webhook-endpoint.md#organization-webhook-endpoint-updated), [`organization.webhook_endpoint.enabled`](https://docs.mountaya.com/en/webhooks/events/organization-webhook-endpoint.md#organization-webhook-endpoint-enabled), [`organization.webhook_endpoint.disabled`](https://docs.mountaya.com/en/webhooks/events/organization-webhook-endpoint.md#organization-webhook-endpoint-disabled), recorded by the task `organization.webhook_endpoint.update`.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

- `webhook_endpoint_id` (string (uuid), in path, required): Identifier of the webhook endpoint, the `id` a `WebhookEndpoint` carries. One that names no endpoint of the organization, another organization's included, is answered `404`, so an endpoint id cannot be probed here.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

- `If-Match` (string, in header, optional): Makes the write conditional on the resource still being the version the caller read: the `ETag` an earlier answer carried, which is also that resource's `etag` field, or `*` for any version. When the resource has changed since, the write is refused with `412` `PRECONDITION_FAILED`, nothing is changed, and the answer carries the current `ETag`, so the caller reads the resource again and decides. Omitted, the write is unconditional and the last write wins.

  One strong tag in double quotes, or `*`. A list of tags, a weak tag (`W/`) or any other spelling is a `400` naming the header. A resource the caller cannot see is answered `404` before the condition is asked, so a stale tag never tells a caller anything a read would not.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Body**

What to change. Send only what is changing.

- `url` (string (uri), in body, optional): The URL Mountaya delivers to from the next delivery on, held to the rules of a new endpoint's. A delivery still retrying is sent to it.

- `description` (string | null, in body, optional): What the endpoint is for, at most 100 characters, trimmed. `null` clears it.

- `enabled_events` (array of string, in body, optional): The event types the endpoint is sent, replacing the list whole, as a new endpoint's. The list is read when an event is handed to its deliveries, a moment after it is recorded: an event recorded just before the change may be delivered by either list, and every later one by the new.

- `status` (string, in body, optional, one of: `enabled`, `disabled`): `disabled` stops every delivery to the endpoint, those still retrying included, with `disabled_reason` `requested`; `enabled` starts them again from the next event, and clears `failing_since`. The events recorded meanwhile are not sent on their own: `postOrganizationWebhookDelivery` redelivers them.

**Response** `200`

The endpoint after the change, without its secret.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookEndpoint, required): A webhook endpoint: a URL of the organization's own that Mountaya delivers webhook events to, signed with the endpoint's secret. The secret is answered once, by `postOrganizationWebhookEndpoint`, and never by a read.

  See [the WebhookEndpoint object](https://docs.mountaya.com/en/apis/map-studio/reference/webhooks.md#webhook-endpoint-object).

Response headers:

- `ETag`: The version of the resource this answer returns, an opaque strong tag in double quotes, equal to that resource's `etag` field. Send it back as `If-Match` to make a write conditional on nobody having changed the resource since. It changes whenever what this read returns changes; compare it whole and never parse it. Present on every answer that returns the resource, and on the `412` that refuses a stale `If-Match`.
- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

**Errors** `400`, `401`, `403`, `404`, `409`, `412`, `413`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`, as on a new endpoint. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the user the session token names is not a member of the key's organization, or is a member who is neither owner nor admin. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: The organization has no webhook endpoint with the identifier given, one of another organization included, so an endpoint id cannot be probed here. Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `409`: `IdempotencyKeyInUse`, given in full at the end of this page.
- `412`: `PreconditionFailed`, given in full at the end of this page.
- `413`: Payload Too Large
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s -X PATCH https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints/e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85 \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"status": "enabled"}'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.patchOrganizationWebhookEndpoint({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  webhook_endpoint_id: "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
  body: { status: "enabled" },
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.patch(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints/e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={"status": "enabled"},
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "url": "https://hooks.example.com/mountaya",
    "description": "Membership sync",
    "enabled_events": [
      "organization.member.*",
      "organization.invitation.accepted"
    ],
    "status": "enabled",
    "disabled_reason": null,
    "disabled_at": null,
    "failing_since": null,
    "etag": "\"d6\"",
    "created_by": {
      "id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18"
    },
    "created_at": "2026-11-02T13:05:47Z",
    "updated_at": "2026-11-14T09:12:44Z"
  }
}
```

## Delete a webhook endpoint

### DELETE /v1/organizations/{organization_id}/webhook-endpoints/{webhook_endpoint_id}

- Operation: `deleteOrganizationWebhookEndpoint`
- Requires: scope `management` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Deletes an endpoint: nothing is delivered to it from then on, and its deliveries still retrying end `canceled`. Its deliveries already made stay readable for the 13 months deliveries are kept, and `getOrganizationWebhookDeliveries` and `getOrganizationWebhookHealth` still narrow to it by its identifier. It frees its place under the organization's `webhook-endpoints` limit.

- Owner or admin only (403 otherwise).
- An endpoint already deleted is a `404`; a delete retried with the first one's `Idempotency-Key` is answered its first `200`.
- `If-Match` makes the deletion conditional: send the endpoint's `etag`, and an endpoint changed since is refused with `412`, deleting nothing.
- It is limited, together with the organization's other endpoint writes the [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md) page lists, to 30 a minute per user and then 300 a minute per organization; past either, the answer is a `429` carrying `Retry-After`, and nothing is done.

Requires a publishable key with the `management` scope AND a session token naming a user, a member with the owner or admin role, whom the request acts as. A session token minted without `user_id` is refused with **401**, and a publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Webhook events** [`organization.webhook_endpoint.deleted`](https://docs.mountaya.com/en/webhooks/events/organization-webhook-endpoint.md#organization-webhook-endpoint-deleted), recorded by the task `organization.webhook_endpoint.delete`.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

- `webhook_endpoint_id` (string (uuid), in path, required): Identifier of the webhook endpoint, the `id` a `WebhookEndpoint` carries. One that names no endpoint of the organization, another organization's included, is answered `404`, so an endpoint id cannot be probed here.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

- `If-Match` (string, in header, optional): Makes the write conditional on the resource still being the version the caller read: the `ETag` an earlier answer carried, which is also that resource's `etag` field, or `*` for any version. When the resource has changed since, the write is refused with `412` `PRECONDITION_FAILED`, nothing is changed, and the answer carries the current `ETag`, so the caller reads the resource again and decides. Omitted, the write is unconditional and the last write wins.

  One strong tag in double quotes, or `*`. A list of tags, a weak tag (`W/`) or any other spelling is a `400` naming the header. A resource the caller cannot see is answered `404` before the condition is asked, so a stale tag never tells a caller anything a read would not.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

The endpoint is deleted. There is no payload.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (any | null, required)

Response headers:

- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

**Errors** `400`, `401`, `403`, `404`, `409`, `412`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the user the session token names is not a member of the key's organization, or is a member who is neither owner nor admin. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: The organization has no webhook endpoint with the identifier given, one of another organization included, so an endpoint id cannot be probed here. Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `409`: `IdempotencyKeyInUse`, given in full at the end of this page.
- `412`: `PreconditionFailed`, given in full at the end of this page.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s -X DELETE https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints/e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85 \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Idempotency-Key: $(uuidgen)"
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.deleteOrganizationWebhookEndpoint({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  webhook_endpoint_id: "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.delete(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-endpoints/e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": null
}
```

## List an organization's webhook events

### GET /v1/organizations/{organization_id}/webhook-events

- Operation: `getOrganizationWebhookEvents`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns every public webhook event recorded in the organization over the 13 months events are kept, whether or not an endpoint was sent it: what its members' acts and Mountaya recorded, before any endpoint subscribes. Each is the envelope a delivery carries, exactly. It is how a receiver that was down past the retries reconciles: list from the last event it processed, and redeliver or read what it missed.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- The filters combine. `type` keeps one type and `family` every type of one family; `related_object_id` the events about one object; `request_id` the events one API request recorded, by the `X-Request-Id` its answer carried; `actor_type` and `actor_user_id` who made the change; `delivery_outcome` the events with at least one delivery standing so; `start_at` and `end_at` when they were recorded.
- The listing is paged, 50 events a page unless `limit` says otherwise, the most recent first. Send the page's `next_cursor` back as `cursor` for the next one; the last page reports `next_cursor: null`.
- An event is listed within seconds of its change. `getOrganizationWebhookEvent` reads one with its deliveries.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

**Query parameters**

- `cursor` (string, in query, optional): Where the page starts: the `next_cursor` the previous page reported at `extensions.metadata.pagination`, sent back unchanged. Omitted, the listing starts at its first item.

  A cursor is opaque: it is not an offset and not an identifier, and a client never builds or edits one, and it is never longer than 1024 characters. It is bound to the operation that issued it, to its filters and its `sort`, and to the scope it listed, such as the organization or the collection in the path or the key's own organization. On `getItineraries`, `getZones` and `getCollections`, whose scope `organization_id` may leave implicit, it is bound as well to the tier of the credential it was issued to, a key alone (or with a session token minted without `user_id`, which reads as one) or a key with a session token naming a member. The next page is asked for the same way. A cursor sent to another operation, with different filters, a different `sort`, another scope or, on those three, another tier of credential, or altered in any way, is a `400` at `["request", "query", "cursor"]`. On every listing, each page applies the read tier of the credential that asks for it. Paging is by position in the sort order rather than by count, so an item whose sort key does not change is never skipped or served twice, whatever is created or deleted between two pages.

- `limit` (integer (int32), in query, optional, default: `50`): How many items one page holds, between 1 and 100; 50 when omitted, on every listing that pages. `extensions.metadata.pagination.limit` reports the size the page was served at. A page shorter than `limit` is not how the end is told: the end is a `next_cursor` of `null`. The page is cut after authorization, so it never widens what a caller can read.

- `type` (string, in query, optional): Keep only the events of this type.

- `family` (string, in query, optional): Keep only the events of this family, every type of it: `organization.member` keeps `organization.member.created`, `.updated` and `.deleted`. A family the contract does not publish is a `400`.

- `related_object_id` (string, in query, optional): Keep only the events about this object, the `related_object.id` they carry: a UUID, or an invoice's or a payment method's identifier.

- `request_id` (string, in query, optional): Keep only the events this API request recorded: the `X-Request-Id` its answer carried, 32 lowercase hexadecimal characters.

- `actor_type` (string, in query, optional, one of: `user`, `key`, `mountaya`): Keep only the events this kind of actor made.

- `actor_user_id` (string (uuid), in query, optional): Keep only the events this person made.

- `delivery_outcome` (string, in query, optional, one of: `pending`, `retrying`, `succeeded`, `exhausted`, `canceled`): Keep only the events with at least one delivery standing so: `exhausted` lists what an endpoint never received.

- `start_at` (string (date-time), in query, optional): The first instant covered, inclusive, as an RFC 3339 date-time. Events and deliveries are kept 13 months, so an instant before that covers nothing more. A `start_at` after `end_at` is a `400` naming both.

- `end_at` (string (date-time), in query, optional): The instant the range ends at, exclusive, as an RFC 3339 date-time. Omitted, the range runs to the moment the request is answered.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

One page of the organization's webhook events, the most recent first. `extensions.metadata.pagination.next_cursor` asks for the next page, and is `null` on the last.

- `extensions` (object, required): The envelope's second half, everything the answer carries that is not the answer itself. Here that is `metadata.pagination` alone: the `limit` this page was served at, and the `next_cursor` of the page after it, null on the last.
  - `metadata` (ListMetadata, required): The `extensions.metadata` object every listing that pages returns. It carries the page and nothing else, so `extensions.metadata.pagination` is the one path a client reads paging from. A listing that does not page, a catalog or a usage series, answers with no `extensions` at all.
    - `pagination` (object, required): The page this listing served, and the cursor of the next one.
      - `limit` (integer (int32), required): The page size the listing was served at: the `limit` sent, or 50 when none was.
      - `next_cursor` (string | null, required): The `cursor` that asks for the page after this one, with the same filters and `sort`, or null when this page is the last. A page that is not the last may hold fewer than `limit` items; the end is told by this field alone.

- `data` (array of WebhookEvent, required)
  - `id` (string (uuid), required): Identifier of the event. Its leading bits are the moment it was recorded, so identifiers sort by time. A delivery can arrive more than once, so a receiver deduplicates on it.
  - `object` (string, required, one of: `webhook_event`): Always `webhook_event`.
  - `type` (string, required): What happened. The family before its last dot names the kind of `data.object`.
  - `api_version` (string, required): The contract version the payload follows: the `info.version` of the document that describes it.
  - `created_at` (string (date-time), required): When the change was made.
  - `organization_id` (string (uuid), required): Identifier of the organization the change was made in.
  - `task` (string, required): The task that recorded the event: the resource's path and what was done, such as `organization.member.update`. The contract's `tasks.yaml` lists every task with what triggers it and the event types it records.
  - `related_object` (object, required): The object the event is about.
    - `type` (string, required): The family of the event's type, which is the `object` of `data.object` too: `organization.member` for `organization.member.updated`.
    - `id` (string, required): The identifier a read of the object takes: `data.object.id` for most kinds; a member's `user_id`; for a share link, the itinerary's or the collection's; for an itinerary or a zone of a collection, the itinerary's or the zone's; and for an organization's settings, entitlements, AI provider configuration and billing information, the organization's. A Data API subscription's, an invoice's and a payment method's are the payment provider's, and are not UUIDs.
  - `data` (object, required): The object, and what the change moved.
    - `object` (OrganizationEventObject | OrganizationMemberEventObject | OrganizationInvitationEventObject | CollectionEventObject | CollectionItineraryEventObject | CollectionZoneEventObject | CollectionShareLinkEventObject | ItineraryEventObject | ItinerarySegmentEventObject | ItinerarySegmentGroupEventObject | ItineraryWaypointEventObject | ItineraryShareLinkEventObject | ZoneEventObject | PublishableKeyEventObject | SecretKeyEventObject | AiProviderConfigEventObject | OrganizationSettingsEventObject | OrganizationEntitlementsEventObject | OrganizationSubscriptionEventObject | InvoiceEventObject | PaymentMethodEventObject | BillingInfoEventObject | WebhookEndpointEventObject, required): The object once the change was made, as lean as its kind allows: identifiers and bounded figures, never geometry, a file or a credential. For a type ending in `deleted`, `revoked`, `removed` or `detached`, the object as it was, its `status` and every other member included. Where the object carries a `version`, a delete is its last version change: the `deleted` event carries a version past the last the object held, so a receiver that applies an event only when its `version` is newer applies the delete too, and never an event that arrives after it. Its `object` names its kind, which is the family of the event's type.
    - `previous_attributes` (object): The fields of `data.object` the change moved, each with the value it held before. Present on the types whose entry in `webhooks` says so, such as `organization.member.updated`, which carries the member's former `role`. A field that did not move is not in it.
  - `request` (WebhookEventRequest | null, required): The request that made the change, a change made signed in to Mountaya's web application or by Mountaya's staff included. Null only when Mountaya made the change on its own: a schedule, work finished after a request was answered, or the payment provider's report.
    - `id` (string, required): The request's identifier, the `X-Request-Id` its answer carried: 32 lowercase hexadecimal characters. `getOrganizationWebhookEvents` finds every event one request made by it, as `request_id`.
  - `actor` (object, required): Who made the change.
    - `type` (string, required, one of: `user`, `key`, `mountaya`): What kind of actor it is.
    - `user_id` (string (uuid)): Identifier of the person, when `type` is `user`. Absent on `organization.invitation.declined`: its actor is the person invited, whom the invitation names by the address it was sent to, and an organization is not told which account answers an invitation it made to an address.
    - `key_id` (string (uuid)): Identifier of the publishable key the request was made with: always when `type` is `key`, and when `type` is `user` and the person acted through a key rather than signed in to Mountaya's web application.

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-events?request_id=2c5ed6d8b8f7c706e9a0d5c5144ed90b" \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data[].type'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookEvents({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  query: { request_id: "2c5ed6d8b8f7c706e9a0d5c5144ed90b" },
});

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-events",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    params={"request_id": "2c5ed6d8b8f7c706e9a0d5c5144ed90b"},
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": [
    {
      "id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
      "object": "webhook_event",
      "type": "organization.member.updated",
      "api_version": "0.8.0",
      "created_at": "2026-11-14T09:12:44Z",
      "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
      "task": "organization.member.update",
      "related_object": {
        "type": "organization.member",
        "id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1"
      },
      "data": {
        "object": {
          "object": "organization.member",
          "user_id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1",
          "role": "contributor",
          "joined_at": "2026-03-11T14:02:09Z"
        },
        "previous_attributes": {
          "role": "viewer"
        }
      },
      "request": {
        "id": "2c5ed6d8b8f7c706e9a0d5c5144ed90b"
      },
      "actor": {
        "type": "user",
        "user_id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18",
        "key_id": "3b1f9c02-6d4e-4a87-b5c1-70e2af3d8916"
      }
    }
  ],
  "extensions": {
    "metadata": {
      "pagination": {
        "limit": 50,
        "next_cursor": "eyJ2IjoxLCJzIjoiLXVwZGF0ZWRfYXQifQ"
      }
    }
  }
}
```

## Retrieve a webhook event with its deliveries

### GET /v1/organizations/{organization_id}/webhook-events/{event_id}

- Operation: `getOrganizationWebhookEvent`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns one webhook event, the envelope its deliveries carried, with the deliveries made of it: one per endpoint it was sent to, per notification email it caused, and per resend or redelivery since, each with its last attempt.

- `delivery_count` is how many deliveries were made of the event, and `deliveries` carries them all up to 100. Past that it carries the 100 most recently started: `getOrganizationWebhookDeliveries` pages every one of them by `event_id`.
- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- An event is kept 13 months; one older is a `404`.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

- `event_id` (string (uuid), in path, required): Identifier of the webhook event, the `id` a `WebhookEvent` carries and the `Mountaya-Event-Id` header of each of its deliveries. One that names no event of the organization within the 13 months events are kept is answered `404`.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

The event, with its deliveries.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookEventWithDeliveries, required): A webhook event with the deliveries made of it: one per endpoint it was sent to, per notification email it caused, and per resend or redelivery since. An event no destination was recorded for carries none.
  - `id` (string (uuid), required): Identifier of the event. Its leading bits are the moment it was recorded, so identifiers sort by time. A delivery can arrive more than once, so a receiver deduplicates on it.
  - `object` (string, required, one of: `webhook_event`): Always `webhook_event`.
  - `type` (string, required): What happened. The family before its last dot names the kind of `data.object`.
  - `api_version` (string, required): The contract version the payload follows: the `info.version` of the document that describes it.
  - `created_at` (string (date-time), required): When the change was made.
  - `organization_id` (string (uuid), required): Identifier of the organization the change was made in.
  - `task` (string, required): The task that recorded the event: the resource's path and what was done, such as `organization.member.update`. The contract's `tasks.yaml` lists every task with what triggers it and the event types it records.
  - `related_object` (object, required): The object the event is about.
    - `type` (string, required): The family of the event's type, which is the `object` of `data.object` too: `organization.member` for `organization.member.updated`.
    - `id` (string, required): The identifier a read of the object takes: `data.object.id` for most kinds; a member's `user_id`; for a share link, the itinerary's or the collection's; for an itinerary or a zone of a collection, the itinerary's or the zone's; and for an organization's settings, entitlements, AI provider configuration and billing information, the organization's. A Data API subscription's, an invoice's and a payment method's are the payment provider's, and are not UUIDs.
  - `data` (object, required): The object, and what the change moved.
    - `object` (OrganizationEventObject | OrganizationMemberEventObject | OrganizationInvitationEventObject | CollectionEventObject | CollectionItineraryEventObject | CollectionZoneEventObject | CollectionShareLinkEventObject | ItineraryEventObject | ItinerarySegmentEventObject | ItinerarySegmentGroupEventObject | ItineraryWaypointEventObject | ItineraryShareLinkEventObject | ZoneEventObject | PublishableKeyEventObject | SecretKeyEventObject | AiProviderConfigEventObject | OrganizationSettingsEventObject | OrganizationEntitlementsEventObject | OrganizationSubscriptionEventObject | InvoiceEventObject | PaymentMethodEventObject | BillingInfoEventObject | WebhookEndpointEventObject, required): The object once the change was made, as lean as its kind allows: identifiers and bounded figures, never geometry, a file or a credential. For a type ending in `deleted`, `revoked`, `removed` or `detached`, the object as it was, its `status` and every other member included. Where the object carries a `version`, a delete is its last version change: the `deleted` event carries a version past the last the object held, so a receiver that applies an event only when its `version` is newer applies the delete too, and never an event that arrives after it. Its `object` names its kind, which is the family of the event's type.
    - `previous_attributes` (object): The fields of `data.object` the change moved, each with the value it held before. Present on the types whose entry in `webhooks` says so, such as `organization.member.updated`, which carries the member's former `role`. A field that did not move is not in it.
  - `request` (WebhookEventRequest | null, required): The request that made the change, a change made signed in to Mountaya's web application or by Mountaya's staff included. Null only when Mountaya made the change on its own: a schedule, work finished after a request was answered, or the payment provider's report.
    - `id` (string, required): The request's identifier, the `X-Request-Id` its answer carried: 32 lowercase hexadecimal characters. `getOrganizationWebhookEvents` finds every event one request made by it, as `request_id`.
  - `actor` (object, required): Who made the change.
    - `type` (string, required, one of: `user`, `key`, `mountaya`): What kind of actor it is.
    - `user_id` (string (uuid)): Identifier of the person, when `type` is `user`. Absent on `organization.invitation.declined`: its actor is the person invited, whom the invitation names by the address it was sent to, and an organization is not told which account answers an invitation it made to an address.
    - `key_id` (string (uuid)): Identifier of the publishable key the request was made with: always when `type` is `key`, and when `type` is `user` and the person acted through a key rather than signed in to Mountaya's web application.
  - `delivery_count` (integer (int32), required): How many deliveries were made of the event, whatever `deliveries` carries of them.
  - `deliveries` (array of WebhookDelivery, required): The deliveries of the event, the first one started first: every one of them up to 100, and the 100 most recently started when `delivery_count` says there are more, which `getOrganizationWebhookDeliveries` pages in full by `event_id`. Each carries its last attempt; `getOrganizationWebhookDelivery` reads them all.
    - `id` (string (uuid), required): Identifier of the delivery.
    - `event_id` (string (uuid), required): Identifier of the event delivered, which `getOrganizationWebhookEvent` reads.
    - `event_type` (string, required): The type of the event delivered.
    - `destination` (string, required, one of: `endpoint`, `email`): Where the delivery goes.
    - `webhook_endpoint_id` (string (uuid)): Identifier of the endpoint, on a delivery to an endpoint.
    - `recipient` (object): The person the email went to, on a notification email.
      - `user_id` (string (uuid)): Identifier of the recipient's account. Absent for an invitation, which is sent to the address invited whatever account it belongs to, so the delivery never tells whether one does.
      - `email` (string (email)): The address of the invitation the email was sent for, or the address the recipient's account holds when the delivery is read. Absent beside a `user_id` when that account has left the organization or been deleted, or when its address could not be read just then: the delivery is answered all the same, and a later read may carry it.
    - `notification` (string, one of: `invitation`, `member-role-changed`, `member-removed`, `collection-deleted`, `webhook-endpoint-failing`, `webhook-endpoint-disabled`): Which notification the email was, on a notification email.
    - `trigger` (string, required, one of: `event`, `resend`, `test`, `redelivery`): What started the delivery.
    - `trigger_id` (string (uuid)): Identifier of the resend, test or redelivery that started the delivery, the `id` `postOrganizationWebhookDelivery` answered. Absent when the event itself started it.
    - `outcome` (string, required, one of: `pending`, `retrying`, `succeeded`, `exhausted`, `canceled`): Where the delivery stands.
    - `attempt_count` (integer (int32), required): How many attempts were made, the canceled ones left out.
    - `last_attempt_at` (string (date-time)): When the last attempt was made. Absent before the first.
    - `next_attempt_at` (string (date-time) | null, required): When the next attempt is due, null when none is: the delivery succeeded, was exhausted or canceled.
    - `failure_kind` (string, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): How the last attempt failed, present while that attempt is a failure.
    - `failure_class` (string, one of: `receiver`, `mountaya`): Whose the last attempt's failure is, present beside `failure_kind`.
    - `response_status` (integer (int32)): The HTTP status the endpoint answered the last attempt with, on a delivery to an endpoint that answered at all.
    - `created_at` (string (date-time), required): When the delivery was started.

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: The organization has no webhook event with the identifier given within the 13 months events are kept, one of another organization included. Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-events/019a8eed-e1ad-7753-b049-b0e20d79577a \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data.deliveries'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookEvent({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  event_id: "019a8eed-e1ad-7753-b049-b0e20d79577a",
});

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-events/019a8eed-e1ad-7753-b049-b0e20d79577a",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
    "object": "webhook_event",
    "type": "organization.member.updated",
    "api_version": "0.8.0",
    "created_at": "2026-11-14T09:12:44Z",
    "organization_id": "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
    "task": "organization.member.update",
    "related_object": {
      "type": "organization.member",
      "id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1"
    },
    "data": {
      "object": {
        "object": "organization.member",
        "user_id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1",
        "role": "contributor",
        "joined_at": "2026-03-11T14:02:09Z"
      },
      "previous_attributes": {
        "role": "viewer"
      }
    },
    "request": {
      "id": "2c5ed6d8b8f7c706e9a0d5c5144ed90b"
    },
    "actor": {
      "type": "user",
      "user_id": "1b9d4e72-0c35-4a8f-b6e1-5f2c7d904a18",
      "key_id": "3b1f9c02-6d4e-4a87-b5c1-70e2af3d8916"
    },
    "delivery_count": 2,
    "deliveries": [
      {
        "id": "019a8eee-07c2-7a1d-8f43-5b9e2c6d1a07",
        "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
        "event_type": "organization.member.updated",
        "destination": "endpoint",
        "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
        "trigger": "event",
        "outcome": "succeeded",
        "attempt_count": 1,
        "last_attempt_at": "2026-11-14T09:12:45Z",
        "next_attempt_at": null,
        "response_status": 204,
        "created_at": "2026-11-14T09:12:45Z"
      },
      {
        "id": "019a8eee-07c9-7b52-a1d4-3e7f0c9b2d61",
        "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
        "event_type": "organization.member.updated",
        "destination": "email",
        "recipient": {
          "user_id": "7a4e1c98-3b52-4f60-9d81-c05e2f7a83b1",
          "email": "camille@example.com"
        },
        "notification": "member-role-changed",
        "trigger": "event",
        "outcome": "succeeded",
        "attempt_count": 1,
        "last_attempt_at": "2026-11-14T09:12:47Z",
        "next_attempt_at": null,
        "created_at": "2026-11-14T09:12:45Z"
      }
    ]
  }
}
```

## List an organization's webhook deliveries

### GET /v1/organizations/{organization_id}/webhook-deliveries

- Operation: `getOrganizationWebhookDeliveries`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns every delivery of the organization's webhook events over the 13 months deliveries are kept: to its endpoints, and the notification emails its events caused, each with where it stands and its last attempt. An email delivery names its recipient and its notification, never what the email said.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- The filters combine: `webhook_endpoint_id` one endpoint, `event_id` one event, `destination` endpoints or emails, `outcome` where a delivery stands, `failure_class` and `failure_kind` how its last attempt failed, `event_type` the type delivered, `trigger_id` the deliveries one resend, test or redelivery started, and `start_at` and `end_at` when the deliveries started: a delivery is listed by its first attempt, wherever its later ones fall.
- The listing is paged, 50 deliveries a page unless `limit` says otherwise, the most recently started first. Send the page's `next_cursor` back as `cursor` for the next one; the last page reports `next_cursor: null`.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

**Query parameters**

- `cursor` (string, in query, optional): Where the page starts: the `next_cursor` the previous page reported at `extensions.metadata.pagination`, sent back unchanged. Omitted, the listing starts at its first item.

  A cursor is opaque: it is not an offset and not an identifier, and a client never builds or edits one, and it is never longer than 1024 characters. It is bound to the operation that issued it, to its filters and its `sort`, and to the scope it listed, such as the organization or the collection in the path or the key's own organization. On `getItineraries`, `getZones` and `getCollections`, whose scope `organization_id` may leave implicit, it is bound as well to the tier of the credential it was issued to, a key alone (or with a session token minted without `user_id`, which reads as one) or a key with a session token naming a member. The next page is asked for the same way. A cursor sent to another operation, with different filters, a different `sort`, another scope or, on those three, another tier of credential, or altered in any way, is a `400` at `["request", "query", "cursor"]`. On every listing, each page applies the read tier of the credential that asks for it. Paging is by position in the sort order rather than by count, so an item whose sort key does not change is never skipped or served twice, whatever is created or deleted between two pages.

- `limit` (integer (int32), in query, optional, default: `50`): How many items one page holds, between 1 and 100; 50 when omitted, on every listing that pages. `extensions.metadata.pagination.limit` reports the size the page was served at. A page shorter than `limit` is not how the end is told: the end is a `next_cursor` of `null`. The page is cut after authorization, so it never widens what a caller can read.

- `webhook_endpoint_id` (string (uuid), in query, optional): Keep only what concerns this webhook endpoint of the organization: one it holds, or one it deleted, whose deliveries stay readable for the 13 months they are kept. One that names no endpoint the organization held in those 13 months is a `400` naming it. Omitted, every destination is covered, the notification emails included.

- `event_id` (string (uuid), in query, optional): Keep only the deliveries of this event, by the `id` `getOrganizationWebhookEvents` lists: every one of them, where `getOrganizationWebhookEvent` carries the 100 most recently started.

- `destination` (string, in query, optional, one of: `endpoint`, `email`): Keep only the deliveries to this kind of destination: `email` keeps the notification emails.

- `outcome` (string, in query, optional, one of: `pending`, `retrying`, `succeeded`, `exhausted`, `canceled`): Keep only the deliveries standing so.

- `failure_class` (string, in query, optional, one of: `receiver`, `mountaya`): Keep only the deliveries whose last attempt failed, and whose failure is this one's.

- `failure_kind` (string, in query, optional, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): Keep only the deliveries whose last attempt failed this way.

- `event_type` (string, in query, optional): Keep only the deliveries of events of this type.

- `trigger_id` (string (uuid), in query, optional): Keep only the deliveries one resend, test or redelivery started, by the `id` `postOrganizationWebhookDelivery` answered.

- `start_at` (string (date-time), in query, optional): The first instant covered, inclusive, as an RFC 3339 date-time. Events and deliveries are kept 13 months, so an instant before that covers nothing more. A `start_at` after `end_at` is a `400` naming both.

- `end_at` (string (date-time), in query, optional): The instant the range ends at, exclusive, as an RFC 3339 date-time. Omitted, the range runs to the moment the request is answered.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

One page of the organization's webhook deliveries, the most recently started first. `extensions.metadata.pagination.next_cursor` asks for the next page, and is `null` on the last.

- `extensions` (object, required): The envelope's second half, everything the answer carries that is not the answer itself. Here that is `metadata.pagination` alone: the `limit` this page was served at, and the `next_cursor` of the page after it, null on the last.
  - `metadata` (ListMetadata, required): The `extensions.metadata` object every listing that pages returns. It carries the page and nothing else, so `extensions.metadata.pagination` is the one path a client reads paging from. A listing that does not page, a catalog or a usage series, answers with no `extensions` at all.
    - `pagination` (object, required): The page this listing served, and the cursor of the next one.
      - `limit` (integer (int32), required): The page size the listing was served at: the `limit` sent, or 50 when none was.
      - `next_cursor` (string | null, required): The `cursor` that asks for the page after this one, with the same filters and `sort`, or null when this page is the last. A page that is not the last may hold fewer than `limit` items; the end is told by this field alone.

- `data` (array of WebhookDelivery, required)
  - `id` (string (uuid), required): Identifier of the delivery.
  - `event_id` (string (uuid), required): Identifier of the event delivered, which `getOrganizationWebhookEvent` reads.
  - `event_type` (string, required): The type of the event delivered.
  - `destination` (string, required, one of: `endpoint`, `email`): Where the delivery goes.
  - `webhook_endpoint_id` (string (uuid)): Identifier of the endpoint, on a delivery to an endpoint.
  - `recipient` (object): The person the email went to, on a notification email.
    - `user_id` (string (uuid)): Identifier of the recipient's account. Absent for an invitation, which is sent to the address invited whatever account it belongs to, so the delivery never tells whether one does.
    - `email` (string (email)): The address of the invitation the email was sent for, or the address the recipient's account holds when the delivery is read. Absent beside a `user_id` when that account has left the organization or been deleted, or when its address could not be read just then: the delivery is answered all the same, and a later read may carry it.
  - `notification` (string, one of: `invitation`, `member-role-changed`, `member-removed`, `collection-deleted`, `webhook-endpoint-failing`, `webhook-endpoint-disabled`): Which notification the email was, on a notification email.
  - `trigger` (string, required, one of: `event`, `resend`, `test`, `redelivery`): What started the delivery.
  - `trigger_id` (string (uuid)): Identifier of the resend, test or redelivery that started the delivery, the `id` `postOrganizationWebhookDelivery` answered. Absent when the event itself started it.
  - `outcome` (string, required, one of: `pending`, `retrying`, `succeeded`, `exhausted`, `canceled`): Where the delivery stands.
  - `attempt_count` (integer (int32), required): How many attempts were made, the canceled ones left out.
  - `last_attempt_at` (string (date-time)): When the last attempt was made. Absent before the first.
  - `next_attempt_at` (string (date-time) | null, required): When the next attempt is due, null when none is: the delivery succeeded, was exhausted or canceled.
  - `failure_kind` (string, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): How the last attempt failed, present while that attempt is a failure.
  - `failure_class` (string, one of: `receiver`, `mountaya`): Whose the last attempt's failure is, present beside `failure_kind`.
  - `response_status` (integer (int32)): The HTTP status the endpoint answered the last attempt with, on a delivery to an endpoint that answered at all.
  - `created_at` (string (date-time), required): When the delivery was started.

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-deliveries?webhook_endpoint_id=e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85&outcome=retrying" \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookDeliveries({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  query: {
    webhook_endpoint_id: "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    outcome: "retrying",
  },
});

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-deliveries",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    params={
        "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
        "outcome": "retrying",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": [
    {
      "id": "019a8eee-07c2-7a1d-8f43-5b9e2c6d1a07",
      "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
      "event_type": "organization.member.updated",
      "destination": "endpoint",
      "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
      "trigger": "event",
      "outcome": "retrying",
      "attempt_count": 2,
      "last_attempt_at": "2026-11-14T09:13:46Z",
      "next_attempt_at": "2026-11-14T09:18:46Z",
      "failure_kind": "http-status",
      "failure_class": "receiver",
      "response_status": 503,
      "created_at": "2026-11-14T09:12:45Z"
    }
  ],
  "extensions": {
    "metadata": {
      "pagination": {
        "limit": 50,
        "next_cursor": "eyJ2IjoxLCJzIjoiLXVwZGF0ZWRfYXQifQ"
      }
    }
  }
}
```

## Resend an event, send a test event, or redeliver an endpoint's events

### POST /v1/organizations/{organization_id}/webhook-deliveries

- Operation: `postOrganizationWebhookDelivery`
- Requires: scope `management` · acting user required (a session token naming a member) · an `Idempotency-Key` header, the same on every retry
- Behavior: answers within 30000 ms or times out

Starts deliveries to one of the organization's endpoints, which run after the answer. The body names the endpoint and exactly one of three things:

- `event_id`, a resend: one event recorded in the last 30 days, delivered again on the delivery schedule, whether or not the endpoint was sent it the first time.
- `test`, a test: a test event of the type named, its payload this contract's example for the type with an `id` of its own, delivered once without retries. It is recorded nowhere else and listed by no `getOrganizationWebhookEvents`.
- `since`, a redelivery: every event recorded from that instant on, at most 30 days ago, whose type the endpoint is sent, delivered again oldest first at a paced rate. Use it after an outage outlasted the retries, or after enabling an endpoint again, from the `failing_since` the endpoint carried before it was enabled. One redelivery runs at a time for an endpoint.

Each delivery it starts carries the answer's `id` as `trigger_id`, and is read as any other.

- Owner or admin only (403 otherwise).
- A disabled endpoint is a `409`: enable it first. A redelivery asked while another to the same endpoint still runs is a `409` coded `REDELIVERY_IN_PROGRESS`, naming the one running. An event older than 30 days, or a `since` further back or still to come, is a `400` naming it.
- It is limited to 30 a minute per user and then 300 a minute per organization, and a redelivery to 10 an hour per user and 30 an hour per organization besides; past any of them, the answer is a `429` carrying `Retry-After`.
- A request sent again with its `Idempotency-Key` starts nothing twice.

Requires a publishable key with the `management` scope AND a session token naming a user, a member with the owner or admin role, whom the request acts as. A session token minted without `user_id` is refused with **401**, and a publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

Records no webhook event. Runs the tasks `organization.webhook_delivery.resend`, `organization.webhook_delivery.test`, `organization.webhook_delivery.redeliver`.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

**Headers**

- `Idempotency-Key` (string, in header, optional): A value the caller chooses once per logical write and sends again, unchanged, on every retry of it, so a write whose answer was lost runs at most once. A UUID is the usual choice; any 1 to 255 printable ASCII characters without a space are accepted. The key is held for 12 hours, for the credential that sent it (the publishable key and the user its session token names) and for this operation.

  The first request runs. A request repeating the key with the same method, path, query and body, sent as the same media type, is answered with the first one's stored status and body, its `Location` and `ETag` included, and carries `Idempotent-Replayed: true`; nothing runs a second time and no limit is charged again. `Content-Type` is compared as the media type it names, with its `charset`, rather than as the header was written, so the letter case of the type and the spacing around its parameters do not make two requests different. `If-Match` is not compared: a key sent again after a `412`, with a fresh tag, is answered with that same `412`, so a write retried with a new tag takes a new key. Every answer below `500` other than a `429` is stored that way, a refusal included, so a retried request that was refused is refused again in the same words. A request refused before the write is reached stores nothing, and a retry with the same key runs again: every `401`, and every `413` refusing a body over the operation's ceiling. The `413` that `postItineraryPreview` answers for the source it has read, a file or a track too large, is stored as any other refusal is.

  A `5xx` answered before anything was written stores nothing and releases the key: a retry with the same key runs again. A `5xx` answered after the write was made keeps the key, and a request repeating it is a `409` whose entry is coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`, as is a request repeating the key of an answer too large to store whole. Either way the write was made: the `409` carries no `Location`, and its `extensions.metadata` (`ResponseMetadataIdempotentAnswer`) names the `status` the first request was answered with and, where that answer carried them, its `location` and `etag`. Read the resource again rather than sending the write once more, which is answered the same way.

  The same key with a different request is a `400` at `["request", "headers", "Idempotency-Key"]`, and nothing runs, whether the first request is still running or was answered. The same request while its first one is still running is a `409` whose entry is coded `IDEMPOTENCY_KEY_IN_USE`, carrying `Retry-After`: send it again once that has passed. Without the header a write runs every time it is sent, which is harmless on the writes `x-idempotent` marks safe to repeat and creates a second resource on the others. A stream's answer is never stored.

  Keys are kept on a best-effort basis. While Mountaya cannot read or record them, a write runs as if it carried no key, so a retry sent in that moment can run it a second time.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Body**

The endpoint, and the event, the test or the instant to redeliver from.

- `webhook_endpoint_id` (string (uuid), in body, required): Identifier of the endpoint to deliver to. A disabled one is a `409`: enable it first.

- `event_id` (string (uuid), in body, optional): A resend: the event to deliver again, recorded in the last 30 days, whether or not the endpoint was sent it the first time or its `enabled_events` names its type. It starts one delivery, its own attempts on the delivery schedule.

- `test` (object, in body, optional): A test: a test event of the type named, delivered once without retries.
  - `type` (string, required): The type of the test event. Its payload is the example this contract gives for the type, with an `id` of its own, so a receiver can tell a test by the identifiers it carries; it is recorded nowhere else, and listed by no `getOrganizationWebhookEvents`. An endpoint is sent a test of any type, whether or not its `enabled_events` names it.

- `since` (string (date-time), in body, optional): A redelivery: every event recorded from this instant on, at most 30 days ago, whose type the endpoint's `enabled_events` names, delivered again oldest first at a paced rate, each its own delivery carrying the redelivery's `trigger_id`. An instant further back, or one still to come, is a `400` naming it.

**Response** `202`

The resend, test or redelivery started. Its deliveries run after the answer, each carrying its `id` as `trigger_id`; a resend's or a test's one delivery is `delivery_id`.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookDeliveryTrigger, required): A resend, a test or a redelivery `postOrganizationWebhookDelivery` started. The deliveries it starts run after the answer, and each carries its `id` as `trigger_id`, which `getOrganizationWebhookDeliveries` filters on.
  - `id` (string (uuid), required): Identifier of the resend, test or redelivery.
  - `kind` (string, required, one of: `event`, `resend`, `test`, `redelivery`): Which of the three it is.
  - `webhook_endpoint_id` (string (uuid), required): Identifier of the endpoint it delivers to.
  - `event_id` (string (uuid)): The event resent, on a resend.
  - `event_type` (string): The type of the test event, on a test.
  - `since` (string (date-time)): The instant the redelivery starts from, on a redelivery.
  - `delivery_id` (string (uuid) | null, required): The delivery a resend or a test started, which `getOrganizationWebhookDelivery` reads. Null on a redelivery, which starts one delivery per event as it goes.
  - `created_at` (string (date-time), required): When it was asked for.

Response headers:

- `Idempotent-Replayed`: `true` when this answer is the stored answer to an earlier request carrying the same `Idempotency-Key`, replayed rather than run again. Absent on an answer that ran.

**Errors** `400`, `401`, `403`, `404`, `409`, `413`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: The request was malformed, or a field failed validation: each entry names what, a field-level one at its `path`. A body naming none of `event_id`, `test` and `since`, or more than one, is refused at `["request", "body"]`; an `event_id` naming no event of the organization recorded in the last 30 days at `event_id`; a `since` more than 30 days ago, or after now, at `since`; a `webhook_endpoint_id` naming no endpoint of the organization at `webhook_endpoint_id`. The same `Idempotency-Key` sent with another request is refused here too, at `["request", "headers", "Idempotency-Key"]`. A refusal the write itself made is stored for its key, so a repeat of the key is refused again in the same words, marked `Idempotent-Replayed: true`.
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the user the session token names is not a member of the key's organization, or is a member who is neither owner nor admin. A user outside the organization and a member without the role answer alike. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `409`: The endpoint is disabled, and nothing is started. Enable it with `patchOrganizationWebhookEndpoint` first. A redelivery asked while another to the same endpoint is still running starts nothing: its entry is coded `REDELIVERY_IN_PROGRESS`, and `extensions.metadata` is the `WebhookDeliveryTrigger` of the redelivery running, whose deliveries are listed with its `id` as `trigger_id`. Ask again once it is over. The same request sent again with its `Idempotency-Key` is answered as it was the first time. A request carrying the same `Idempotency-Key` as one still running is refused here too: its entry is coded `IDEMPOTENCY_KEY_IN_USE` and it carries `Retry-After`, after which the same request is answered with the first one's outcome. A request repeating the key of one whose answer cannot be replayed is refused here as well, its entry coded `IDEMPOTENCY_ANSWER_UNAVAILABLE`: the answer was too large to keep whole, or the request failed with a `5xx` after its write was made. Either way that write was made, and `extensions.metadata` is the `ResponseMetadataIdempotentAnswer` naming how it was answered, so read the resource again rather than sending the write once more.
- `413`: Payload Too Large
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s -X POST https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-deliveries \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a"
  }'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.postOrganizationWebhookDelivery({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  body: {
    webhook_endpoint_id: "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    event_id: "019a8eed-e1ad-7753-b049-b0e20d79577a",
  },
});

console.log(data);
```

**Python**

```python
import requests
import uuid

response = requests.post(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-deliveries",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
        "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 202:

```json
{
  "data": {
    "id": "019a8ef1-3b6d-7c20-9a4e-1f8d2c7b5e93",
    "kind": "resend",
    "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
    "delivery_id": "019a8ef1-3b70-7d14-8b2a-6c9e1f4d3a58",
    "created_at": "2026-11-14T10:02:11Z"
  }
}
```

## Retrieve a webhook delivery with its attempts

### GET /v1/organizations/{organization_id}/webhook-deliveries/{delivery_id}

- Operation: `getOrganizationWebhookDelivery`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns one delivery with every attempt made of it: when each was due and made, how it ended and whose a failure was, and for an endpoint the status it answered and the first 2 KiB of its answer. A notification email's delivery names its recipient and its notification, never what the email said.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- A delivery is kept 13 months; one older is a `404`.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

- `delivery_id` (string (uuid), in path, required): Identifier of the delivery, the `id` a `WebhookDelivery` carries. One that names no delivery of the organization within the 13 months deliveries are kept is answered `404`.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

The delivery, with its attempts.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookDeliveryWithAttempts, required): A delivery with every attempt made of it, the first one first.
  - `id` (string (uuid), required): Identifier of the delivery.
  - `event_id` (string (uuid), required): Identifier of the event delivered, which `getOrganizationWebhookEvent` reads.
  - `event_type` (string, required): The type of the event delivered.
  - `destination` (string, required, one of: `endpoint`, `email`): Where the delivery goes.
  - `webhook_endpoint_id` (string (uuid)): Identifier of the endpoint, on a delivery to an endpoint.
  - `recipient` (object): The person the email went to, on a notification email.
    - `user_id` (string (uuid)): Identifier of the recipient's account. Absent for an invitation, which is sent to the address invited whatever account it belongs to, so the delivery never tells whether one does.
    - `email` (string (email)): The address of the invitation the email was sent for, or the address the recipient's account holds when the delivery is read. Absent beside a `user_id` when that account has left the organization or been deleted, or when its address could not be read just then: the delivery is answered all the same, and a later read may carry it.
  - `notification` (string, one of: `invitation`, `member-role-changed`, `member-removed`, `collection-deleted`, `webhook-endpoint-failing`, `webhook-endpoint-disabled`): Which notification the email was, on a notification email.
  - `trigger` (string, required, one of: `event`, `resend`, `test`, `redelivery`): What started the delivery.
  - `trigger_id` (string (uuid)): Identifier of the resend, test or redelivery that started the delivery, the `id` `postOrganizationWebhookDelivery` answered. Absent when the event itself started it.
  - `outcome` (string, required, one of: `pending`, `retrying`, `succeeded`, `exhausted`, `canceled`): Where the delivery stands.
  - `attempt_count` (integer (int32), required): How many attempts were made, the canceled ones left out.
  - `last_attempt_at` (string (date-time)): When the last attempt was made. Absent before the first.
  - `next_attempt_at` (string (date-time) | null, required): When the next attempt is due, null when none is: the delivery succeeded, was exhausted or canceled.
  - `failure_kind` (string, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): How the last attempt failed, present while that attempt is a failure.
  - `failure_class` (string, one of: `receiver`, `mountaya`): Whose the last attempt's failure is, present beside `failure_kind`.
  - `response_status` (integer (int32)): The HTTP status the endpoint answered the last attempt with, on a delivery to an endpoint that answered at all.
  - `created_at` (string (date-time), required): When the delivery was started.
  - `attempts` (array of WebhookDeliveryAttempt, required): Every attempt of the delivery, in the order they were due, a canceled one included. At most one per step of the delivery schedule.
    - `attempt` (integer (int32), required): Which attempt it is, from 1, the `Mountaya-Delivery-Attempt` it was sent with.
    - `outcome` (string, required, one of: `succeeded`, `failed`, `canceled`): How the attempt ended.
    - `failure_kind` (string, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): How the attempt failed, present on a failed one.
    - `failure_class` (string, one of: `receiver`, `mountaya`): Whose the failure is, present on a failed attempt.
    - `scheduled_at` (string (date-time), required): When the delivery schedule made the attempt due, a receiver's `Retry-After` included.
    - `attempted_at` (string (date-time)): When the attempt was made, absent on one canceled before it was.
    - `duration_ms` (integer (int32)): How long the endpoint took to answer, in milliseconds, on an attempt that reached it.
    - `response_status` (integer (int32)): The HTTP status the endpoint answered, on an attempt it answered.
    - `response_body` (string): The first 2 KiB of the endpoint's answer, as it sent them, on an attempt it answered with a body. A notification email's attempt carries none.

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: The organization has no webhook delivery with the identifier given within the 13 months deliveries are kept, one of another organization included. Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-deliveries/019a8eee-07c2-7a1d-8f43-5b9e2c6d1a07 \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data.attempts'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookDelivery({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  delivery_id: "019a8eee-07c2-7a1d-8f43-5b9e2c6d1a07",
});

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-deliveries/019a8eee-07c2-7a1d-8f43-5b9e2c6d1a07",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "id": "019a8eee-07c2-7a1d-8f43-5b9e2c6d1a07",
    "event_id": "019a8eed-e1ad-7753-b049-b0e20d79577a",
    "event_type": "organization.member.updated",
    "destination": "endpoint",
    "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
    "trigger": "event",
    "outcome": "retrying",
    "attempt_count": 2,
    "last_attempt_at": "2026-11-14T09:13:46Z",
    "next_attempt_at": "2026-11-14T09:18:46Z",
    "failure_kind": "http-status",
    "failure_class": "receiver",
    "response_status": 503,
    "created_at": "2026-11-14T09:12:45Z",
    "attempts": [
      {
        "attempt": 1,
        "outcome": "failed",
        "failure_kind": "timeout",
        "failure_class": "receiver",
        "scheduled_at": "2026-11-14T09:12:45Z",
        "attempted_at": "2026-11-14T09:12:45Z",
        "duration_ms": 10000
      },
      {
        "attempt": 2,
        "outcome": "failed",
        "failure_kind": "http-status",
        "failure_class": "receiver",
        "scheduled_at": "2026-11-14T09:13:45Z",
        "attempted_at": "2026-11-14T09:13:46Z",
        "duration_ms": 212,
        "response_status": 503,
        "response_body": "Service Unavailable"
      }
    ]
  }
}
```

## Retrieve the reliability of an organization's webhooks

### GET /v1/organizations/{organization_id}/webhook-health

- Operation: `getOrganizationWebhookHealth`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns how reliably the organization's webhook events were delivered over a window: as totals, as a series of hours or days, and one line per destination. It keeps Mountaya's service availability apart from each endpoint's success, since every failed attempt is classed as the receiver's or as Mountaya's.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the organization, and is a 403 otherwise.
- `window` asks for the last 24 hours or 7 days, an hour at a time, or the last 30 days, a day at a time, ending at the hour the request is answered in. Omitted with no range, it is `24h`.
- `start_at` and `end_at` ask for a range instead, at most 92 days within the 13 months deliveries are kept: an hour at a time up to 7 days, a day at a time beyond. `window` beside either is a `400`.
- `webhook_endpoint_id` narrows the report to one endpoint; omitted, it covers every endpoint and the notification emails, each a destination line of its own.
- `availability` is Mountaya's: the share of the attempts due that were made on schedule with no failure of Mountaya's. The success rates are the endpoints': how often a delivery succeeded at its first attempt, and at any.
- The figures are a series over the window, not a listing, so they are not paged.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

**Path parameters**

- `organization_id` (string (uuid), in path, required): Identifier of the organization the operation acts on. A publishable key reaches only its own organization: any other identifier is a 403, whether or not it exists, so the parameter cannot be used to probe which organization ids exist.

**Query parameters**

- `webhook_endpoint_id` (string (uuid), in query, optional): Keep only what concerns this webhook endpoint of the organization: one it holds, or one it deleted, whose deliveries stay readable for the 13 months they are kept. One that names no endpoint the organization held in those 13 months is a `400` naming it. Omitted, every destination is covered, the notification emails included.

- `window` (string, in query, optional, one of: `24h`, `7d`, `30d`): The window to report on, ending at the hour the request is answered in. Omitted with no range, it is `24h`; beside `start_at` or `end_at` it is a `400`.

- `start_at` (string (date-time), in query, optional): The first instant covered, inclusive, as an RFC 3339 date-time. Events and deliveries are kept 13 months, so an instant before that covers nothing more. A `start_at` after `end_at` is a `400` naming both.

- `end_at` (string (date-time), in query, optional): The instant the range ends at, exclusive, as an RFC 3339 date-time. Omitted, the range runs to the moment the request is answered.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

The reliability report.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (WebhookHealth, required): The reliability of an organization's webhooks over a span of time: Mountaya's service availability apart from each endpoint's success, as totals, as a series of hours or days, and one line per destination. It covers the organization's endpoints and its notification emails, or one endpoint.
  - `webhook_endpoint_id` (string (uuid)): The endpoint the report is narrowed to, when it is.
  - `start_at` (string (date-time), required): The first instant the report covers, inclusive.
  - `end_at` (string (date-time), required): The instant the report ends at, exclusive.
  - `granularity` (string, required, one of: `hour`, `day`): How long each point of `series` covers.
  - `totals` (object, required): The figures of the whole span.
    - `events_recorded` (integer (int64), required): The public events recorded, whether or not anything was sent them.
    - `attempts_due` (integer (int64), required): The attempts the delivery schedule made due.
    - `attempts_made` (integer (int64), required): The attempts made.
    - `availability` (number (double) | null, required): Mountaya's service availability: the share of the attempts due that were made on schedule with no failure of Mountaya's. A receiver's failure counts here as an attempt made; only a failure classed `mountaya` and an attempt made late lower it.
    - `dispatch_delay_p50_ms` (integer (int64) | null, required): The median time from an event being recorded to its first attempt, in milliseconds.
    - `dispatch_delay_p95_ms` (integer (int64) | null, required): The 95th percentile of the time from an event being recorded to its first attempt, in milliseconds.
    - `dispatched_within_60s` (number (double) | null, required): The share of the deliveries whose first attempt was made within 60 seconds of the event.
    - `first_attempt_success_rate` (number (double) | null, required): The share of the deliveries that succeeded at their first attempt.
    - `eventual_success_rate` (number (double) | null, required): The share of the deliveries settled in the span that succeeded, at any attempt.
    - `response_time_p50_ms` (integer (int64) | null, required): The median time an endpoint took to answer an attempt, in milliseconds. Notification emails are left out.
    - `response_time_p95_ms` (integer (int64) | null, required): The 95th percentile of the time an endpoint took to answer an attempt, in milliseconds. Notification emails are left out.
    - `deliveries_succeeded` (integer (int64), required): The deliveries that succeeded.
    - `deliveries_pending` (integer (int64), required): The deliveries still unsettled at the end of the span: waiting for an attempt, or for a retry.
    - `deliveries_exhausted` (integer (int64), required): The deliveries whose every attempt failed.
    - `deliveries_canceled` (integer (int64), required): The deliveries canceled because their endpoint was disabled or deleted.
    - `failures` (array of WebhookHealthFailure, required): The failed attempts, one entry per kind that happened, the most frequent first.
      - `failure_kind` (string, required, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): How the attempts failed.
      - `failure_class` (string, required, one of: `receiver`, `mountaya`): Whose the failures are, which the kind decides.
      - `count` (integer (int64), required): How many attempts failed this way.
  - `series` (array of WebhookHealthPoint, required): The figures of each hour or day of the span, oldest first, every one of them present, an empty one with zero counts and null rates.
    - `events_recorded` (integer (int64), required): The public events recorded, whether or not anything was sent them.
    - `attempts_due` (integer (int64), required): The attempts the delivery schedule made due.
    - `attempts_made` (integer (int64), required): The attempts made.
    - `availability` (number (double) | null, required): Mountaya's service availability: the share of the attempts due that were made on schedule with no failure of Mountaya's. A receiver's failure counts here as an attempt made; only a failure classed `mountaya` and an attempt made late lower it.
    - `dispatch_delay_p50_ms` (integer (int64) | null, required): The median time from an event being recorded to its first attempt, in milliseconds.
    - `dispatch_delay_p95_ms` (integer (int64) | null, required): The 95th percentile of the time from an event being recorded to its first attempt, in milliseconds.
    - `dispatched_within_60s` (number (double) | null, required): The share of the deliveries whose first attempt was made within 60 seconds of the event.
    - `first_attempt_success_rate` (number (double) | null, required): The share of the deliveries that succeeded at their first attempt.
    - `eventual_success_rate` (number (double) | null, required): The share of the deliveries settled in the span that succeeded, at any attempt.
    - `response_time_p50_ms` (integer (int64) | null, required): The median time an endpoint took to answer an attempt, in milliseconds. Notification emails are left out.
    - `response_time_p95_ms` (integer (int64) | null, required): The 95th percentile of the time an endpoint took to answer an attempt, in milliseconds. Notification emails are left out.
    - `deliveries_succeeded` (integer (int64), required): The deliveries that succeeded.
    - `deliveries_pending` (integer (int64), required): The deliveries still unsettled at the end of the span: waiting for an attempt, or for a retry.
    - `deliveries_exhausted` (integer (int64), required): The deliveries whose every attempt failed.
    - `deliveries_canceled` (integer (int64), required): The deliveries canceled because their endpoint was disabled or deleted.
    - `failures` (array of WebhookHealthFailure, required): The failed attempts, one entry per kind that happened, the most frequent first.
      - `failure_kind` (string, required, one of: `timeout`, `connection`, `tls`, `redirect`, `http-status`, `refused-address`, `bounced`, `unknown-mailbox`, `blocklisted`, `spam`, `internal`): How the attempts failed.
      - `failure_class` (string, required, one of: `receiver`, `mountaya`): Whose the failures are, which the kind decides.
      - `count` (integer (int64), required): How many attempts failed this way.
    - `start_at` (string (date-time), required): When the hour or the day the point covers begins, in UTC.
  - `destinations` (array of WebhookHealthDestination, required): One line per destination: each endpoint of the organization, or the one endpoint the report is narrowed to, and the notification emails, on a report that is not narrowed.
    - `destination` (string, required, one of: `endpoint`, `email`): Which kind of destination the line is.
    - `webhook_endpoint_id` (string (uuid)): Identifier of the endpoint, on an endpoint's line.
    - `status` (string, one of: `enabled`, `disabled`): Whether Mountaya delivers to the endpoint, on an endpoint's line. Absent on the line of an endpoint the organization has deleted, which a report narrowed to it still carries.
    - `failing_since` (string (date-time) | null): When the endpoint's run of failed deliveries began, on an endpoint's line, null while its last delivery succeeded.
    - `last_success_at` (string (date-time) | null, required): When a delivery to the destination last succeeded. An endpoint's is its own last success, however long ago, and null when it never had one; the notification emails' is null when none succeeded in the 13 months deliveries are kept.
    - `attempts_made` (integer (int64), required): The attempts made to the destination in the span.
    - `first_attempt_success_rate` (number (double) | null, required): The share of the destination's deliveries that succeeded at their first attempt, null when none was made.
    - `eventual_success_rate` (number (double) | null, required): The share of the destination's deliveries settled in the span that succeeded, null when none settled.
    - `deliveries_exhausted` (integer (int64), required): The destination's deliveries whose every attempt failed.

**Errors** `400`, `401`, `403`, `404`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the path names an organization other than the key's own, whether or not it exists, or the session token names a user without the owner or admin role in the organization. A session token minted for `api` without `user_id` is asked for no role: it IS the organization's own backend's credential, minted server-side from its secret key, so it authorizes the read without a member behind it. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `404`: Answered only from Mountaya's web application: the path names an organization the person is not a member of, or one that does not exist. The two answer alike, so the path cannot be used to learn which organizations exist. Under a publishable key an identifier other than the key's organization is a `403` instead, whether or not it exists.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-health?window=7d" \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data.totals'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getOrganizationWebhookHealth({
  organization_id: "d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b",
  query: { window: "7d" },
});

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/organizations/d5a83e17-92c6-4b0f-a7d3-1e6482f9c05b/webhook-health",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    params={"window": "7d"},
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": {
    "start_at": "2026-11-13T10:00:00Z",
    "end_at": "2026-11-14T10:00:00Z",
    "granularity": "hour",
    "totals": {
      "events_recorded": 1284,
      "attempts_due": 1312,
      "attempts_made": 1312,
      "availability": 1,
      "dispatch_delay_p50_ms": 410,
      "dispatch_delay_p95_ms": 1730,
      "dispatched_within_60s": 1,
      "first_attempt_success_rate": 0.982,
      "eventual_success_rate": 1,
      "response_time_p50_ms": 182,
      "response_time_p95_ms": 640,
      "deliveries_succeeded": 1290,
      "deliveries_pending": 2,
      "deliveries_exhausted": 0,
      "deliveries_canceled": 0,
      "failures": [
        {
          "failure_kind": "http-status",
          "failure_class": "receiver",
          "count": 14
        },
        {
          "failure_kind": "timeout",
          "failure_class": "receiver",
          "count": 6
        }
      ]
    },
    "series": [
      {
        "start_at": "2026-11-13T10:00:00Z",
        "events_recorded": 58,
        "attempts_due": 60,
        "attempts_made": 60,
        "availability": 1,
        "dispatch_delay_p50_ms": 395,
        "dispatch_delay_p95_ms": 1210,
        "dispatched_within_60s": 1,
        "first_attempt_success_rate": 0.966,
        "eventual_success_rate": 1,
        "response_time_p50_ms": 176,
        "response_time_p95_ms": 598,
        "deliveries_succeeded": 58,
        "deliveries_pending": 0,
        "deliveries_exhausted": 0,
        "deliveries_canceled": 0,
        "failures": [
          {
            "failure_kind": "http-status",
            "failure_class": "receiver",
            "count": 2
          }
        ]
      },
      {
        "start_at": "2026-11-14T09:00:00Z",
        "events_recorded": 58,
        "attempts_due": 60,
        "attempts_made": 60,
        "availability": 1,
        "dispatch_delay_p50_ms": 395,
        "dispatch_delay_p95_ms": 1210,
        "dispatched_within_60s": 1,
        "first_attempt_success_rate": 0.966,
        "eventual_success_rate": 1,
        "response_time_p50_ms": 176,
        "response_time_p95_ms": 598,
        "deliveries_succeeded": 58,
        "deliveries_pending": 0,
        "deliveries_exhausted": 0,
        "deliveries_canceled": 0,
        "failures": [
          {
            "failure_kind": "http-status",
            "failure_class": "receiver",
            "count": 2
          }
        ]
      }
    ],
    "destinations": [
      {
        "destination": "endpoint",
        "webhook_endpoint_id": "e4b7a1d9-5c26-4f83-a0e1-7d2c9b6f3a85",
        "status": "enabled",
        "failing_since": null,
        "last_success_at": "2026-11-14T09:58:12Z",
        "attempts_made": 1240,
        "first_attempt_success_rate": 0.982,
        "eventual_success_rate": 1,
        "deliveries_exhausted": 0
      },
      {
        "destination": "email",
        "last_success_at": "2026-11-14T09:12:47Z",
        "attempts_made": 44,
        "first_attempt_success_rate": 1,
        "eventual_success_rate": 1,
        "deliveries_exhausted": 0
      }
    ]
  }
}
```

## List the public webhook event types

### GET /v1/webhook-event-types

- Operation: `getWebhookEventTypes`
- Requires: scope `management` · acting user optional (a session token naming a member, or one minted without `user_id`)
- Behavior: idempotent, safe to retry · answers within 30000 ms or times out

Returns every public webhook event type with its family and what records it: the members of `WebhookEventType`, which an endpoint's `enabled_events` names. The catalog is the same for every organization, and this document's `webhooks` describes each type's payload.

- A session token minted for `api` without `user_id` is asked for no member role on this read; one minted for `studio-embedded` without `user_id` is the `401` a key alone gets. One that names a user is answered only while that user holds the owner or admin role in the key's organization, and is a 403 otherwise.
- The catalog is a set of a size Mountaya decides, so it is not paged.

Like every read made with a session token naming a user, it is limited to 1200 a minute per user the token names and then to 6000 a minute per organization, and one made with a session token minted without `user_id` is held as the key alone is, to 600 a minute per client IP address and then 6000 per organization; past either, the answer is a `429` carrying `Retry-After`.

Requires a publishable key with the `management` scope AND a session token. A publishable key without a session token is not accepted here: a key written to be shipped in a browser cannot be sufficient on its own to read or change an organization's account.

Also takes `Accept-Language`, as every operation of this API does: the [overview](https://docs.mountaya.com/en/apis/map-studio/reference.md) describes it.

**Response** `200`

Every public webhook event type, ordered by type.

- `extensions` (object): Top-level extensions map for 2xx responses. Mirrors the GraphQL-spec response extensions: a free-form map for response-scoped metadata.
  - `metadata` (object): Response-scoped metadata. Its shape is per-operation: the operation that emits it names the schema, and an operation that documents none never emits this field.

- `data` (array of WebhookEventCatalogEntry, required)
  - `type` (string, required): The event type.
  - `family` (string, required): The type's family: the type without what happened, which names the kind of object `data.object` holds. `enabled_events` takes a family followed by `.*` for every type of it.
  - `summary` (string, required): What happened, in one line of at most 120 characters.
  - `description` (string, required): When the event is recorded, as this document's entry for the type says. Mountaya writes it rather than an organization, so the 100-character ceiling of a description an organization writes does not apply to it; it holds at most 2000 characters.

**Errors** `400`, `401`, `403`, `429`, `500`, `504`. See [Errors](https://docs.mountaya.com/en/apis/conventions/errors.md).

- `400`: Bad Request
- `401`: Unauthorized
- `403`: The credential is valid and this operation is not open to it: the key does not carry the `management` scope, or the session token names a user without the owner or admin role in the key's organization. A session token minted for `api` without `user_id` is asked for no role. One minted for `studio-embedded` without `user_id` is the `401` a key alone gets. The blanket refusal in the [order of checks](https://docs.mountaya.com/en/apis/conventions/errors.md#which-refusal-you-get-first), an `Origin` or `Referer` the organization does not allow, answers here as well.
- `429`: `TooManyRequests`, given in full at the end of this page.
- `500`: Internal Server Error
- `504`: Gateway Timeout

**cURL**

```bash
curl -s https://api.mountaya.com/v1/webhook-event-types \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" | jq '.data[].type'
```

**TypeScript**

```typescript
import { Mountaya } from "@mountaya/client";
import { MountayaAdmin } from "@mountaya/client/admin";

const mountaya = new Mountaya({
  credential: { publishableKey, sessionToken },
});
const admin = new MountayaAdmin(mountaya);

const { data } = await admin.webhooks.getWebhookEventTypes();

console.log(data);
```

**Python**

```python
import requests

response = requests.get(
    "https://api.mountaya.com/v1/webhook-event-types",
    headers={
        "X-API-Key": "pk_your_publishable_key",
        "X-Session-Token": "sess_your_session_token",
    },
    timeout=30,
)
response.raise_for_status()
print(response.json()["data"])
```

Response 200:

```json
{
  "data": [
    {
      "type": "organization.member.updated",
      "family": "organization.member",
      "summary": "A member's role changed.",
      "description": "A member's role changed: through `patchOrganizationMember`, or when ownership was handed on, which records one for each of the two members."
    }
  ]
}
```

**Error answers the operations of this page share**

- `TooManyRequests` (`429`): A limit on this operation's requests is spent: the [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md) page lists every one, the unknown publishable keys one address may present among them, and the operation's description names any of its own. The request was counted and nothing was done. `Retry-After` says how long until the limit lifts; wait that long, with a little jitter of your own, and send the request again. Where the operation takes an `Idempotency-Key`, a write sent again with the same key runs once.
- `IdempotencyKeyInUse` (`409`): The `Idempotency-Key` this request carries is one an earlier request was sent with, and the answer to that one cannot be given here. Nothing was done by this request. Its entry says which. `IDEMPOTENCY_KEY_IN_USE`: the first request is still running. Wait the `Retry-After` this carries and send the same request again, which is then answered with the first request's outcome. `IDEMPOTENCY_ANSWER_UNAVAILABLE`: the first request's write was made, and its answer cannot be given again, because it was too large to keep whole, because the request failed with a `5xx` after the write was made, or because it carried a credential shown only once, which is never kept. `extensions.metadata` names the status it was answered with, and its `Location` and `ETag` where it carried them; a create whose operation says so names what it made there after a `5xx` too. Read the resource again rather than sending the write once more, which is answered the same way. A credential cannot be read again: where the operation says its answer carries one, the one it created is at `metadata.location`, so revoke that one and create another.
- `TooManyRequestsOrLimitReached` (`429`): A limit or a ceiling refused the request, and nothing was done. Its entry says which. `TOO_MANY_REQUESTS`: a limit counted over a window is spent, one the [rate limits](https://docs.mountaya.com/en/apis/conventions/rate-limits.md) page lists or the operation's description names. `Retry-After` says how long until it lifts; wait that long, with a little jitter of your own, and send the request again. Where the operation takes an `Idempotency-Key`, a write sent again with the same key runs once. `LIMIT_REACHED`: a ceiling the operation's description names is reached, a count of something the organization or the person holds rather than a rate. `extensions.metadata` names the ceiling, with how many it allows and how many are held, and no `Retry-After` is sent, since no wait lifts it: the same request is refused the same way until something is freed or the organization's agreement allows more, so it is not sent again as it is. The refusal is not kept for the request's `Idempotency-Key`, so the same request sent with that key once a place is free runs then.
- `PreconditionFailed` (`412`): `If-Match` named a version the resource has moved on from: somebody changed it after the caller read it. Nothing was changed. The one entry is coded `PRECONDITION_FAILED`, and `ETag` carries the current version, so read the resource again, decide whether the change still applies, and send it with the new tag. Retrying with the same tag is refused the same way. A resource the caller cannot see is answered `404` before the condition is asked, and a write refused for any other reason is refused for that reason first.
