{
  "openapi": "3.1.0",
  "info": {
    "title": "Webhooks",
    "version": "2026-10-09",
    "description": "Signed outbound webhooks for your own customers, and verified capture of other providers' webhooks. Create a **tenant** for each of your customers, an **event type** for each kind of event, and **endpoints** for the URLs that receive them. **Messages** fan out to matching endpoints as **deliveries**, each retried up to 9 times over at most 72 hours; inspect them, cancel them, retry them now, or **replay** them one by one or in bulk. **Sources** verify Stripe, GitHub, Shopify, Slack, Twilio, Standard Webhooks, generic HMAC, and bearer webhooks at a receive URL and turn them into messages.\n\nPaths are under `https://api.motor.dev/webhooks`. Authenticate with a secret key (`motor_sk_...`) in `Authorization: Bearer ...`; publishable keys never work. The service is live-only: omit `Motor-Mode` or send `live`. Every `POST` except `/previews` and `/receive/{token}` needs an `Idempotency-Key`. Configuration responses carry `ETag: \"wd:<id>:<version>\"`; `PATCH`, `DELETE`, `rotate_*`, and `resume` need it in `If-Match`. Lists return `{\"data\": [...], \"next_cursor\": ...}`, oldest first. IDs are opaque strings with a prefix: `wdt_` tenants, `wdy_` event types, `wde_` endpoints, `wds_` sources, `wdm_` messages, `wdd_` deliveries, `wda_` attempts, `wdr_` replays, and `wdv_` events. Times are UTC RFC 3339. Money is a decimal USD string and versions are decimal strings. Errors are `{\"error\": {\"code\", \"message\"}}`.\n\n**Pricing.** `webhooks.ingest_64k`: $0.00001 for each 64 KiB of an accepted message, at least 1 unit, charged even when no endpoint matches. `webhooks.delivery_16k`: $0.00005 for each 16 KiB of each endpoint's body, at least 1 unit per endpoint delivery generation. Automatic retries are free. A replay is a new paid delivery generation without new ingestion. An endpoint test pays ingestion and delivery. Accepted work is never refunded; rejected requests and idempotent or duplicate retries cost nothing. For example, a 1 KiB message to 2 endpoints costs $0.00011.\n\n**What receivers get.** Each attempt is a `POST` of the delivery's exact bytes with its `Content-Type`, `User-Agent: Motor-Webhooks/1.0 (+https://motor.dev/docs/webhooks)`, your custom headers and authorization, and Standard Webhooks signing headers: `webhook-id` (the message ID, the same across retries and replays), `webhook-timestamp` (Unix seconds, fresh for each attempt), and `webhook-signature` (`v1,<Base64 HMAC-SHA256>` of `<webhook-id>.<webhook-timestamp>.<body>` with the endpoint's `whsec_` secret; during a rotation overlap, a space-separated signature for each secret). They also get `Motor-Delivery-Id` (`wdd_...`, new for each replay), `Motor-Attempt-Id` (`wda_...`), and `Motor-Event-Type`, which aren't signed. Verify with a Standard Webhooks library in constant time, allow 300 seconds of clock skew, and deduplicate by `webhook-id`: deliveries can repeat and arrive out of order. Any 2xx succeeds. Redirects, other 4xx, and unsafe destinations fail without retrying; 408, 425, 429, 5xx, and network errors retry after the endpoint's delays and any `Retry-After`. A `410` disables the endpoint."
  },
  "servers": [
    {
      "url": "https://api.motor.dev/webhooks"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Rates and settings",
      "description": "What the service supports, its prices, and your team's retention settings."
    },
    {
      "name": "Tenants",
      "description": "Your customers. Every endpoint, source, and message belongs to one."
    },
    {
      "name": "Event types",
      "description": "Your catalog of event types. Messages need an active one."
    },
    {
      "name": "Endpoints",
      "description": "The URLs that receive a tenant's messages, with their filters, transforms, pacing, retries, and signing secrets."
    },
    {
      "name": "Messages",
      "description": "Accepted events. Each is priced and fanned out to matching endpoints when Motor accepts it."
    },
    {
      "name": "Deliveries",
      "description": "One message to one endpoint, and its attempts. Failed and expired deliveries are the dead letters."
    },
    {
      "name": "Replays",
      "description": "Bulk recovery: new paid generations of one endpoint's deliveries in a window."
    },
    {
      "name": "Sources",
      "description": "Verified receive URLs for other providers' webhooks."
    },
    {
      "name": "Receive",
      "description": "The public route that providers call. It authenticates with the provider's signature, not a Motor key."
    },
    {
      "name": "Analytics and events",
      "description": "Operational counts and events to poll."
    }
  ],
  "paths": {
    "/capabilities": {
      "get": {
        "operationId": "getCapabilities",
        "tags": [
          "Rates and settings"
        ],
        "summary": "Get capabilities",
        "description": "Returns the region, delivery addresses, source verifiers, content types, hard bounds, and your team's effective limits.",
        "parameters": [
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The capabilities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                },
                "example": {
                  "service_id": "webhooks",
                  "region": "us-east-1",
                  "egress_ipv4_cidrs": [],
                  "ipv6_delivery": false,
                  "verification_kinds": [
                    "standard_webhooks",
                    "stripe",
                    "github",
                    "hmac",
                    "shopify",
                    "slack",
                    "twilio",
                    "bearer"
                  ],
                  "content_types": [
                    "application/json",
                    "text/plain",
                    "application/octet-stream",
                    "application/x-www-form-urlencoded"
                  ],
                  "limits": {
                    "max_body_bytes": {
                      "value": 1048576,
                      "unit": "bytes"
                    },
                    "max_fanout_endpoints": {
                      "value": 100,
                      "unit": "endpoints"
                    },
                    "max_transformed_bytes_per_message": {
                      "value": 8388608,
                      "unit": "bytes"
                    },
                    "max_attempts": {
                      "value": 9,
                      "unit": "attempts"
                    },
                    "delivery_window_hours": {
                      "value": 72,
                      "unit": "hours"
                    },
                    "max_schedule_days": {
                      "value": 7,
                      "unit": "days"
                    },
                    "max_endpoints_per_tenant": {
                      "value": 100,
                      "unit": "endpoints"
                    },
                    "read_requests_per_second": {
                      "value": 100,
                      "unit": "requests per second"
                    },
                    "config_writes_per_second": {
                      "value": 20,
                      "unit": "requests per second"
                    },
                    "admission_rate": {
                      "value": 100,
                      "unit": "messages per second",
                      "measured": false
                    },
                    "source_requests_per_second": {
                      "value": 50,
                      "unit": "requests per second"
                    },
                    "dispatch_rate": {
                      "value": 1000,
                      "unit": "attempts per second",
                      "measured": false
                    },
                    "max_concurrency": {
                      "value": 3,
                      "unit": "requests"
                    },
                    "max_endpoint_concurrency": {
                      "value": 3,
                      "unit": "requests"
                    },
                    "service_concurrency": {
                      "value": 6,
                      "unit": "requests across all teams"
                    },
                    "max_tenants": {
                      "value": 10000,
                      "unit": "tenants"
                    },
                    "max_event_types": {
                      "value": 1000,
                      "unit": "event types"
                    },
                    "max_endpoints": {
                      "value": 10000,
                      "unit": "endpoints"
                    },
                    "max_sources": {
                      "value": 1000,
                      "unit": "sources"
                    },
                    "max_pending_deliveries": {
                      "value": 100000,
                      "unit": "deliveries"
                    },
                    "max_content_bytes": {
                      "value": 10737418240,
                      "unit": "bytes"
                    },
                    "max_active_replays": {
                      "value": 10,
                      "unit": "jobs"
                    }
                  },
                  "rate_version": "2026-10-08"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/rates": {
      "get": {
        "operationId": "getRates",
        "tags": [
          "Rates and settings"
        ],
        "summary": "Get rates",
        "description": "Returns the published rates. `webhooks.ingest_64k` is $0.00001 for each 64 KiB of an accepted message's body, at least 1 unit, charged even when the message has no destinations. `webhooks.delivery_16k` is $0.00005 for each 16 KiB of each delivery generation's body, at least 1 unit per endpoint. Automatic retries are free; a replay is a new paid delivery generation; an endpoint test pays ingestion and delivery. Accepted work keeps the rate version that priced it. There is no free allowance. Usage by meter is at `GET /meta/usage`.",
        "parameters": [
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The rates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rates"
                },
                "example": {
                  "currency": "USD",
                  "version": "2026-10-08",
                  "effective_at": "2026-10-08T00:00:00Z",
                  "meters": [
                    {
                      "id": "webhooks.ingest_64k",
                      "unit": "unit",
                      "unit_bytes": 65536,
                      "unit_price_usd": "0.00001"
                    },
                    {
                      "id": "webhooks.delivery_16k",
                      "unit": "unit",
                      "unit_bytes": 16384,
                      "unit_price_usd": "0.00005"
                    }
                  ]
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/settings": {
      "get": {
        "operationId": "getSettings",
        "tags": [
          "Rates and settings"
        ],
        "summary": "Get settings",
        "description": "Returns your team's retention and logging settings and its effective limits. The `ETag` is `\"wd:settings:<configuration_version>\"`.",
        "parameters": [
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                },
                "example": {
                  "configuration_version": "1",
                  "payload_retention_days": 30,
                  "response_body_logging": false,
                  "response_retention_days": 7,
                  "approved_configuration_version": "1",
                  "limits": {
                    "max_body_bytes": {
                      "value": 1048576,
                      "unit": "bytes"
                    },
                    "max_fanout_endpoints": {
                      "value": 100,
                      "unit": "endpoints"
                    },
                    "max_transformed_bytes_per_message": {
                      "value": 8388608,
                      "unit": "bytes"
                    },
                    "max_attempts": {
                      "value": 9,
                      "unit": "attempts"
                    },
                    "delivery_window_hours": {
                      "value": 72,
                      "unit": "hours"
                    },
                    "max_schedule_days": {
                      "value": 7,
                      "unit": "days"
                    },
                    "max_endpoints_per_tenant": {
                      "value": 100,
                      "unit": "endpoints"
                    },
                    "read_requests_per_second": {
                      "value": 100,
                      "unit": "requests per second"
                    },
                    "config_writes_per_second": {
                      "value": 20,
                      "unit": "requests per second"
                    },
                    "admission_rate": {
                      "value": 100,
                      "unit": "messages per second",
                      "measured": false
                    },
                    "source_requests_per_second": {
                      "value": 50,
                      "unit": "requests per second"
                    },
                    "dispatch_rate": {
                      "value": 1000,
                      "unit": "attempts per second",
                      "measured": false
                    },
                    "max_concurrency": {
                      "value": 3,
                      "unit": "requests"
                    },
                    "max_endpoint_concurrency": {
                      "value": 3,
                      "unit": "requests"
                    },
                    "service_concurrency": {
                      "value": 6,
                      "unit": "requests across all teams"
                    },
                    "max_tenants": {
                      "value": 10000,
                      "unit": "tenants"
                    },
                    "max_event_types": {
                      "value": 1000,
                      "unit": "event types"
                    },
                    "max_endpoints": {
                      "value": 10000,
                      "unit": "endpoints"
                    },
                    "max_sources": {
                      "value": 1000,
                      "unit": "sources"
                    },
                    "max_pending_deliveries": {
                      "value": 100000,
                      "unit": "deliveries"
                    },
                    "max_content_bytes": {
                      "value": 10737418240,
                      "unit": "bytes"
                    },
                    "max_active_replays": {
                      "value": 10,
                      "unit": "jobs"
                    }
                  }
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateSettings",
        "tags": [
          "Rates and settings"
        ],
        "summary": "Update settings",
        "description": "Changes retention and logging. Omitted fields keep their values; an unchanged request keeps the version. A shorter `payload_retention_days` applies to stored messages at once (bodies of active deliveries stay until they expire); a longer one never restores erased bytes. Limits can't be changed here: spending is bounded by your key and account limits.",
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the settings from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payload_retention_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "description": "Days to keep message and delivery bodies, 1 to 30."
                  },
                  "response_body_logging": {
                    "type": "boolean",
                    "description": "Whether attempts keep up to 4 KiB of response bodies."
                  },
                  "response_retention_days": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 7,
                    "description": "Days to keep response bodies, 1 to 7."
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "payload_retention_days": 14,
                "response_body_logging": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The settings, with a new `ETag` if they changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Settings"
                },
                "example": {
                  "configuration_version": "2",
                  "payload_retention_days": 14,
                  "response_body_logging": true,
                  "response_retention_days": 7,
                  "approved_configuration_version": "1",
                  "limits": {
                    "max_body_bytes": {
                      "value": 1048576,
                      "unit": "bytes"
                    },
                    "max_fanout_endpoints": {
                      "value": 100,
                      "unit": "endpoints"
                    },
                    "max_transformed_bytes_per_message": {
                      "value": 8388608,
                      "unit": "bytes"
                    },
                    "max_attempts": {
                      "value": 9,
                      "unit": "attempts"
                    },
                    "delivery_window_hours": {
                      "value": 72,
                      "unit": "hours"
                    },
                    "max_schedule_days": {
                      "value": 7,
                      "unit": "days"
                    },
                    "max_endpoints_per_tenant": {
                      "value": 100,
                      "unit": "endpoints"
                    },
                    "read_requests_per_second": {
                      "value": 100,
                      "unit": "requests per second"
                    },
                    "config_writes_per_second": {
                      "value": 20,
                      "unit": "requests per second"
                    },
                    "admission_rate": {
                      "value": 100,
                      "unit": "messages per second",
                      "measured": false
                    },
                    "source_requests_per_second": {
                      "value": 50,
                      "unit": "requests per second"
                    },
                    "dispatch_rate": {
                      "value": 1000,
                      "unit": "attempts per second",
                      "measured": false
                    },
                    "max_concurrency": {
                      "value": 3,
                      "unit": "requests"
                    },
                    "max_endpoint_concurrency": {
                      "value": 3,
                      "unit": "requests"
                    },
                    "service_concurrency": {
                      "value": 6,
                      "unit": "requests across all teams"
                    },
                    "max_tenants": {
                      "value": 10000,
                      "unit": "tenants"
                    },
                    "max_event_types": {
                      "value": 1000,
                      "unit": "event types"
                    },
                    "max_endpoints": {
                      "value": 10000,
                      "unit": "endpoints"
                    },
                    "max_sources": {
                      "value": 1000,
                      "unit": "sources"
                    },
                    "max_pending_deliveries": {
                      "value": 100000,
                      "unit": "deliveries"
                    },
                    "max_content_bytes": {
                      "value": 10737418240,
                      "unit": "bytes"
                    },
                    "max_active_replays": {
                      "value": 10,
                      "unit": "jobs"
                    }
                  }
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` isn't the current settings `ETag` (`revision_conflict`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The settings changed since you read them. Read them again and retry with their new ETag."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid or unknown, or `If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`payload_retention_days` must be from 1 to 30."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/analytics": {
      "get": {
        "operationId": "getAnalytics",
        "tags": [
          "Analytics and events"
        ],
        "summary": "Get analytics",
        "description": "Returns hourly or daily counts of admissions, deliveries, attempts, and outcomes in a window of at most 30 days, and the current queue. Counts are by the time of each transition, eventually consistent within about a minute, and never a billing record. Without filters they cover the whole team; `endpoint_id`, `source_id`, and `tenant_id` narrow them (in that order of precedence).",
        "parameters": [
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Required. Inclusive RFC 3339 time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-09T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Required. Exclusive RFC 3339 time, at most 30 days after `created_after`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-09T03:00:00Z"
          },
          {
            "name": "bucket",
            "in": "query",
            "required": false,
            "description": "`hour` (default) or `day`, aligned to UTC.",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day"
              ],
              "default": "hour"
            }
          },
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "description": "Only this tenant's admissions and attempts.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpoint_id",
            "in": "query",
            "required": false,
            "description": "Only this endpoint's deliveries and attempts.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "required": false,
            "description": "Only this source's captures, duplicates, and rejections.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Analytics"
                },
                "example": {
                  "bucket": "hour",
                  "created_after": "2026-10-09T00:00:00Z",
                  "created_before": "2026-10-09T03:00:00Z",
                  "data": [
                    {
                      "start": "2026-10-09T00:00:00Z",
                      "admitted_messages": 1200,
                      "ingest_bytes": 1310720,
                      "deliveries": 2400,
                      "attempts": 2461,
                      "succeeded": 2380,
                      "failed": 3,
                      "expired": 0,
                      "canceled": 2,
                      "duplicates": 14,
                      "rejected_auth": 1,
                      "throttled": 0,
                      "queue_depth": 0,
                      "oldest_due_age_seconds": 0
                    },
                    {
                      "start": "2026-10-09T02:00:00Z",
                      "admitted_messages": 860,
                      "ingest_bytes": 901120,
                      "deliveries": 1720,
                      "attempts": 1733,
                      "succeeded": 1712,
                      "failed": 0,
                      "expired": 0,
                      "canceled": 0,
                      "duplicates": 6,
                      "rejected_auth": 0,
                      "throttled": 0,
                      "queue_depth": 0,
                      "oldest_due_age_seconds": 0
                    }
                  ],
                  "queue_depth": 37,
                  "oldest_due_age_seconds": 4
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A time is missing or invalid, the window is longer than 30 days, `bucket` is invalid, or `tenant_id`, `endpoint_id`, or `source_id` doesn't name a resource of your team (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`created_after` and created_before are required, at most 30 days apart."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Analytics and events"
        ],
        "summary": "List events",
        "description": "Lists operational events of the last 30 days, oldest first: failed and expired deliveries, disabled and recovered endpoints, rejected source requests, completed and failed replays, and captures blocked by spending. Events hold IDs, reasons, counts, and times, never payloads or secrets.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only events of this type.",
            "schema": {
              "type": "string",
              "enum": [
                "webhooks.delivery.failed",
                "webhooks.delivery.expired",
                "webhooks.endpoint.disabled",
                "webhooks.endpoint.recovered",
                "webhooks.source.rejected",
                "webhooks.replay.completed",
                "webhooks.replay.failed",
                "webhooks.budget.blocked"
              ]
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "required": false,
            "description": "Only events about this resource, including as the first or last of a coalesced event.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "description": "Only this tenant's events.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wdv_9oLpKi4JuHy7GtFrDe2SwQ",
                      "type": "webhooks.endpoint.disabled",
                      "created_at": "2026-10-09T18:22:01Z",
                      "mode": "live",
                      "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                      "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                      "resource_version": "4",
                      "data": {
                        "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                        "reason": "endpoint_gone"
                      },
                      "coalesced": false,
                      "count": 1,
                      "first_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                      "last_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`type` or `limit` is invalid (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`type` must be one of webhooks.delivery.failed, ..."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/events/{id}": {
      "get": {
        "operationId": "getEvent",
        "tags": [
          "Analytics and events"
        ],
        "summary": "Get an event",
        "description": "Returns an event of the last 30 days.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event's ID, `wdv_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdv_9oLpKi4JuHy7GtFrDe2SwQ"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                },
                "example": {
                  "id": "wdv_9oLpKi4JuHy7GtFrDe2SwQ",
                  "type": "webhooks.endpoint.disabled",
                  "created_at": "2026-10-09T18:22:01Z",
                  "mode": "live",
                  "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "resource_version": "4",
                  "data": {
                    "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                    "reason": "endpoint_gone"
                  },
                  "coalesced": false,
                  "count": 1,
                  "first_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "last_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The event doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The event doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/tenants": {
      "post": {
        "operationId": "createTenant",
        "tags": [
          "Tenants"
        ],
        "summary": "Create a tenant",
        "description": "Creates one of your customers. `external_id` is your ID for it: unique in your team, immutable, and reserved for 90 days after the tenant is deleted. At most 10,000 tenants by default.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "external_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9_.:-]+$",
                    "description": "Your ID for the customer: 1 to 128 letters, digits, `_`, `.`, `:`, and `-`."
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "1 to 128 UTF-8 bytes."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [
                  "external_id",
                  "name"
                ],
                "additionalProperties": false
              },
              "example": {
                "external_id": "acct_1042",
                "name": "Acme Robotics",
                "metadata": {
                  "plan": "growth"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                },
                "example": {
                  "id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "external_id": "acct_1042",
                  "name": "Acme Robotics",
                  "metadata": {
                    "plan": "growth"
                  },
                  "status": "active",
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Another tenant has the `external_id`, including a deleted one within 90 days (`resource_in_use`, with `resource_id`), or the team is at its tenant limit (`quota_exceeded`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "resource_in_use",
                    "message": "Tenant wdt_1aB2cD3eF4gH5iJ6kL7mN8 has the external ID acct_1042. A deleted tenant keeps its external ID for 90 days.",
                    "resource_id": "wdt_1aB2cD3eF4gH5iJ6kL7mN8"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is missing, invalid, or unknown, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`external_id` must be 1 to 128 characters of letters, digits, `_`, `.`, `:`, and `-`."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listTenants",
        "tags": [
          "Tenants"
        ],
        "summary": "List tenants",
        "description": "Lists tenants, deleted ones included, oldest first.",
        "parameters": [
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "description": "Only the tenant with this external ID.",
            "schema": {
              "type": "string"
            },
            "example": "acct_1042"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of tenants.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                      "external_id": "acct_1042",
                      "name": "Acme Robotics",
                      "metadata": {
                        "plan": "growth"
                      },
                      "status": "active",
                      "version": "1",
                      "created_at": "2026-10-09T18:22:01Z",
                      "updated_at": "2026-10-09T18:22:01Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`limit` is invalid (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "The cursor isn't valid for this list. Use next_cursor from the previous response.",
                    "field": "cursor"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/tenants/{id}": {
      "get": {
        "operationId": "getTenant",
        "tags": [
          "Tenants"
        ],
        "summary": "Get a tenant",
        "description": "Returns a tenant, active or deleted, with its `ETag`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The tenant's ID, `wdt_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdt_4fRm8NqZ2kLpVx7cJs9hYb"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                },
                "example": {
                  "id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "external_id": "acct_1042",
                  "name": "Acme Robotics",
                  "metadata": {
                    "plan": "growth"
                  },
                  "status": "active",
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The tenant doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The tenant doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateTenant",
        "tags": [
          "Tenants"
        ],
        "summary": "Update a tenant",
        "description": "Changes the name or the metadata. Omitted fields keep their values; `metadata` replaces all pairs. An unchanged request keeps the version.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The tenant's ID, `wdt_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdt_4fRm8NqZ2kLpVx7cJs9hYb"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the tenant from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "name": "Acme Robotics Inc."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                },
                "example": {
                  "id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "external_id": "acct_1042",
                  "name": "Acme Robotics Inc.",
                  "metadata": {
                    "plan": "growth"
                  },
                  "status": "active",
                  "version": "2",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The tenant doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The tenant doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid or unknown, or `If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`name` must be from 1 to 128 bytes."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteTenant",
        "tags": [
          "Tenants"
        ],
        "summary": "Delete a tenant",
        "description": "Deletes the tenant, its endpoints, and its sources at once: no new messages or captures, queued deliveries are canceled, and its content is erased. Requests already in flight may complete. Deletion can't be undone; charges already made stay.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The tenant's ID, `wdt_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdt_4fRm8NqZ2kLpVx7cJs9hYb"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the tenant from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The tenant doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The tenant doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "422": {
            "description": "`If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`If-Match` must be one strong ETag in quotes."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/event_types": {
      "post": {
        "operationId": "createEventType",
        "tags": [
          "Event types"
        ],
        "summary": "Create an event type",
        "description": "Adds a type to your catalog. Messages need an active type; sources may only emit active types. Names are immutable and unique, archived ones included. At most 1,000 types by default.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Lowercase dot-separated words, such as `invoice.paid`. Immutable. `webhooks.*` and `motor.*` are reserved.",
                    "maxLength": 128,
                    "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"
                  },
                  "description": {
                    "type": "string",
                    "description": "At most 4,096 bytes. Empty by default.",
                    "maxLength": 4096
                  },
                  "example": {
                    "description": "Any JSON of at most 16 KiB, kept exactly as written, or `null` (the default)."
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              "example": {
                "name": "invoice.paid",
                "description": "An invoice was paid in full.",
                "example": {
                  "invoice_id": "inv_42",
                  "amount": "49.00"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The event type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventType"
                },
                "example": {
                  "id": "wdy_9QwErT5yUiOp3aSdFgHjKz",
                  "name": "invoice.paid",
                  "description": "An invoice was paid in full.",
                  "example": {
                    "invoice_id": "inv_42",
                    "amount": "49.00"
                  },
                  "archived": false,
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The name exists, archived or not (`resource_in_use`, with `resource_id`; reactivate an archived type with `PATCH` and `archived: false`), or the team is at its limit (`quota_exceeded`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "resource_in_use",
                    "message": "The event type invoice.paid exists.",
                    "resource_id": "wdy_9QwErT5yUiOp3aSdFgHjKz"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The name is invalid or reserved (`webhooks.*`, `motor.*`), a field is invalid or unknown, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`name` can't start with webhooks. or motor., which Motor reserves."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listEventTypes",
        "tags": [
          "Event types"
        ],
        "summary": "List event types",
        "description": "Lists your catalog, archived types included, oldest first.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only the type with this name.",
            "schema": {
              "type": "string"
            },
            "example": "invoice.paid"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of event types.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventTypeList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wdy_9QwErT5yUiOp3aSdFgHjKz",
                      "name": "invoice.paid",
                      "description": "An invoice was paid in full.",
                      "example": {
                        "invoice_id": "inv_42",
                        "amount": "49.00"
                      },
                      "archived": false,
                      "version": "1",
                      "created_at": "2026-10-09T18:22:01Z",
                      "updated_at": "2026-10-09T18:22:01Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`limit` is invalid (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`limit` must be from 1 to 200."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/event_types/{id}": {
      "get": {
        "operationId": "getEventType",
        "tags": [
          "Event types"
        ],
        "summary": "Get an event type",
        "description": "Returns an event type with its `ETag`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event type's ID, `wdy_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdy_9QwErT5yUiOp3aSdFgHjKz"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The event type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventType"
                },
                "example": {
                  "id": "wdy_9QwErT5yUiOp3aSdFgHjKz",
                  "name": "invoice.paid",
                  "description": "An invoice was paid in full.",
                  "example": {
                    "invoice_id": "inv_42",
                    "amount": "49.00"
                  },
                  "archived": false,
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The event type doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The event type doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateEventType",
        "tags": [
          "Event types"
        ],
        "summary": "Update an event type",
        "description": "Changes the description or the example, or reactivates an archived type with `archived: false`. The name can't change.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event type's ID, `wdy_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdy_9QwErT5yUiOp3aSdFgHjKz"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the event type from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "description": "At most 4,096 bytes.",
                    "maxLength": 4096
                  },
                  "example": {
                    "description": "Any JSON of at most 16 KiB, or `null`."
                  },
                  "archived": {
                    "type": "boolean",
                    "const": false,
                    "description": "Only `false`, which reactivates the type. `DELETE` archives it."
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "archived": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The event type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventType"
                },
                "example": {
                  "id": "wdy_9QwErT5yUiOp3aSdFgHjKz",
                  "name": "invoice.paid",
                  "description": "An invoice was paid in full.",
                  "example": {
                    "invoice_id": "inv_42",
                    "amount": "49.00"
                  },
                  "archived": false,
                  "version": "3",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The event type doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The event type doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid or unknown, `archived` is `true`, or `If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`archived` can only be false, which reactivates the type. DELETE archives it."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "archiveEventType",
        "tags": [
          "Event types"
        ],
        "summary": "Archive an event type",
        "description": "Archives the type: new messages and captures of it are refused with `422 invalid_event_type`, while retained messages stay readable and replayable. Archiving an archived type changes nothing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The event type's ID, `wdy_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdy_9QwErT5yUiOp3aSdFgHjKz"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the event type from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Archived.",
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The event type doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The event type doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "422": {
            "description": "`If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`If-Match` must be one strong ETag in quotes."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/endpoints": {
      "post": {
        "operationId": "createEndpoint",
        "tags": [
          "Endpoints"
        ],
        "summary": "Create an endpoint",
        "description": "Creates a receiver for a tenant's messages and returns its `signing_secret` once. Every delivery is signed with Standard Webhooks headers (see the service description). At most 100 endpoints per tenant and 10,000 per team by default.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "description": "An active tenant. Immutable.",
                    "pattern": "^wdt_"
                  },
                  "url": {
                    "type": "string",
                    "description": "HTTPS on port 443 to a public host name or IPv4 address, at most 2,048 bytes, without user information or a fragment. Private, loopback, Motor, and `.local`/`.internal` hosts are `422 unsafe_url`. The query is kept exactly and treated as secret.",
                    "format": "uri"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "`Webhook` by default."
                  },
                  "description": {
                    "type": "string",
                    "description": "At most 4,096 bytes; empty by default.",
                    "maxLength": 4096
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 50 event type patterns: a name, `prefix.*`, or `*`. `[\"*\"]` by default. Patterns may name types you haven't created yet."
                  },
                  "filter": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Filter"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "`null` (the default) matches every message of the event types."
                  },
                  "transform": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Transform"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "`null` (the default) sends the message's bytes unchanged."
                  },
                  "status": {
                    "type": "string",
                    "description": "`enabled` (the default) or `paused`. A paused endpoint queues deliveries while their deadlines run. A `disabled` endpoint needs `/resume`.",
                    "enum": [
                      "enabled",
                      "paused"
                    ]
                  },
                  "rate_per_second": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "description": "50 by default."
                  },
                  "max_concurrency": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "description": "3 by default (or your team's cap, if lower), and at most 3: Motor runs at most 3 attempts of a team at once. 1 with a rate of 1 sends one at a time, though retries and replays can still reorder."
                  },
                  "retry_delays_seconds": {
                    "type": "array",
                    "maxItems": 8,
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 86400
                    },
                    "description": "0 to 8 delays of 1 to 86,400 seconds, adding up to at most 259,200. `[15, 60, 300, 900, 3600, 14400, 43200, 86400]` by default."
                  },
                  "timeout_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "description": "10 by default."
                  },
                  "headers": {
                    "type": "object",
                    "maxProperties": 20,
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "description": "Custom headers: at most 20 token names, values of at most 1,024 bytes without line breaks, 8 KiB in all. Motor's own and hop-by-hop headers (`host`, `content-type`, `authorization`, `cookie`, `webhook-*`, `motor-*`, `x-forwarded-*`, and others) aren't allowed. Values are write-only. `{}` by default."
                  },
                  "authorization": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "The `Authorization` header to send, such as `Bearer ...`; write-only. `null` by default."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [
                  "tenant_id",
                  "url"
                ],
                "additionalProperties": false
              },
              "example": {
                "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                "url": "https://hooks.acme.example/motor?team=7",
                "name": "Billing receiver",
                "events": [
                  "invoice.*"
                ],
                "filter": {
                  "all": [
                    {
                      "path": "/amount",
                      "op": "prefix",
                      "value": "4"
                    }
                  ]
                },
                "headers": {
                  "X-Acme-Tenant": "1042"
                },
                "authorization": "Bearer acme_live_9f8e7d6c"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The endpoint, with `signing_secret`. An idempotent replay shows the secret only to the key that created it, while that secret is current.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                },
                "example": {
                  "id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Billing receiver",
                  "description": "",
                  "url": "https://hooks.acme.example/motor?team=7",
                  "events": [
                    "invoice.*"
                  ],
                  "filter": {
                    "all": [
                      {
                        "path": "/amount",
                        "op": "prefix",
                        "value": "4"
                      }
                    ]
                  },
                  "transform": null,
                  "transform_version": "1",
                  "status": "enabled",
                  "disabled_reason": null,
                  "rate_per_second": 50,
                  "max_concurrency": 3,
                  "retry_delays_seconds": [
                    15,
                    60,
                    300,
                    900,
                    3600,
                    14400,
                    43200,
                    86400
                  ],
                  "timeout_seconds": 10,
                  "headers": [
                    "x-acme-tenant"
                  ],
                  "has_authorization": true,
                  "metadata": {},
                  "secret_version": 1,
                  "old_secret_expires_at": null,
                  "health": {
                    "circuit": "closed",
                    "consecutive_failures": 0,
                    "last_success_at": null,
                    "last_failure_at": null,
                    "next_probe_at": null
                  },
                  "queued_count": 0,
                  "url_revision": "1",
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z",
                  "signing_secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSwq8uEPmRUQ0Y="
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The team or the tenant is at its endpoint limit (`quota_exceeded`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "quota_exceeded",
                    "message": "Your team has reached its limit of 100 endpoints for this tenant. Delete some, or contact support@motor.dev to raise the limit."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is missing, invalid, or unknown, the tenant isn't active, `max_concurrency` is over your cap, or `Idempotency-Key` is missing (`invalid_field`); or the URL's host is private or Motor's (`unsafe_url`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsafe_url",
                    "message": "`url` can't be a private, loopback, link-local, or reserved address.",
                    "field": "url"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listEndpoints",
        "tags": [
          "Endpoints"
        ],
        "summary": "List endpoints",
        "description": "Lists endpoints that aren't deleted, oldest first.",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "description": "Only this tenant's endpoints.",
            "schema": {
              "type": "string"
            },
            "example": "wdt_4fRm8NqZ2kLpVx7cJs9hYb"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only endpoints with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "enabled",
                "paused",
                "disabled"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of endpoints.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndpointList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                      "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                      "name": "Billing receiver",
                      "description": "",
                      "url": "https://hooks.acme.example/motor?team=7",
                      "events": [
                        "invoice.*"
                      ],
                      "filter": {
                        "all": [
                          {
                            "path": "/amount",
                            "op": "prefix",
                            "value": "4"
                          }
                        ]
                      },
                      "transform": null,
                      "transform_version": "1",
                      "status": "enabled",
                      "disabled_reason": null,
                      "rate_per_second": 50,
                      "max_concurrency": 3,
                      "retry_delays_seconds": [
                        15,
                        60,
                        300,
                        900,
                        3600,
                        14400,
                        43200,
                        86400
                      ],
                      "timeout_seconds": 10,
                      "headers": [
                        "x-acme-tenant"
                      ],
                      "has_authorization": true,
                      "metadata": {},
                      "secret_version": 1,
                      "old_secret_expires_at": null,
                      "health": {
                        "circuit": "closed",
                        "consecutive_failures": 0,
                        "last_success_at": null,
                        "last_failure_at": null,
                        "next_probe_at": null
                      },
                      "queued_count": 0,
                      "url_revision": "1",
                      "version": "1",
                      "created_at": "2026-10-09T18:22:01Z",
                      "updated_at": "2026-10-09T18:22:01Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A filter is invalid or names another team's tenant (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`status` must be enabled, paused, or disabled."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/endpoints/{id}": {
      "get": {
        "operationId": "getEndpoint",
        "tags": [
          "Endpoints"
        ],
        "summary": "Get an endpoint",
        "description": "Returns an endpoint with its URL, health, and `ETag`. The signing secret, header values, and authorization are never shown.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's ID, `wde_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wde_6mNbVc8xZaS2dFgH4jKlQw"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                },
                "example": {
                  "id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Billing receiver",
                  "description": "",
                  "url": "https://hooks.acme.example/motor?team=7",
                  "events": [
                    "invoice.*"
                  ],
                  "filter": {
                    "all": [
                      {
                        "path": "/amount",
                        "op": "prefix",
                        "value": "4"
                      }
                    ]
                  },
                  "transform": null,
                  "transform_version": "1",
                  "status": "enabled",
                  "disabled_reason": null,
                  "rate_per_second": 50,
                  "max_concurrency": 3,
                  "retry_delays_seconds": [
                    15,
                    60,
                    300,
                    900,
                    3600,
                    14400,
                    43200,
                    86400
                  ],
                  "timeout_seconds": 10,
                  "headers": [
                    "x-acme-tenant"
                  ],
                  "has_authorization": true,
                  "metadata": {},
                  "secret_version": 1,
                  "old_secret_expires_at": null,
                  "health": {
                    "circuit": "closed",
                    "consecutive_failures": 0,
                    "last_success_at": null,
                    "last_failure_at": null,
                    "next_probe_at": null
                  },
                  "queued_count": 0,
                  "url_revision": "1",
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The endpoint doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The endpoint doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateEndpoint",
        "tags": [
          "Endpoints"
        ],
        "summary": "Update an endpoint",
        "description": "Changes the configuration; the tenant can't change. Omitted fields keep their values, `null` clears `filter`, `transform`, and `authorization`, and arrays and objects replace in full. A URL with a new host must come with `authorization` (or `null`) and `headers` (or `{}`), so that credentials never move to another host by omission. A new URL resets health. Every pending delivery, retries and replays included, goes to the current URL with the current credentials at its next attempt; queued bytes never change. A `disabled` endpoint stays disabled until `/resume`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's ID, `wde_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wde_6mNbVc8xZaS2dFgH4jKlQw"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the endpoint from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "HTTPS on port 443 to a public host name or IPv4 address, at most 2,048 bytes, without user information or a fragment. Private, loopback, Motor, and `.local`/`.internal` hosts are `422 unsafe_url`. The query is kept exactly and treated as secret.",
                    "format": "uri"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "description": "`Webhook` by default."
                  },
                  "description": {
                    "type": "string",
                    "description": "At most 4,096 bytes; empty by default.",
                    "maxLength": 4096
                  },
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string"
                    },
                    "description": "1 to 50 event type patterns: a name, `prefix.*`, or `*`. `[\"*\"]` by default. Patterns may name types you haven't created yet."
                  },
                  "filter": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Filter"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "`null` (the default) matches every message of the event types."
                  },
                  "transform": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/Transform"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "`null` (the default) sends the message's bytes unchanged."
                  },
                  "status": {
                    "type": "string",
                    "description": "`enabled` (the default) or `paused`. A paused endpoint queues deliveries while their deadlines run. A `disabled` endpoint needs `/resume`.",
                    "enum": [
                      "enabled",
                      "paused"
                    ]
                  },
                  "rate_per_second": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "description": "50 by default."
                  },
                  "max_concurrency": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3,
                    "description": "3 by default (or your team's cap, if lower), and at most 3: Motor runs at most 3 attempts of a team at once. 1 with a rate of 1 sends one at a time, though retries and replays can still reorder."
                  },
                  "retry_delays_seconds": {
                    "type": "array",
                    "maxItems": 8,
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 86400
                    },
                    "description": "0 to 8 delays of 1 to 86,400 seconds, adding up to at most 259,200. `[15, 60, 300, 900, 3600, 14400, 43200, 86400]` by default."
                  },
                  "timeout_seconds": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30,
                    "description": "10 by default."
                  },
                  "headers": {
                    "type": "object",
                    "maxProperties": 20,
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 1024
                    },
                    "description": "Custom headers: at most 20 token names, values of at most 1,024 bytes without line breaks, 8 KiB in all. Motor's own and hop-by-hop headers (`host`, `content-type`, `authorization`, `cookie`, `webhook-*`, `motor-*`, `x-forwarded-*`, and others) aren't allowed. Values are write-only. `{}` by default."
                  },
                  "authorization": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 2048,
                    "description": "The `Authorization` header to send, such as `Bearer ...`; write-only. `null` by default."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "url": "https://hooks.acme.example/v2/motor",
                "status": "paused"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The endpoint.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                },
                "example": {
                  "id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Billing receiver",
                  "description": "",
                  "url": "https://hooks.acme.example/v2/motor",
                  "events": [
                    "invoice.*"
                  ],
                  "filter": {
                    "all": [
                      {
                        "path": "/amount",
                        "op": "prefix",
                        "value": "4"
                      }
                    ]
                  },
                  "transform": null,
                  "transform_version": "1",
                  "status": "paused",
                  "disabled_reason": null,
                  "rate_per_second": 50,
                  "max_concurrency": 3,
                  "retry_delays_seconds": [
                    15,
                    60,
                    300,
                    900,
                    3600,
                    14400,
                    43200,
                    86400
                  ],
                  "timeout_seconds": 10,
                  "headers": [
                    "x-acme-tenant"
                  ],
                  "has_authorization": true,
                  "metadata": {},
                  "secret_version": 1,
                  "old_secret_expires_at": null,
                  "health": {
                    "circuit": "closed",
                    "consecutive_failures": 0,
                    "last_success_at": null,
                    "last_failure_at": null,
                    "next_probe_at": null
                  },
                  "queued_count": 0,
                  "url_revision": "2",
                  "version": "4",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The endpoint doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The endpoint doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "`status: enabled` for an endpoint Motor disabled (`invalid_state`): use `/resume`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "Motor disabled this endpoint. Call POST /endpoints/wde_6mNbVc8xZaS2dFgH4jKlQw/resume to enable it."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid or unknown, a new host lacks `authorization` and `headers`, or `If-Match` is malformed (`invalid_field`); or the URL is unsafe (`unsafe_url`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`url` changes the host, so send authorization (or null) and headers (or {}) too. Motor doesn't move credentials to a new host.",
                    "field": "url"
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteEndpoint",
        "tags": [
          "Endpoints"
        ],
        "summary": "Delete an endpoint",
        "description": "Deletes the endpoint: it gets no new messages, nothing more is claimed, and its unclaimed deliveries are canceled. A request already in flight can't be recalled.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's ID, `wde_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wde_6mNbVc8xZaS2dFgH4jKlQw"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the endpoint from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The endpoint doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The endpoint doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "422": {
            "description": "`If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`If-Match` must be one strong ETag in quotes."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/endpoints/{id}/rotate_secret": {
      "post": {
        "operationId": "rotateEndpointSecret",
        "tags": [
          "Endpoints"
        ],
        "summary": "Rotate the signing secret",
        "description": "Makes a new signing secret and returns it once. During `overlap_seconds` (86,400 by default), deliveries carry a `v1` signature for both secrets; `0` retires every old secret at once. Another nonzero rotation during an overlap is `409`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's ID, `wde_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wde_6mNbVc8xZaS2dFgH4jKlQw"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the endpoint from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overlap_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 86400,
                    "default": 86400,
                    "description": "How long the previous secret keeps signing, 0 to 86,400 seconds."
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "overlap_seconds": 3600
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The endpoint, with the new `signing_secret`. An idempotent replay shows it only to the key that rotated it, while it's current.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                },
                "example": {
                  "id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Billing receiver",
                  "description": "",
                  "url": "https://hooks.acme.example/motor?team=7",
                  "events": [
                    "invoice.*"
                  ],
                  "filter": {
                    "all": [
                      {
                        "path": "/amount",
                        "op": "prefix",
                        "value": "4"
                      }
                    ]
                  },
                  "transform": null,
                  "transform_version": "1",
                  "status": "enabled",
                  "disabled_reason": null,
                  "rate_per_second": 50,
                  "max_concurrency": 3,
                  "retry_delays_seconds": [
                    15,
                    60,
                    300,
                    900,
                    3600,
                    14400,
                    43200,
                    86400
                  ],
                  "timeout_seconds": 10,
                  "headers": [
                    "x-acme-tenant"
                  ],
                  "has_authorization": true,
                  "metadata": {},
                  "secret_version": 2,
                  "old_secret_expires_at": "2026-10-10T18:22:01Z",
                  "health": {
                    "circuit": "closed",
                    "consecutive_failures": 0,
                    "last_success_at": null,
                    "last_failure_at": null,
                    "next_probe_at": null
                  },
                  "queued_count": 0,
                  "url_revision": "1",
                  "version": "3",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z",
                  "signing_secret": "whsec_c2VjcmV0LWtleS1mb3ItZXhhbXBsZXMtb25seS0xMjM="
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The endpoint doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The endpoint doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The previous secret is still in its overlap and `overlap_seconds` isn't 0 (`invalid_state`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "The previous signing key is still valid until 2026-10-10T18:22:01Z. Wait for the overlap to end, or rotate with overlap_seconds: 0 to retire every old key at once."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`overlap_seconds` is invalid, a field is unknown, or a header is missing or malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`overlap_seconds` must be from 0 to 86400."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/endpoints/{id}/resume": {
      "post": {
        "operationId": "resumeEndpoint",
        "tags": [
          "Endpoints"
        ],
        "summary": "Resume an endpoint",
        "description": "Checks the URL again, enables the endpoint, resets its circuit to half-open and lets one probe go. Use it for an endpoint that Motor disabled or whose circuit is open. Finished deliveries stay finished: replay them if you still need them.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's ID, `wde_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wde_6mNbVc8xZaS2dFgH4jKlQw"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the endpoint from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "The endpoint. An idempotent replay returns only `{\"id\", \"status\"}`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                },
                "example": {
                  "id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Billing receiver",
                  "description": "",
                  "url": "https://hooks.acme.example/motor?team=7",
                  "events": [
                    "invoice.*"
                  ],
                  "filter": {
                    "all": [
                      {
                        "path": "/amount",
                        "op": "prefix",
                        "value": "4"
                      }
                    ]
                  },
                  "transform": null,
                  "transform_version": "1",
                  "status": "enabled",
                  "disabled_reason": null,
                  "rate_per_second": 50,
                  "max_concurrency": 3,
                  "retry_delays_seconds": [
                    15,
                    60,
                    300,
                    900,
                    3600,
                    14400,
                    43200,
                    86400
                  ],
                  "timeout_seconds": 10,
                  "headers": [
                    "x-acme-tenant"
                  ],
                  "has_authorization": true,
                  "metadata": {},
                  "secret_version": 1,
                  "old_secret_expires_at": null,
                  "health": {
                    "circuit": "half_open",
                    "consecutive_failures": 0,
                    "last_success_at": null,
                    "last_failure_at": null,
                    "next_probe_at": null
                  },
                  "queued_count": 0,
                  "url_revision": "1",
                  "version": "5",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The endpoint doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The endpoint doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_conflict",
                    "message": "This Idempotency-Key was used for a different request. Use a new key for a new operation."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The URL is no longer safe (`unsafe_url`), the body has a field, or a header is missing or malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsafe_url",
                    "message": "`url` can't be a private or Motor host.",
                    "field": "url"
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/endpoints/{id}/test": {
      "post": {
        "operationId": "testEndpoint",
        "tags": [
          "Endpoints"
        ],
        "summary": "Send a test message",
        "description": "Sends a `motor.test` message to this endpoint's real receiver only. It skips the endpoint's event types and filter, but uses its authentication, signing, retries, and billing: it costs ingestion ($0.00001 per 64 KiB, at least 1 unit) plus delivery ($0.00005 per 16 KiB, at least 1 unit). Paused and disabled endpoints are refused; a test never resumes them.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's ID, `wde_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wde_6mNbVc8xZaS2dFgH4jKlQw"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payload": {
                    "description": "Any JSON to send, exactly as written. `{\"test\":true}` by default."
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "payload": {
                  "test": true
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The accepted test message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                },
                "example": {
                  "id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "event_type": "motor.test",
                  "external_id": null,
                  "origin": "test",
                  "source_id": null,
                  "status": "queued",
                  "body_bytes": 11,
                  "body_sha256": "7bc2e5c2c4b0f0b8d1b9a9e1c3d2f4a6b8c0e2f4a6b8c0d2e4f6a8b0c2d4e6f8",
                  "content_type": "application/json",
                  "deliver_at": "2026-10-09T18:22:01Z",
                  "expires_at": "2026-10-12T18:22:01Z",
                  "retained_until": "2026-11-08T18:22:01Z",
                  "content_available": true,
                  "delivery_counts": {
                    "scheduled": 0,
                    "queued": 1,
                    "in_flight": 0,
                    "retry_wait": 0,
                    "succeeded": 0,
                    "failed": 0,
                    "expired": 0,
                    "canceled": 0
                  },
                  "price": {
                    "ingest_units": 1,
                    "delivery_units": 1,
                    "total_usd": "0.00006",
                    "rate_version": "2026-10-08"
                  },
                  "redacted": false,
                  "redaction_status": null,
                  "redacted_at": null,
                  "metadata": {},
                  "created_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "402": {
            "description": "No payment card is on the account (`billing_required`), or the charge would exceed the paying key's monthly spending limit (`spending_limit`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "spending_limit",
                    "message": "This work would exceed the paying API key's monthly spending limit. Raise the limit on the API keys page, or wait until the next billing month starts at 00:00 UTC."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The endpoint doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The endpoint doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The endpoint is paused or disabled (`invalid_state`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "The endpoint is paused. Enable it before you send a test message."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The payload or a header is invalid, or a field is unknown (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`payload` isn't valid JSON."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many admissions: 100 a second by default, bursts of twice that (`rate_limited`), or the team's pending deliveries or stored content is at its limit (`queue_full`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "queue_full",
                    "message": "Your team has 100000 deliveries waiting, and its limit is 100000. Retry later."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "operationId": "createMessage",
        "tags": [
          "Messages"
        ],
        "summary": "Send a message",
        "description": "Accepts a message for one tenant and fans it out to the tenant's matching `enabled` and `paused` endpoints (at most 100, with at most 8 MiB of transformed bodies in all). Which endpoints receive it, and the bytes each one gets, are fixed now; endpoints created later receive nothing. `payload` is delivered as the exact bytes you sent, with insignificant whitespace removed: key order and number spellings stay. Admission is atomic: a transform failure or a limit rejects the whole message.\n\nPricing: `webhooks.ingest_64k` is $0.00001 for each 64 KiB of the body, at least 1 unit, charged even with no matching endpoint; `webhooks.delivery_16k` is $0.00005 for each 16 KiB of each endpoint's body, at least 1 unit. Up to 9 attempts are included; retries are free. Nothing is refunded once accepted.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "description": "An active tenant.",
                    "pattern": "^wdt_"
                  },
                  "event_type": {
                    "type": "string",
                    "description": "An active event type of your catalog. Otherwise `422 invalid_event_type`."
                  },
                  "payload": {
                    "description": "Any JSON, `null` included. Exactly one of `payload` and `body_base64`. At most 1 MiB."
                  },
                  "body_base64": {
                    "type": "string",
                    "description": "Raw bytes in standard padded Base64, at most 1 MiB decoded. Needs `content_type`."
                  },
                  "content_type": {
                    "type": "string",
                    "description": "`application/json` (the default for `payload`, and the only type allowed with it), `text/plain`, `application/octet-stream`, or `application/x-www-form-urlencoded`. Textual types may add `; charset=utf-8`."
                  },
                  "endpoint_ids": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "minItems": 1,
                    "maxItems": 100,
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    },
                    "description": "Restricts delivery to these endpoints of the tenant; filters still apply. A disabled, deleted, or foreign endpoint rejects the request. `null` (the default) selects every matching endpoint."
                  },
                  "external_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128,
                    "pattern": "^[A-Za-z0-9_.:-]+$",
                    "description": "Your ID for the message. Not deduplicated."
                  },
                  "deliver_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "When to deliver: now by default, at most 7 days ahead."
                  },
                  "expires_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "No attempt starts at or after it. After `deliver_at` and at most 72 hours later, which is the default."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  }
                },
                "required": [
                  "tenant_id",
                  "event_type"
                ],
                "additionalProperties": false
              },
              "example": {
                "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                "event_type": "invoice.paid",
                "payload": {
                  "invoice_id": "inv_42",
                  "amount": "49.00"
                },
                "external_id": "invoice-paid-42",
                "metadata": {
                  "order": "42"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The accepted message with its price. Delivery happens afterwards; its failures appear on the deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                },
                "example": {
                  "id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "event_type": "invoice.paid",
                  "external_id": "invoice-paid-42",
                  "origin": "api",
                  "source_id": null,
                  "status": "queued",
                  "body_bytes": 41,
                  "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                  "content_type": "application/json",
                  "deliver_at": "2026-10-09T18:22:01Z",
                  "expires_at": "2026-10-12T18:22:01Z",
                  "retained_until": "2026-11-08T18:22:01Z",
                  "content_available": true,
                  "delivery_counts": {
                    "scheduled": 0,
                    "queued": 2,
                    "in_flight": 0,
                    "retry_wait": 0,
                    "succeeded": 0,
                    "failed": 0,
                    "expired": 0,
                    "canceled": 0
                  },
                  "price": {
                    "ingest_units": 1,
                    "delivery_units": 2,
                    "total_usd": "0.00011",
                    "rate_version": "2026-10-08"
                  },
                  "redacted": false,
                  "redaction_status": null,
                  "redacted_at": null,
                  "metadata": {
                    "order": "42"
                  },
                  "created_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "402": {
            "description": "No payment card is on the account (`billing_required`), or the charge would exceed the paying key's monthly spending limit (`spending_limit`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "spending_limit",
                    "message": "This work would exceed the paying API key's monthly spending limit. Raise the limit on the API keys page, or wait until the next billing month starts at 00:00 UTC."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_conflict",
                    "message": "This Idempotency-Key was used for a different request. Use a new key for a new operation."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body, the payload, or the decoded `body_base64` is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The payload must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The event type isn't active (`invalid_event_type`); an endpoint's transform failed (`transform_failed`, with `resource_id`); or a field is invalid, the message matches more than 100 endpoints or 8 MiB, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_event_type",
                    "message": "The event type invoice.payed isn't an active type of your catalog. Create it with POST /webhooks/event_types first.",
                    "field": "event_type"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many admissions: 100 a second by default, bursts of twice that (`rate_limited`), or the team's pending deliveries or stored content is at its limit (`queue_full`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't store the message, or the tenant's configuration kept changing (`temporarily_unavailable`). Retry with the same key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't store the message. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listMessages",
        "tags": [
          "Messages"
        ],
        "summary": "List messages",
        "description": "Lists messages created in a window of at most 30 days, oldest first, without their bodies. The `status` filter applies within each page, so a page may have fewer items than `limit` while `next_cursor` is set.",
        "parameters": [
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Inclusive RFC 3339 time. By default, 30 days before `created_before`. Lists messages created in a window of at most 30 days.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Exclusive RFC 3339 time, after `created_after` and at most 30 days later. By default, now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-09T00:00:00Z"
          },
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "description": "Only this tenant's messages.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "description": "Only messages of this type.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source_id",
            "in": "query",
            "required": false,
            "description": "Only messages that this source captured.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only messages with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "scheduled",
                "queued",
                "delivering",
                "succeeded",
                "partially_failed",
                "failed",
                "canceled",
                "no_destinations"
              ]
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "description": "Only messages with this external ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of messages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                      "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                      "event_type": "invoice.paid",
                      "external_id": "invoice-paid-42",
                      "origin": "api",
                      "source_id": null,
                      "status": "queued",
                      "body_bytes": 41,
                      "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                      "content_type": "application/json",
                      "deliver_at": "2026-10-09T18:22:01Z",
                      "expires_at": "2026-10-12T18:22:01Z",
                      "retained_until": "2026-11-08T18:22:01Z",
                      "content_available": true,
                      "delivery_counts": {
                        "scheduled": 0,
                        "queued": 2,
                        "in_flight": 0,
                        "retry_wait": 0,
                        "succeeded": 0,
                        "failed": 0,
                        "expired": 0,
                        "canceled": 0
                      },
                      "price": {
                        "ingest_units": 1,
                        "delivery_units": 2,
                        "total_usd": "0.00011",
                        "rate_version": "2026-10-08"
                      },
                      "redacted": false,
                      "redaction_status": null,
                      "redacted_at": null,
                      "metadata": {
                        "order": "42"
                      },
                      "created_at": "2026-10-09T18:22:01Z"
                    }
                  ],
                  "next_cursor": "eyJ2IjoxLCJzIjoiOGYzYSIsImEiOiIxNzkxNTY5NzIxMDAwMDAwIDQyIn0.Zm9vYmFyYmF6"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A filter or time is invalid, the window is longer than 30 days (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`created_before` must be at most 30 days after created_after."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}": {
      "get": {
        "operationId": "getMessage",
        "tags": [
          "Messages"
        ],
        "summary": "Get a message",
        "description": "Returns a message's metadata, status, counts, and price.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The message's ID, `wdm_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdm_2xCvBn6mQwE9rTyUi4OpAs"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The message.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                },
                "example": {
                  "id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "event_type": "invoice.paid",
                  "external_id": "invoice-paid-42",
                  "origin": "api",
                  "source_id": null,
                  "status": "queued",
                  "body_bytes": 41,
                  "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                  "content_type": "application/json",
                  "deliver_at": "2026-10-09T18:22:01Z",
                  "expires_at": "2026-10-12T18:22:01Z",
                  "retained_until": "2026-11-08T18:22:01Z",
                  "content_available": true,
                  "delivery_counts": {
                    "scheduled": 0,
                    "queued": 2,
                    "in_flight": 0,
                    "retry_wait": 0,
                    "succeeded": 0,
                    "failed": 0,
                    "expired": 0,
                    "canceled": 0
                  },
                  "price": {
                    "ingest_units": 1,
                    "delivery_units": 2,
                    "total_usd": "0.00011",
                    "rate_version": "2026-10-08"
                  },
                  "redacted": false,
                  "redaction_status": null,
                  "redacted_at": null,
                  "metadata": {
                    "order": "42"
                  },
                  "created_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The message doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The message doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}/content": {
      "get": {
        "operationId": "getMessageContent",
        "tags": [
          "Messages"
        ],
        "summary": "Get a message's body",
        "description": "Returns the original accepted bytes with their content type, until the message is redacted or passes `retained_until`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The message's ID, `wdm_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdm_2xCvBn6mQwE9rTyUi4OpAs"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The body, with the message's `Content-Type`.",
            "headers": {
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {},
                "example": {
                  "invoice_id": "inv_42",
                  "amount": "49.00"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-www-form-urlencoded": {
                "schema": {
                  "type": "string"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The message doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The message doesn't exist."
                  }
                }
              }
            }
          },
          "410": {
            "description": "The body was redacted or passed its retention (`payload_expired`). The metadata stays.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "payload_expired",
                    "message": "The message's content passed its retention and is gone. Its metadata stays."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't read the body (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't read the content. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}/cancel": {
      "post": {
        "operationId": "cancelMessage",
        "tags": [
          "Messages"
        ],
        "summary": "Cancel a message",
        "description": "Cancels the message's original deliveries that no attempt has claimed. Attempts in flight finish, but their retries are canceled. Replays aren't affected. Repeating it has no new effect. Nothing is refunded.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The message's ID, `wdm_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdm_2xCvBn6mQwE9rTyUi4OpAs"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "What the cancellation did.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCancel"
                },
                "example": {
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "canceled_count": 1,
                  "in_flight_count": 1,
                  "already_terminal_count": 0
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The message doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The message doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_conflict",
                    "message": "This Idempotency-Key was used for a different request. Use a new key for a new operation."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The body has a field, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Idempotency-Key` is required for this request."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}/redact": {
      "post": {
        "operationId": "redactMessage",
        "tags": [
          "Messages"
        ],
        "summary": "Redact a message",
        "description": "Erases the message's body and every transformed copy irreversibly, and cancels all its pending deliveries, replays included. Reads and replays of the content stop at once; the stored bytes go within 24 hours, and the message's `redaction_status` becomes `complete`. Metadata and charges stay.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The message's ID, `wdm_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdm_2xCvBn6mQwE9rTyUi4OpAs"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "202": {
            "description": "Redaction started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageRedaction"
                },
                "example": {
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "status": "redacting",
                  "redacted_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The message doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The message doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_conflict",
                    "message": "This Idempotency-Key was used for a different request. Use a new key for a new operation."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The body has a field, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Idempotency-Key` is required for this request."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/previews": {
      "post": {
        "operationId": "previewEndpoint",
        "tags": [
          "Messages"
        ],
        "summary": "Preview an endpoint",
        "description": "Shows whether an endpoint's current filter matches a body and what its transform makes of it. Nothing is stored, sent, or charged, and no `Idempotency-Key` is needed. It doesn't check event types or the endpoint's status.",
        "parameters": [
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint_id": {
                    "type": "string",
                    "description": "An endpoint of your team that isn't deleted.",
                    "pattern": "^wde_"
                  },
                  "payload": {
                    "description": "Any JSON. Exactly one of `payload` and `body_base64`."
                  },
                  "body_base64": {
                    "type": "string",
                    "description": "Raw bytes in standard padded Base64. Needs `content_type`."
                  },
                  "content_type": {
                    "type": "string",
                    "description": "As for `POST /messages`."
                  }
                },
                "required": [
                  "endpoint_id"
                ],
                "additionalProperties": false
              },
              "example": {
                "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                "payload": {
                  "invoice_id": "inv_42",
                  "amount": "49.00",
                  "internal": true
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preview"
                },
                "example": {
                  "matches": true,
                  "body_base64": "eyJhbW91bnQiOiI0OS4wMCIsImludm9pY2VfaWQiOiJpbnZfNDIifQ==",
                  "content_type": "application/json",
                  "body_bytes": 40,
                  "delivery_units": 1,
                  "transform_version": "2",
                  "errors": []
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`endpoint_id` isn't an endpoint of your team, or the payload is invalid (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`endpoint_id` must be the ID of an endpoint of your team."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries": {
      "get": {
        "operationId": "listDeliveries",
        "tags": [
          "Deliveries"
        ],
        "summary": "List deliveries",
        "description": "Lists deliveries created in a window of at most 30 days, oldest first. With `message_id`, the window is ignored. `status=failed` and `status=expired` list the dead letters.",
        "parameters": [
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Inclusive RFC 3339 time. By default, 30 days before `created_before`. Lists deliveries created in a window of at most 30 days.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Exclusive RFC 3339 time, after `created_after` and at most 30 days later. By default, now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-09T00:00:00Z"
          },
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "description": "Only this tenant's deliveries.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "endpoint_id",
            "in": "query",
            "required": false,
            "description": "Only this endpoint's deliveries.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message_id",
            "in": "query",
            "required": false,
            "description": "Only this message's deliveries, every generation.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only deliveries with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "scheduled",
                "queued",
                "in_flight",
                "retry_wait",
                "succeeded",
                "failed",
                "expired",
                "canceled"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                      "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                      "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                      "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                      "generation": 0,
                      "replay_of": null,
                      "replay_id": null,
                      "transform_version": "1",
                      "configuration": "original",
                      "status": "failed",
                      "blocked_reason": null,
                      "attempt_count": 9,
                      "next_attempt_at": null,
                      "expires_at": "2026-10-12T18:22:01Z",
                      "completed_at": "2026-10-12T11:40:09Z",
                      "reason": "http_500",
                      "body_bytes": 41,
                      "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                      "content_type": "application/json",
                      "rate_version": "2026-10-08",
                      "delivery_units": 1,
                      "price_usd": "0.00005",
                      "cancel_requested": false,
                      "created_at": "2026-10-09T18:22:01Z",
                      "updated_at": "2026-10-12T11:40:09Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A filter or time is invalid or names another team's resource, the window is longer than 30 days (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`status` must be scheduled, queued, in_flight, retry_wait, succeeded, failed, expired, or canceled."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{id}": {
      "get": {
        "operationId": "getDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Get a delivery",
        "description": "Returns a delivery.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The delivery's ID, `wdd_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdd_5gHjKl8ZxCv3BnMq7WeRtY"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "example": {
                  "id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "generation": 0,
                  "replay_of": null,
                  "replay_id": null,
                  "transform_version": "1",
                  "configuration": "original",
                  "status": "retry_wait",
                  "blocked_reason": null,
                  "attempt_count": 2,
                  "next_attempt_at": "2026-10-09T18:28:16Z",
                  "expires_at": "2026-10-12T18:22:01Z",
                  "completed_at": null,
                  "reason": null,
                  "body_bytes": 41,
                  "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                  "content_type": "application/json",
                  "rate_version": "2026-10-08",
                  "delivery_units": 1,
                  "price_usd": "0.00005",
                  "cancel_requested": false,
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:23:16Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The delivery doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The delivery doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{id}/content": {
      "get": {
        "operationId": "getDeliveryContent",
        "tags": [
          "Deliveries"
        ],
        "summary": "Get a delivery's body",
        "description": "Returns the exact outbound bytes of the delivery, with its content type: the message's bytes, or its transformed bytes.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The delivery's ID, `wdd_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdd_5gHjKl8ZxCv3BnMq7WeRtY"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The body, with the delivery's `Content-Type`.",
            "headers": {
              "Content-Type": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {},
                "example": {
                  "invoice_id": "inv_42",
                  "amount": "49.00"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/x-www-form-urlencoded": {
                "schema": {
                  "type": "string"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The delivery doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The delivery doesn't exist."
                  }
                }
              }
            }
          },
          "410": {
            "description": "The message was redacted or its body passed its retention (`payload_expired`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "payload_expired",
                    "message": "The message was redacted. Its content is gone."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't read the body (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't read the content. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{id}/attempts": {
      "get": {
        "operationId": "listDeliveryAttempts",
        "tags": [
          "Deliveries"
        ],
        "summary": "List a delivery's attempts",
        "description": "Lists the delivery's attempts, at most 9, in order. There is one page: `next_cursor` is always `null`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The delivery's ID, `wdd_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdd_5gHjKl8ZxCv3BnMq7WeRtY"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The attempts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttemptList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wda_1qAzWs4XeDc7RfVtGb9YhN",
                      "delivery_id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                      "number": 2,
                      "claim_generation": 2,
                      "started_at": "2026-10-09T18:23:16Z",
                      "finished_at": "2026-10-09T18:23:16Z",
                      "duration_ms": 412,
                      "http_status": 503,
                      "result": "retryable",
                      "error_code": null,
                      "response_headers": {
                        "content-type": "text/plain",
                        "retry-after": "60"
                      },
                      "response_body_base64": null,
                      "response_truncated": false,
                      "signature_timestamp": 1791569996,
                      "destination_host": "hooks.acme.example",
                      "endpoint_version": "1",
                      "url_revision": "1",
                      "probe": false
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The delivery doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The delivery doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/attempts/{id}": {
      "get": {
        "operationId": "getAttempt",
        "tags": [
          "Deliveries"
        ],
        "summary": "Get an attempt",
        "description": "Returns an attempt with its timing and the stored part of the response.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The attempt's ID, `wda_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wda_1qAzWs4XeDc7RfVtGb9YhN"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The attempt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attempt"
                },
                "example": {
                  "id": "wda_1qAzWs4XeDc7RfVtGb9YhN",
                  "delivery_id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                  "number": 2,
                  "claim_generation": 2,
                  "started_at": "2026-10-09T18:23:16Z",
                  "finished_at": "2026-10-09T18:23:16Z",
                  "duration_ms": 412,
                  "http_status": 503,
                  "result": "retryable",
                  "error_code": null,
                  "response_headers": {
                    "content-type": "text/plain",
                    "retry-after": "60"
                  },
                  "response_body_base64": null,
                  "response_truncated": false,
                  "signature_timestamp": 1791569996,
                  "destination_host": "hooks.acme.example",
                  "endpoint_version": "1",
                  "url_revision": "1",
                  "probe": false
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The attempt doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The attempt doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{id}/cancel": {
      "post": {
        "operationId": "cancelDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Cancel a delivery",
        "description": "Stops further attempts. A waiting delivery becomes `canceled`; one in flight finishes, and `in_flight` is `true` because only its retries are stopped. Canceling a canceled delivery changes nothing. Nothing is refunded.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The delivery's ID, `wdd_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdd_5gHjKl8ZxCv3BnMq7WeRtY"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery, with `in_flight`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CanceledDelivery"
                },
                "example": {
                  "id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "generation": 0,
                  "replay_of": null,
                  "replay_id": null,
                  "transform_version": "1",
                  "configuration": "original",
                  "status": "canceled",
                  "blocked_reason": null,
                  "attempt_count": 2,
                  "next_attempt_at": null,
                  "expires_at": "2026-10-12T18:22:01Z",
                  "completed_at": "2026-10-09T18:24:30Z",
                  "reason": "canceled",
                  "body_bytes": 41,
                  "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                  "content_type": "application/json",
                  "rate_version": "2026-10-08",
                  "delivery_units": 1,
                  "price_usd": "0.00005",
                  "cancel_requested": true,
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:24:30Z",
                  "in_flight": false
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The delivery doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The delivery doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The delivery already succeeded, failed, or expired (`invalid_state`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "The delivery is already succeeded. Only waiting deliveries can be canceled."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The body has a field, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Idempotency-Key` is required for this request."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{id}/replay": {
      "post": {
        "operationId": "replayDelivery",
        "tags": [
          "Deliveries"
        ],
        "summary": "Replay a delivery",
        "description": "Creates a new generation of a finished delivery, with the same message ID (`webhook-id`) and a new delivery ID, sent to the endpoint's current URL with its current credentials and a new 72-hour deadline. `original` resends the frozen bytes; `current` applies the endpoint's current transform to the message and skips its filter. The endpoint must be enabled or paused, and the body retained and not redacted.\n\nPricing: a replay is a new paid delivery generation, $0.00005 for each 16 KiB of its body, at least 1 unit; no new ingestion. Its retries are free.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The delivery's ID, `wdd_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdd_5gHjKl8ZxCv3BnMq7WeRtY"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "configuration": {
                    "type": "string",
                    "description": "`original` (the default) or `current`.",
                    "enum": [
                      "original",
                      "current"
                    ]
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "configuration": "original"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The new delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "example": {
                  "id": "wdd_7uIoPa2SdF5gHjKl9ZxCvB",
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "generation": 1,
                  "replay_of": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                  "replay_id": null,
                  "transform_version": "1",
                  "configuration": "original",
                  "status": "queued",
                  "blocked_reason": null,
                  "attempt_count": 0,
                  "next_attempt_at": "2026-10-13T09:00:00Z",
                  "expires_at": "2026-10-16T09:00:00Z",
                  "completed_at": null,
                  "reason": null,
                  "body_bytes": 41,
                  "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                  "content_type": "application/json",
                  "rate_version": "2026-10-08",
                  "delivery_units": 1,
                  "price_usd": "0.00005",
                  "cancel_requested": false,
                  "created_at": "2026-10-13T09:00:00Z",
                  "updated_at": "2026-10-13T09:00:00Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "402": {
            "description": "No payment card is on the account (`billing_required`), or the charge would exceed the paying key's monthly spending limit (`spending_limit`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "spending_limit",
                    "message": "This work would exceed the paying API key's monthly spending limit. Raise the limit on the API keys page, or wait until the next billing month starts at 00:00 UTC."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The delivery doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The delivery doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The delivery hasn't finished, or its tenant is deleted or its endpoint disabled or deleted (`invalid_state`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "The delivery is retry_wait. Only a finished delivery can be replayed."
                  }
                }
              }
            }
          },
          "410": {
            "description": "The message was redacted or its body passed its retention (`payload_expired`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "payload_expired",
                    "message": "The message's content passed its retention."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The current transform failed (`transform_failed`), or a field is invalid (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "transform_failed",
                    "message": "The endpoint's current transform failed: /customer/id is required."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many admissions (`rate_limited`), or the team's pending deliveries or stored content is at its limit (`queue_full`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "queue_full",
                    "message": "Your team has too many deliveries waiting. Retry later."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/deliveries/{id}/retry_now": {
      "post": {
        "operationId": "retryDeliveryNow",
        "tags": [
          "Deliveries"
        ],
        "summary": "Retry a delivery now",
        "description": "Makes a delivery that waits to retry due now, within its existing attempts. A receiver's `Retry-After` for the same URL still holds, and pacing, concurrency, and an open circuit still apply. It creates no generation and no charge, and resets neither attempts nor the deadline. A finished delivery needs a paid replay instead.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The delivery's ID, `wdd_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdd_5gHjKl8ZxCv3BnMq7WeRtY"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "The delivery, with its effective `next_attempt_at` and `blocked_reason`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Delivery"
                },
                "example": {
                  "id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "generation": 0,
                  "replay_of": null,
                  "replay_id": null,
                  "transform_version": "1",
                  "configuration": "original",
                  "status": "retry_wait",
                  "blocked_reason": null,
                  "attempt_count": 2,
                  "next_attempt_at": "2026-10-09T18:24:30Z",
                  "expires_at": "2026-10-12T18:22:01Z",
                  "completed_at": null,
                  "reason": null,
                  "body_bytes": 41,
                  "body_sha256": "3f0a2b9c8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a",
                  "content_type": "application/json",
                  "rate_version": "2026-10-08",
                  "delivery_units": 1,
                  "price_usd": "0.00005",
                  "cancel_requested": false,
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:24:30Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The delivery doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The delivery doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The delivery isn't `retry_wait` (`delivery_not_retryable`), or something blocks it (`retry_blocked`, with `reason`): a deleted tenant, a paused or disabled endpoint, an unavailable payload, a canceled message, no attempts left, expiry, or a suspended account. Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "retry_blocked",
                    "message": "Motor can't retry this delivery now: endpoint_paused.",
                    "reason": "endpoint_paused"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The body has a field, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Idempotency-Key` is required for this request."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/replays": {
      "post": {
        "operationId": "createReplay",
        "tags": [
          "Replays"
        ],
        "summary": "Replay deliveries in bulk",
        "description": "Selects, for one endpoint, the newest generation of each message created in a window of at most 30 days whose status is in `statuses`, and replays them in batches as new paid generations (`original` bytes or the `current` transform captured now). Each batch is charged when it's created ($0.00005 per 16 KiB unit, at least 1 per delivery); the job stops as `failed` if the next batch would exceed your spending limit (`spending_limit`) or `max_cost_usd` (`cost_ceiling_exceeded`), or after 24 hours. An empty selection completes at once and costs nothing. At most 10 active replays by default.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint_id": {
                    "type": "string",
                    "description": "An endpoint of your team that isn't deleted or disabled.",
                    "pattern": "^wde_"
                  },
                  "created_after": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Inclusive; by message creation time."
                  },
                  "created_before": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Exclusive; at most 30 days after `created_after`."
                  },
                  "statuses": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 4,
                    "items": {
                      "type": "string",
                      "enum": [
                        "failed",
                        "expired",
                        "succeeded",
                        "canceled"
                      ]
                    },
                    "description": "`[\"failed\", \"expired\"]` by default."
                  },
                  "configuration": {
                    "type": "string",
                    "description": "`original` (the default) or `current`.",
                    "enum": [
                      "original",
                      "current"
                    ]
                  },
                  "max_deliveries": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10000,
                    "description": "1,000 by default. A larger selection is refused."
                  },
                  "max_cost_usd": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^[0-9]{1,7}(\\.[0-9]{0,12})?$",
                    "description": "A ceiling on the job's total charge, as a decimal string of dollars. `null` (the default) for none."
                  }
                },
                "required": [
                  "endpoint_id",
                  "created_after",
                  "created_before"
                ],
                "additionalProperties": false
              },
              "example": {
                "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                "created_after": "2026-10-01T00:00:00Z",
                "created_before": "2026-10-09T00:00:00Z",
                "max_cost_usd": "5.00"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The replay, with `selected_count`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Replay"
                },
                "example": {
                  "id": "wdr_3eDcRf6VtGb8YhNuJm2IkO",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "created_after": "2026-10-01T00:00:00Z",
                  "created_before": "2026-10-09T00:00:00Z",
                  "statuses": [
                    "failed",
                    "expired"
                  ],
                  "configuration": "original",
                  "transform_version": "1",
                  "max_deliveries": 1000,
                  "max_cost_usd": "5.00",
                  "status": "queued",
                  "reason": null,
                  "selected_count": 312,
                  "created_count": 0,
                  "skipped_count": 0,
                  "pending_count": 312,
                  "charged_usd": "0.00",
                  "rate_version": "2026-10-08",
                  "deadline": "2026-10-10T18:22:01Z",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z",
                  "completed_at": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "402": {
            "description": "No payment card is on the account (`billing_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "billing_required",
                    "message": "Add a payment card on the billing page before sending webhooks."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The endpoint is disabled (`invalid_state`), or the team has its maximum of active replays (`quota_exceeded`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "quota_exceeded",
                    "message": "Your team has reached its limit of 10 active replays. Delete some, or contact support@motor.dev to raise the limit."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is missing or invalid, the window is longer than 30 days, more deliveries match than `max_deliveries`, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "The window has 1412 matching deliveries, more than max_deliveries (1000). Narrow the window or raise max_deliveries, up to 10000.",
                    "field": "max_deliveries"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listReplays",
        "tags": [
          "Replays"
        ],
        "summary": "List replays",
        "description": "Lists replays submitted in a window of at most 30 days, oldest first.",
        "parameters": [
          {
            "name": "created_after",
            "in": "query",
            "required": false,
            "description": "Inclusive RFC 3339 time. By default, 30 days before `created_before`. Lists replays created in a window of at most 30 days.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-01T00:00:00Z"
          },
          {
            "name": "created_before",
            "in": "query",
            "required": false,
            "description": "Exclusive RFC 3339 time, after `created_after` and at most 30 days later. By default, now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "example": "2026-10-09T00:00:00Z"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of replays.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wdr_3eDcRf6VtGb8YhNuJm2IkO",
                      "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                      "created_after": "2026-10-01T00:00:00Z",
                      "created_before": "2026-10-09T00:00:00Z",
                      "statuses": [
                        "failed",
                        "expired"
                      ],
                      "configuration": "original",
                      "transform_version": "1",
                      "max_deliveries": 1000,
                      "max_cost_usd": "5.00",
                      "status": "queued",
                      "reason": null,
                      "selected_count": 312,
                      "created_count": 0,
                      "skipped_count": 0,
                      "pending_count": 312,
                      "charged_usd": "0.00",
                      "rate_version": "2026-10-08",
                      "deadline": "2026-10-10T18:22:01Z",
                      "created_at": "2026-10-09T18:22:01Z",
                      "updated_at": "2026-10-09T18:22:01Z",
                      "completed_at": null
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A time is invalid, the window is longer than 30 days (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`created_after` must be before created_before."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/replays/{id}": {
      "get": {
        "operationId": "getReplay",
        "tags": [
          "Replays"
        ],
        "summary": "Get a replay",
        "description": "Returns a replay with its counts and charge so far.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The replay's ID, `wdr_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdr_3eDcRf6VtGb8YhNuJm2IkO"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Replay"
                },
                "example": {
                  "id": "wdr_3eDcRf6VtGb8YhNuJm2IkO",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "created_after": "2026-10-01T00:00:00Z",
                  "created_before": "2026-10-09T00:00:00Z",
                  "statuses": [
                    "failed",
                    "expired"
                  ],
                  "configuration": "original",
                  "transform_version": "1",
                  "max_deliveries": 1000,
                  "max_cost_usd": "5.00",
                  "status": "queued",
                  "reason": null,
                  "selected_count": 312,
                  "created_count": 0,
                  "skipped_count": 0,
                  "pending_count": 312,
                  "charged_usd": "0.00",
                  "rate_version": "2026-10-08",
                  "deadline": "2026-10-10T18:22:01Z",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z",
                  "completed_at": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The replay doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The replay doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/replays/{id}/items": {
      "get": {
        "operationId": "listReplayItems",
        "tags": [
          "Replays"
        ],
        "summary": "List a replay's items",
        "description": "Lists the result for each selected delivery, in selection order. Items not reached yet are `pending`, or `skipped` with the stop reason once the replay stopped.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The replay's ID, `wdr_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdr_3eDcRf6VtGb8YhNuJm2IkO"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayItemList"
                },
                "example": {
                  "data": [
                    {
                      "number": 0,
                      "original_delivery_id": "wdd_5gHjKl8ZxCv3BnMq7WeRtY",
                      "delivery_id": "wdd_7uIoPa2SdF5gHjKl9ZxCvB",
                      "status": "created",
                      "reason": null,
                      "price_usd": "0.00005"
                    }
                  ],
                  "next_cursor": "eyJ2IjoxLCJzIjoiOGYzYSIsImEiOiIxNzkxNTY5NzIxMDAwMDAwIDQyIn0.Zm9vYmFyYmF6"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The replay doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The replay doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`limit` is invalid (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_cursor",
                    "message": "The cursor isn't valid for this list. Use next_cursor from the previous response.",
                    "field": "cursor"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/replays/{id}/cancel": {
      "post": {
        "operationId": "cancelReplay",
        "tags": [
          "Replays"
        ],
        "summary": "Cancel a replay",
        "description": "Stops creating deliveries. Deliveries already created stay, and so do their charges; the remaining items become `skipped`. Canceling a finished replay changes nothing.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The replay's ID, `wdr_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wdr_3eDcRf6VtGb8YhNuJm2IkO"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "The replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Replay"
                },
                "example": {
                  "id": "wdr_3eDcRf6VtGb8YhNuJm2IkO",
                  "endpoint_id": "wde_6mNbVc8xZaS2dFgH4jKlQw",
                  "created_after": "2026-10-01T00:00:00Z",
                  "created_before": "2026-10-09T00:00:00Z",
                  "statuses": [
                    "failed",
                    "expired"
                  ],
                  "configuration": "original",
                  "transform_version": "1",
                  "max_deliveries": 1000,
                  "max_cost_usd": "5.00",
                  "status": "canceled",
                  "reason": "canceled",
                  "selected_count": 312,
                  "created_count": 200,
                  "skipped_count": 112,
                  "pending_count": 0,
                  "charged_usd": "0.01",
                  "rate_version": "2026-10-08",
                  "deadline": "2026-10-10T18:22:01Z",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:30:00Z",
                  "completed_at": "2026-10-09T18:30:00Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The replay doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The replay doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "idempotency_conflict",
                    "message": "This Idempotency-Key was used for a different request. Use a new key for a new operation."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The body has a field, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Idempotency-Key` is required for this request."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/sources": {
      "post": {
        "operationId": "createSource",
        "tags": [
          "Sources"
        ],
        "summary": "Create a source",
        "description": "Creates a verified receive URL for another provider's webhooks, and returns `receive_url` once. Each verified request becomes a message of the source's tenant, priced like `POST /messages` and paid by `billing_key_id`. Stripe signs test and live events with different secrets: create one source for each. At most 1,000 sources by default.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenant_id": {
                    "type": "string",
                    "description": "An active tenant. Immutable.",
                    "pattern": "^wdt_"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "verification": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "description": "The verifier: `standard_webhooks` (`secret` is `whsec_` and Base64 of 24 to 64 bytes), `stripe`, `github`, `shopify`, `slack`, `twilio` (`secret` is 16 to 256 bytes as the provider issued it, used literally), `bearer` (`secret` is the exact `Authorization: Bearer` value, 32 to 256 bytes) or `hmac` (a template below). Immutable.",
                        "enum": [
                          "standard_webhooks",
                          "stripe",
                          "github",
                          "hmac",
                          "shopify",
                          "slack",
                          "twilio",
                          "bearer"
                        ]
                      },
                      "secret": {
                        "type": "string",
                        "description": "The verification secret. Write-only: Motor never shows it."
                      },
                      "secret_base64": {
                        "type": "string",
                        "description": "`hmac` only, instead of `secret`: standard Base64 of 16 to 64 key bytes."
                      },
                      "algorithm": {
                        "type": "string",
                        "description": "`hmac` only: `sha256` (default) or `sha1` for providers that still need it.",
                        "enum": [
                          "sha256",
                          "sha1"
                        ]
                      },
                      "header": {
                        "type": "string",
                        "description": "`hmac` only, required: the signature header, at most 64 bytes."
                      },
                      "encoding": {
                        "type": "string",
                        "description": "`hmac` only: `hex` (default) or `base64`.",
                        "enum": [
                          "hex",
                          "base64"
                        ]
                      },
                      "prefix": {
                        "type": "string",
                        "description": "`hmac` only: text before the signature, such as `sha256=`; at most 32 bytes.",
                        "maxLength": 32
                      },
                      "signed_content": {
                        "type": "array",
                        "minItems": 1,
                        "maxItems": 8,
                        "items": {
                          "$ref": "#/components/schemas/SignedPart"
                        },
                        "description": "`hmac` only: the parts signed, concatenated. `[\"body\"]` by default; `body` exactly once."
                      },
                      "timestamp_header": {
                        "type": "string",
                        "description": "`hmac` only: a Unix-seconds header that must also be in `signed_content`, checked for freshness."
                      },
                      "tolerance_seconds": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 900,
                        "description": "`hmac` only, with `timestamp_header`: 300 by default."
                      }
                    },
                    "required": [
                      "kind"
                    ],
                    "additionalProperties": false,
                    "description": "Only `kind` and `secret` for every kind but `hmac`."
                  },
                  "event_type": {
                    "type": "string",
                    "description": "An active event type: the type of every message, or the fallback check when `event_type_path` is set."
                  },
                  "status": {
                    "type": "string",
                    "description": "`enabled` (the default) or `paused`.",
                    "enum": [
                      "enabled",
                      "paused"
                    ]
                  },
                  "event_type_path": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "A JSON Pointer, such as `/type`, whose string (after `event_type_prefix`) must be an active type; or `$github_event` / `$shopify_topic`. `null` by default."
                  },
                  "event_type_prefix": {
                    "type": "string",
                    "description": "Text before the mapped type, such as `stripe.`; at most 64 bytes.",
                    "maxLength": 64
                  },
                  "dedup_header": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "`hmac` and `bearer` only: a header whose value deduplicates requests for 35 days. Not an authentication, signature, Host, or Content-Length header."
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  },
                  "billing_key_id": {
                    "type": "string",
                    "description": "An active secret key of your team that may use webhooks; the creating key by default.",
                    "pattern": "^key_"
                  }
                },
                "required": [
                  "tenant_id",
                  "name",
                  "verification",
                  "event_type"
                ],
                "additionalProperties": false
              },
              "example": {
                "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                "name": "Stripe live",
                "verification": {
                  "kind": "stripe",
                  "secret": "whsec_test_51NcQz7T"
                },
                "event_type": "stripe.event",
                "event_type_path": "/type",
                "event_type_prefix": "stripe."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The source, with `receive_url`. An idempotent replay shows it only to the key that created it, while that token is current.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                },
                "example": {
                  "id": "wds_8kJhGf3dSa7QwErTy5UiOp",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Stripe live",
                  "verification": {
                    "kind": "stripe",
                    "secret_hint": "Qz7T",
                    "secret_version": 1,
                    "old_secret_expires_at": null
                  },
                  "receive_path": "/webhooks/receive/…x9Qz",
                  "token_version": 1,
                  "status": "enabled",
                  "event_type": "stripe.event",
                  "event_type_path": "/type",
                  "event_type_prefix": "stripe.",
                  "dedup_header": null,
                  "billing_key_id": "key_BWBeN28Vb7cMEx7Ym8AUzs",
                  "metadata": {},
                  "counters": {
                    "accepted": 0,
                    "duplicates": 0,
                    "rejected": 0
                  },
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z",
                  "receive_url": "https://api.motor.dev/webhooks/receive/Jx2kq8V0rW5nTq3mZbLs0aYc1dHf7gPe4uKiO6x9Qz"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The path of the new resource.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The team is at its source limit (`quota_exceeded`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "quota_exceeded",
                    "message": "Your team has reached its limit of 1000 sources. Delete some, or contact support@motor.dev to raise the limit."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is missing, invalid, or unknown, the event type isn't active, the secret doesn't fit the kind, or `Idempotency-Key` is missing (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`verification.secret` must be from 16 to 256 UTF-8 bytes."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSources",
        "tags": [
          "Sources"
        ],
        "summary": "List sources",
        "description": "Lists sources that aren't deleted, oldest first.",
        "parameters": [
          {
            "name": "tenant_id",
            "in": "query",
            "required": false,
            "description": "Only this tenant's sources.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only sources with this status.",
            "schema": {
              "type": "string",
              "enum": [
                "enabled",
                "paused"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "From 1 to 200; 50 by default.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`next_cursor` from the previous page. It's bound to your team, this list and its filters; another is `422 invalid_cursor`. Results are oldest first; records changed between pages may move or disappear.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of sources.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceList"
                },
                "example": {
                  "data": [
                    {
                      "id": "wds_2wSxEdC4rFvTgB6yHnUjM8",
                      "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                      "name": "Shopify-style HMAC",
                      "verification": {
                        "kind": "hmac",
                        "algorithm": "sha256",
                        "header": "x-acme-signature",
                        "encoding": "hex",
                        "prefix": "sha256=",
                        "signed_content": [
                          {
                            "header": "x-acme-timestamp"
                          },
                          {
                            "literal": "."
                          },
                          "body"
                        ],
                        "timestamp_header": "x-acme-timestamp",
                        "tolerance_seconds": 300,
                        "secret_hint": "",
                        "secret_version": 1,
                        "old_secret_expires_at": null
                      },
                      "receive_path": "/webhooks/receive/…x9Qz",
                      "token_version": 1,
                      "status": "enabled",
                      "event_type": "acme.order",
                      "event_type_path": null,
                      "event_type_prefix": "",
                      "dedup_header": "x-acme-delivery",
                      "billing_key_id": "key_BWBeN28Vb7cMEx7Ym8AUzs",
                      "metadata": {},
                      "counters": {
                        "accepted": 0,
                        "duplicates": 0,
                        "rejected": 0
                      },
                      "version": "1",
                      "created_at": "2026-10-09T18:22:01Z",
                      "updated_at": "2026-10-09T18:22:01Z"
                    }
                  ],
                  "next_cursor": null
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A filter is invalid (`invalid_field`), or the cursor isn't for this list (`invalid_cursor`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`status` must be enabled or paused."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/sources/{id}": {
      "get": {
        "operationId": "getSource",
        "tags": [
          "Sources"
        ],
        "summary": "Get a source",
        "description": "Returns a source with its `ETag`. Its secret and receive URL are never shown.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The source's ID, `wds_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wds_8kJhGf3dSa7QwErTy5UiOp"
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                },
                "example": {
                  "id": "wds_8kJhGf3dSa7QwErTy5UiOp",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Stripe live",
                  "verification": {
                    "kind": "stripe",
                    "secret_hint": "Qz7T",
                    "secret_version": 1,
                    "old_secret_expires_at": null
                  },
                  "receive_path": "/webhooks/receive/…x9Qz",
                  "token_version": 1,
                  "status": "enabled",
                  "event_type": "stripe.event",
                  "event_type_path": "/type",
                  "event_type_prefix": "stripe.",
                  "dedup_header": null,
                  "billing_key_id": "key_BWBeN28Vb7cMEx7Ym8AUzs",
                  "metadata": {},
                  "counters": {
                    "accepted": 0,
                    "duplicates": 0,
                    "rejected": 0
                  },
                  "version": "1",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:01Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The source doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The source doesn't exist."
                  }
                }
              }
            }
          },
          "422": {
            "description": " Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`Motor-Mode` must be live or test."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many reads: 100 a second, bursts of 200 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateSource",
        "tags": [
          "Sources"
        ],
        "summary": "Update a source",
        "description": "Changes the name, status, event type mapping, deduplication header, billing key, or metadata. The tenant and the verifier can't change: rotate the secret with `rotate_secret`, or create a new source.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The source's ID, `wds_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wds_8kJhGf3dSa7QwErTy5UiOp"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the source from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "status": {
                    "type": "string",
                    "description": "`enabled` or `paused`.",
                    "enum": [
                      "enabled",
                      "paused"
                    ]
                  },
                  "event_type": {
                    "type": "string",
                    "description": "An active event type."
                  },
                  "event_type_path": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "event_type_prefix": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "dedup_header": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "metadata": {
                    "$ref": "#/components/schemas/Metadata"
                  },
                  "billing_key_id": {
                    "type": "string",
                    "pattern": "^key_"
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "status": "paused"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                },
                "example": {
                  "id": "wds_8kJhGf3dSa7QwErTy5UiOp",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Stripe live",
                  "verification": {
                    "kind": "stripe",
                    "secret_hint": "Qz7T",
                    "secret_version": 1,
                    "old_secret_expires_at": null
                  },
                  "receive_path": "/webhooks/receive/…x9Qz",
                  "token_version": 1,
                  "status": "paused",
                  "event_type": "stripe.event",
                  "event_type_path": "/type",
                  "event_type_prefix": "stripe.",
                  "dedup_header": null,
                  "billing_key_id": "key_BWBeN28Vb7cMEx7Ym8AUzs",
                  "metadata": {},
                  "counters": {
                    "accepted": 0,
                    "duplicates": 0,
                    "rejected": 0
                  },
                  "version": "2",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The source doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The source doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field is invalid or unknown, or `If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`billing_key_id` must be the ID of an active API key of your team that may use webhooks."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSource",
        "tags": [
          "Sources"
        ],
        "summary": "Delete a source",
        "description": "Deletes the source: its receive URLs and secrets stop working at once. Accepted messages stay with their tenant and follow normal retention.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The source's ID, `wds_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wds_8kJhGf3dSa7QwErTy5UiOp"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the source from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The source doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The source doesn't exist."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "422": {
            "description": "`If-Match` is malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`If-Match` must be one strong ETag in quotes."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/sources/{id}/rotate_token": {
      "post": {
        "operationId": "rotateSourceToken",
        "tags": [
          "Sources"
        ],
        "summary": "Rotate the receive URL",
        "description": "Makes a new receive URL and returns it once. The old URL keeps working for `overlap_seconds` (86,400 by default); `0` retires it at once. Another nonzero rotation during an overlap is `409`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The source's ID, `wds_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wds_8kJhGf3dSa7QwErTy5UiOp"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the source from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "overlap_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 86400,
                    "default": 86400
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "overlap_seconds": 86400
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The source, with the new `receive_url`. An idempotent replay shows it only to the key that rotated it, while it's current.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                },
                "example": {
                  "id": "wds_8kJhGf3dSa7QwErTy5UiOp",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Stripe live",
                  "verification": {
                    "kind": "stripe",
                    "secret_hint": "Qz7T",
                    "secret_version": 1,
                    "old_secret_expires_at": null
                  },
                  "receive_path": "/webhooks/receive/…Lm3P",
                  "token_version": 2,
                  "status": "enabled",
                  "event_type": "stripe.event",
                  "event_type_path": "/type",
                  "event_type_prefix": "stripe.",
                  "dedup_header": null,
                  "billing_key_id": "key_BWBeN28Vb7cMEx7Ym8AUzs",
                  "metadata": {},
                  "counters": {
                    "accepted": 0,
                    "duplicates": 0,
                    "rejected": 0
                  },
                  "version": "2",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z",
                  "receive_url": "https://api.motor.dev/webhooks/receive/aB4cD6eF8gH0iJ2kL4mN6oP8qR0sT2uV4wX6yZ8Lm3P"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The source doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The source doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The previous URL is still in its overlap and `overlap_seconds` isn't 0 (`invalid_state`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "The previous receive URL is still in its overlap. Wait for it to end, or rotate with overlap_seconds: 0."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "`overlap_seconds` is invalid, a field is unknown, or a header is missing or malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`overlap_seconds` must be from 0 to 86400."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/sources/{id}/rotate_secret": {
      "post": {
        "operationId": "rotateSourceSecret",
        "tags": [
          "Sources"
        ],
        "summary": "Rotate the verification secret",
        "description": "Replaces the secret with one of the same kind (`secret`, or `secret_base64` for an `hmac` source). The old one also verifies for `overlap_seconds` (86,400 by default); `0` retires it at once. Motor never shows a secret back.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The source's ID, `wds_...`. Another team's ID is `404`.",
            "schema": {
              "type": "string"
            },
            "example": "wds_8kJhGf3dSa7QwErTy5UiOp"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "1 to 128 printable ASCII characters that you choose for this operation. A retry with the same key and the same request (compared semantically, after defaults) returns the first response with `Idempotency-Replayed: true` for 35 days; a different request with the key is `409 idempotency_conflict`, and a retry while the first is running is `409 request_in_progress` with `Retry-After: 1`. A failed validation doesn't use the key. A missing key is `422 invalid_field`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "example": "7c1f3a9e-2b4d-4e8f-9a6c-1d2e3f4a5b6c"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "description": "The `ETag` of the source from your last read, in quotes, such as `\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\"`. Missing is `428 precondition_required`; stale is `412 revision_conflict` (the response carries the current `ETag`); malformed is `422 invalid_field`.",
            "schema": {
              "type": "string"
            },
            "example": "\"wd:wde_6mNbVc8xZaS2dFgH4jKlQw:3\""
          },
          {
            "name": "Motor-Mode",
            "in": "header",
            "required": false,
            "description": "Webhooks are live-only. Omit this header or send `live`. `test` gives `422 unsupported_mode` and any other value `422 invalid_field`, before anything else happens. Test against a real receiver with `POST /endpoints/{id}/test`, or use a separate tenant whose endpoints point at your staging receivers.",
            "schema": {
              "type": "string",
              "enum": [
                "live"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "secret": {
                    "type": "string",
                    "description": "The new secret, with the same rules as at creation."
                  },
                  "secret_base64": {
                    "type": "string",
                    "description": "`hmac` only, instead of `secret`."
                  },
                  "overlap_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 86400,
                    "default": 86400
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "secret": "whsec_live_7cTqWm2R2d9",
                "overlap_seconds": 86400
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Source"
                },
                "example": {
                  "id": "wds_8kJhGf3dSa7QwErTy5UiOp",
                  "tenant_id": "wdt_4fRm8NqZ2kLpVx7cJs9hYb",
                  "name": "Stripe live",
                  "verification": {
                    "kind": "stripe",
                    "secret_hint": "R2d9",
                    "secret_version": 2,
                    "old_secret_expires_at": "2026-10-10T18:22:03Z"
                  },
                  "receive_path": "/webhooks/receive/…x9Qz",
                  "token_version": 1,
                  "status": "enabled",
                  "event_type": "stripe.event",
                  "event_type_path": "/type",
                  "event_type_prefix": "stripe.",
                  "dedup_header": null,
                  "billing_key_id": "key_BWBeN28Vb7cMEx7Ym8AUzs",
                  "metadata": {},
                  "counters": {
                    "accepted": 0,
                    "duplicates": 0,
                    "rejected": 0
                  },
                  "version": "2",
                  "created_at": "2026-10-09T18:22:01Z",
                  "updated_at": "2026-10-09T18:22:03Z"
                }
              }
            },
            "headers": {
              "Request-Id": {
                "description": "Motor's ID of the request, for support.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "The configuration version, `\"wd:<id>:<version>\"`, for `If-Match`.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotency-Replayed": {
                "description": "`true` when this is the recorded response of an earlier request with the same `Idempotency-Key`.",
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The body isn't valid JSON, isn't an object, or has a duplicate key (`invalid_json`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The request body isn't valid JSON. Duplicate key \"name\" at byte 31."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The key is missing, invalid, revoked, publishable, or not allowed to use webhooks (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key is invalid or has been revoked."
                  }
                }
              }
            }
          },
          "403": {
            "description": "The team's account, or its use of webhooks, is suspended (`account_suspended`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "account_suspended",
                    "message": "This team's Motor account is suspended. Contact support@motor.dev for help."
                  }
                }
              }
            }
          },
          "404": {
            "description": "The source doesn't exist, or belongs to another team (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "The source doesn't exist."
                  }
                }
              }
            }
          },
          "409": {
            "description": "The previous secret is still in its overlap and `overlap_seconds` isn't 0 (`invalid_state`). Also `idempotency_conflict` for a different request with the same `Idempotency-Key`, and `request_in_progress` while it's running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "The previous secret is still in its overlap. Wait for it to end, or rotate with overlap_seconds: 0."
                  }
                }
              }
            }
          },
          "412": {
            "description": "`If-Match` is stale (`revision_conflict`). The response's `ETag` is current: read the resource again and retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "revision_conflict",
                    "message": "The resource changed since you read it. Read it again and retry with its new ETag.",
                    "resource_id": "wde_6mNbVc8xZaS2dFgH4jKlQw"
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body isn't `application/json` (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Send the request body as application/json."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The secret doesn't fit the source's kind, a field is invalid or unknown, or a header is missing or malformed (`invalid_field`). Also `unsupported_mode` / `invalid_field` for `Motor-Mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_field",
                    "message": "`secret` must be from 16 to 256 UTF-8 bytes."
                  }
                }
              }
            }
          },
          "428": {
            "description": "`If-Match` is missing (`precondition_required`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "precondition_required",
                    "message": "Send the ETag of the resource in the If-Match header. Read the resource to get its current ETag."
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many configuration writes: 20 a second, bursts of 40 (`rate_limited`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "Motor couldn't complete the request, such as sealing a secret or closing a billing month (`temporarily_unavailable`). Retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "Motor couldn't protect a secret. Retry in a few seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        }
      }
    },
    "/receive/{token}": {
      "post": {
        "operationId": "receiveWebhook",
        "tags": [
          "Receive"
        ],
        "summary": "Receive a provider's webhook",
        "description": "The public URL that you give a provider. It needs no Motor key: the token selects the source, and the provider's signature (or bearer token) authenticates the request, checked against the exact raw bytes before anything else. A verified, new request becomes a message of the source's tenant, charged to the source's billing key like `POST /messages` ($0.00001 per 64 KiB ingested, at least 1 unit, even with no matching endpoint, plus $0.00005 per 16 KiB per endpoint delivery), and Motor answers only after it's stored. A duplicate (the same provider ID and bytes, or the same body within 24 hours for providers without signed IDs) gets `200` without a new message or charge. Failed requests are neither kept nor charged.\n\nAcknowledgments: `202 {\"message_id\", \"duplicate\": false}` for a new request and `200 {\"message_id\", \"duplicate\": true}` for a duplicate; Slack gets `200` with an empty body, or `200 {\"challenge\"}` for a signed `url_verification` (admitted as a paid ingestion-only `motor.source_verification` message); Twilio gets `200` `application/xml` `<Response/>`. Motor never passes a receiver's response back. Requests are limited to 50 a second per source, bursts of 100, and 20 failed verifications a second per IP address.",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The source's secret receive token, from `receive_url`. An unknown, retired, or deleted token is `404`.",
            "schema": {
              "type": "string",
              "maxLength": 64
            },
            "example": "Jx2kq8V0rW5nTq3mZbLs0aYc1dHf7gPe4uKiO6x9Qz"
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": false,
            "description": "`standard_webhooks`: with `webhook-id` and `webhook-timestamp` (within 300 seconds).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Stripe-Signature",
            "in": "header",
            "required": false,
            "description": "`stripe`: `t=...,v1=...`, within 300 seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Hub-Signature-256",
            "in": "header",
            "required": false,
            "description": "`github`: with `X-GitHub-Delivery` and `X-GitHub-Event`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Shopify-Hmac-SHA256",
            "in": "header",
            "required": false,
            "description": "`shopify`: with `X-Shopify-Webhook-Id`.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Slack-Signature",
            "in": "header",
            "required": false,
            "description": "`slack`: with `X-Slack-Request-Timestamp`, within 300 seconds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Twilio-Signature",
            "in": "header",
            "required": false,
            "description": "`twilio`: over the URL as called and the form fields, or a `bodySHA256` query parameter for JSON.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "description": "`bearer`: `Bearer <secret>`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "description": "The provider's raw body, at most 1 MiB, uncompressed. It's forwarded exactly.",
          "content": {
            "application/json": {
              "schema": {},
              "example": {
                "id": "evt_1Q2w3E4r",
                "type": "invoice.paid",
                "livemode": true,
                "data": {
                  "object": {
                    "id": "in_1Q2w"
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "string"
              },
              "example": "MessageSid=SM1f2e3d&From=%2B14155550123&Body=Hello"
            },
            "text/plain": {
              "schema": {
                "type": "string"
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A duplicate (`duplicate: true`, no new charge); or any accepted Slack request (an empty body, or `{\"challenge\"}` for URL verification); or any accepted Twilio request (`<Response/>`).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ReceiveAck"
                    },
                    {
                      "$ref": "#/components/schemas/SlackChallenge"
                    }
                  ]
                },
                "example": {
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "duplicate": true
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string"
                },
                "example": "<Response/>"
              }
            }
          },
          "202": {
            "description": "Accepted, stored, fanned out, and charged. Delivery happens afterwards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReceiveAck"
                },
                "example": {
                  "message_id": "wdm_2xCvBn6mQwE9rTyUi4OpAs",
                  "duplicate": false
                }
              }
            }
          },
          "400": {
            "description": "The JSON body is malformed (`invalid_json`), a form body is malformed (`invalid_form`), or the request has two `Content-Type` headers (`invalid_request`). Only after verification, except the header check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_json",
                    "message": "The body isn't valid JSON."
                  }
                }
              }
            }
          },
          "401": {
            "description": "The signature, timestamp, or bearer secret is missing, duplicated, malformed, stale, or wrong (`invalid_signature`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_signature",
                    "message": "The request has no Stripe-Signature header."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The account has no payment card or the source's billing key is revoked (`billing_required`), or the charge would exceed the billing key's spending limit (`spending_limit`). The provider should retry; Motor records a `webhooks.budget.blocked` event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "spending_limit",
                    "message": "This work would exceed the paying API key's monthly spending limit. Raise the limit on the API keys page, or wait until the next billing month starts at 00:00 UTC."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No source has this token, or its tenant is deleted (`not_found`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "No source has this receive URL."
                  }
                }
              }
            }
          },
          "409": {
            "description": "A request with the same provider ID and different bytes was already accepted (`invalid_state`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_state",
                    "message": "A request with this event ID and different bytes was already accepted."
                  }
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 1 MiB (`body_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "body_too_large",
                    "message": "The request body must be at most 1048576 bytes."
                  }
                }
              }
            }
          },
          "415": {
            "description": "The body is compressed, or its type isn't JSON, form, text, or octet-stream (Twilio: form or JSON only) (`unsupported_media_type`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unsupported_media_type",
                    "message": "Sources don't accept compressed bodies. Send them without Content-Encoding."
                  }
                }
              }
            }
          },
          "422": {
            "description": "The event type that the request maps to isn't active (`invalid_event_type`), or a provider field is missing, such as Stripe's `id`, `type`, and `livemode` or GitHub's delivery ID (`invalid_field`). Register the type, then let the provider retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid_event_type",
                    "message": "The event type stripe.charge.refunded isn't an active type of your catalog. Create it with POST /webhooks/event_types first.",
                    "field": "event_type"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for the source, too many failed verifications from the address, or too many admissions for the team (`rate_limited`); or the team's pending deliveries or stored content is at its limit (`queue_full`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many requests. Retry after 1 seconds."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          },
          "503": {
            "description": "The source is paused, the account can't accept webhooks now, or Motor couldn't store the request (`temporarily_unavailable`). The provider should retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "temporarily_unavailable",
                    "message": "The source is paused. Retry later."
                  }
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            }
          }
        },
        "security": []
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A secret API key from the API keys page, such as `motor_sk_...`, allowed to use webhooks."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable, machine-readable code, such as `invalid_field` or `revision_conflict`."
              },
              "message": {
                "type": "string",
                "description": "What went wrong and what to do, for people. It may change."
              },
              "field": {
                "type": "string",
                "description": "The JSON path or parameter at fault, when there is one."
              },
              "resource_id": {
                "type": "string",
                "description": "The ID of the resource involved, such as a conflicting tenant."
              },
              "reason": {
                "type": "string",
                "description": "Why `retry_now` is blocked: `tenant_deleted`, `endpoint_paused`, `endpoint_disabled`, `payload_unavailable`, `message_canceled`, `deleted`, `attempts_exhausted`, `expired`, or `account_suspended`."
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "description": "Every error. `field`, `resource_id`, and `reason` appear only when they apply."
      },
      "Metadata": {
        "type": "object",
        "maxProperties": 20,
        "propertyNames": {
          "minLength": 1,
          "maxLength": 64
        },
        "additionalProperties": {
          "type": "string",
          "maxLength": 512
        },
        "description": "Up to 20 string pairs: keys of 1 to 64 bytes, values of at most 512 bytes. Motor stores them and never interprets them."
      },
      "Tenant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The tenant's ID, `wdt_...`.",
            "pattern": "^wdt_"
          },
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$",
            "description": "Your ID for this customer. Unique in your team, immutable, and reserved for 90 days after deletion."
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "A name of 1 to 128 UTF-8 bytes."
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "status": {
            "type": "string",
            "description": "`active`, or `deleted` once deleted. Deletion can't be undone.",
            "enum": [
              "active",
              "deleted"
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The configuration version, in the `ETag` `\"wd:<id>:<version>\"`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "external_id",
          "name",
          "metadata",
          "status",
          "version",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "One of your own customers. Its endpoints, sources, and messages belong to it."
      },
      "EventType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event type's ID, `wdy_...`.",
            "pattern": "^wdy_"
          },
          "name": {
            "type": "string",
            "description": "Lowercase dot-separated words, such as `invoice.paid`. Immutable. `webhooks.*` and `motor.*` are reserved.",
            "maxLength": 128,
            "pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$"
          },
          "description": {
            "type": "string",
            "description": "At most 4,096 UTF-8 bytes.",
            "maxLength": 4096
          },
          "example": {
            "description": "An example payload: any JSON of at most 16 KiB, or `null`."
          },
          "archived": {
            "type": "boolean",
            "description": "Whether the type is archived. Messages of an archived type are refused; retained ones stay readable and replayable."
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The configuration version, in the `ETag`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "example",
          "archived",
          "version",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "A type of event in your catalog. `POST /messages` needs an active type."
      },
      "Condition": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "description": "An RFC 6901 JSON Pointer into the original body, such as `/data/amount`. Array indexes are nonnegative integers."
          },
          "op": {
            "type": "string",
            "description": "`eq`, `ne`, and `in` compare scalars without coercion (numbers compare as exact decimals). `exists` takes a boolean. `gt`, `gte`, `lt`, and `lte` compare finite numbers. `prefix` compares strings, case-sensitively. A missing value matches only `exists: false`.",
            "enum": [
              "eq",
              "ne",
              "in",
              "exists",
              "gt",
              "gte",
              "lt",
              "lte",
              "prefix"
            ]
          },
          "value": {
            "description": "A scalar; an array of at most 50 scalars for `in`; a boolean for `exists`."
          }
        },
        "required": [
          "path",
          "op"
        ],
        "additionalProperties": false,
        "description": "A condition on the message's JSON body."
      },
      "Filter": {
        "description": "Which messages an endpoint receives, beyond its event types: `{\"all\": [...]}`, `{\"any\": [...]}`, `{\"not\": filter}`, or a condition. At most 5 levels, 50 conditions, and 16 KiB. An empty `all` matches; an empty `any` doesn't. Only JSON bodies can match a filter.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "all": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Filter"
                }
              }
            },
            "required": [
              "all"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "any": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Filter"
                }
              }
            },
            "required": [
              "any"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "not": {
                "$ref": "#/components/schemas/Filter"
              }
            },
            "required": [
              "not"
            ],
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/Condition"
          }
        ]
      },
      "Transform": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The top-level output name, 1 to 128 bytes, unique.",
                  "minLength": 1,
                  "maxLength": 128
                },
                "from": {
                  "type": "string",
                  "description": "A JSON Pointer into the original body. The value's exact bytes are copied."
                },
                "value": {
                  "description": "A literal JSON value of at most 16 KiB, sent as written."
                },
                "required": {
                  "type": "boolean",
                  "description": "Whether a missing `from` value fails the message (`422 transform_failed`) instead of omitting the field. `false` by default."
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false,
              "description": "Exactly one of `from` or `value`."
            }
          }
        },
        "required": [
          "fields"
        ],
        "additionalProperties": false,
        "description": "Builds a new JSON object from the original body, with its names sorted. No code runs. Only JSON bodies can be transformed; the result is `application/json`."
      },
      "Health": {
        "type": "object",
        "properties": {
          "circuit": {
            "type": "string",
            "description": "`closed`; `open` while sending waits; `half_open` while one probe may go.",
            "enum": [
              "closed",
              "open",
              "half_open"
            ]
          },
          "consecutive_failures": {
            "type": "integer",
            "description": "Failures since the last success.",
            "minimum": 0
          },
          "last_success_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_failure_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_probe_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When an open circuit lets a probe go."
          }
        },
        "required": [
          "circuit",
          "consecutive_failures",
          "last_success_at",
          "last_failure_at",
          "next_probe_at"
        ],
        "additionalProperties": false,
        "description": "The endpoint's delivery health. Changes to it don't change `version`."
      },
      "Endpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The endpoint's ID, `wde_...`.",
            "pattern": "^wde_"
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant. Immutable.",
            "pattern": "^wdt_"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "`Webhook` by default."
          },
          "description": {
            "type": "string",
            "description": "At most 4,096 bytes.",
            "maxLength": 4096
          },
          "url": {
            "type": "string",
            "description": "The HTTPS URL that receives deliveries, with its query. Only secret keys see it.",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string"
            },
            "description": "Event type patterns: a name, `prefix.*`, or `*`."
          },
          "filter": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Filter"
              },
              {
                "type": "null"
              }
            ]
          },
          "transform": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Transform"
              },
              {
                "type": "null"
              }
            ]
          },
          "transform_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The version of the filter and transform. Each change makes a new one."
          },
          "status": {
            "type": "string",
            "description": "`enabled` and `paused` you set. Motor sets `disabled` after a `410` from the receiver or an unsafe destination; `/resume` enables it.",
            "enum": [
              "enabled",
              "paused",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why Motor disabled it, such as `endpoint_gone`."
          },
          "rate_per_second": {
            "type": "integer",
            "description": "Attempts per second, 1 to 1,000.",
            "minimum": 1,
            "maximum": 1000
          },
          "max_concurrency": {
            "type": "integer",
            "description": "3 by default (or your team's cap, if lower), and at most 3: Motor runs at most 3 attempts of a team at once. 1 with a rate of 1 sends one at a time, though retries and replays can still reorder.",
            "minimum": 1,
            "maximum": 3
          },
          "retry_delays_seconds": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 86400
            },
            "description": "The delays before each retry. At most 8, adding up to at most 259,200 seconds; at most 9 attempts in all."
          },
          "timeout_seconds": {
            "type": "integer",
            "description": "The request timeout, 1 to 30 seconds.",
            "minimum": 1,
            "maximum": 30
          },
          "headers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The names of your custom headers, lowercased. Their values are write-only."
          },
          "has_authorization": {
            "type": "boolean",
            "description": "Whether an `Authorization` value is set. It's write-only."
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "secret_version": {
            "type": "integer",
            "description": "The version of the signing secret.",
            "minimum": 1
          },
          "old_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Until when deliveries also carry a signature with the previous secret."
          },
          "health": {
            "$ref": "#/components/schemas/Health"
          },
          "queued_count": {
            "type": "integer",
            "description": "Deliveries waiting to be sent. Eventually consistent.",
            "minimum": 0
          },
          "url_revision": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "One more for each change of the URL. Attempts record it."
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The configuration version, in the `ETag`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "signing_secret": {
            "type": "string",
            "description": "`whsec_` and standard Base64 of 32 random bytes. Only in the responses of create and `rotate_secret`, and in their idempotent replays to the key that made the request. Store it: Motor never shows it again.",
            "pattern": "^whsec_"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "description",
          "url",
          "events",
          "filter",
          "transform",
          "transform_version",
          "status",
          "disabled_reason",
          "rate_per_second",
          "max_concurrency",
          "retry_delays_seconds",
          "timeout_seconds",
          "headers",
          "has_authorization",
          "metadata",
          "secret_version",
          "old_secret_expires_at",
          "health",
          "queued_count",
          "url_revision",
          "version",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "A receiver of a tenant's messages."
      },
      "DeliveryCounts": {
        "type": "object",
        "properties": {
          "scheduled": {
            "type": "integer",
            "minimum": 0
          },
          "queued": {
            "type": "integer",
            "minimum": 0
          },
          "in_flight": {
            "type": "integer",
            "minimum": 0
          },
          "retry_wait": {
            "type": "integer",
            "minimum": 0
          },
          "succeeded": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "expired": {
            "type": "integer",
            "minimum": 0
          },
          "canceled": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "scheduled",
          "queued",
          "in_flight",
          "retry_wait",
          "succeeded",
          "failed",
          "expired",
          "canceled"
        ],
        "additionalProperties": false,
        "description": "The original (generation 0) deliveries by status. Replays aren't counted."
      },
      "Price": {
        "type": "object",
        "properties": {
          "ingest_units": {
            "type": "integer",
            "description": "`webhooks.ingest_64k` units: one for each 64 KiB of the body, at least one.",
            "minimum": 1
          },
          "delivery_units": {
            "type": "integer",
            "description": "`webhooks.delivery_16k` units: one for each 16 KiB of each delivery's body, at least one per delivery.",
            "minimum": 0
          },
          "total_usd": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]{2,12}$",
            "description": "The charge at admission, in USD."
          },
          "rate_version": {
            "type": "string",
            "description": "The rates that priced it."
          }
        },
        "required": [
          "ingest_units",
          "delivery_units",
          "total_usd",
          "rate_version"
        ],
        "additionalProperties": false,
        "description": "What admission charged. Automatic retries are free; nothing is refunded."
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The message's ID, `wdm_...`. It's the `webhook-id` of every delivery of it.",
            "pattern": "^wdm_"
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant.",
            "pattern": "^wdt_"
          },
          "event_type": {
            "type": "string",
            "description": "The event type, such as `invoice.paid`; `motor.test` for endpoint tests; `motor.source_verification` for Slack URL verifications."
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9_.:-]+$",
            "description": "Your ID for the message. Indexed, but not deduplicated: `Idempotency-Key` does that."
          },
          "origin": {
            "type": "string",
            "description": "`api` for `POST /messages`, `source` for captures, `test` for endpoint tests.",
            "enum": [
              "api",
              "source",
              "test"
            ]
          },
          "source_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^wds_",
            "description": "The source that captured it."
          },
          "status": {
            "type": "string",
            "description": "From the original deliveries: `no_destinations` without any, `delivering` while one is in flight, `scheduled` or `queued` while some wait, then `succeeded`, `partially_failed`, `canceled`, or `failed`.",
            "enum": [
              "scheduled",
              "queued",
              "delivering",
              "succeeded",
              "partially_failed",
              "failed",
              "canceled",
              "no_destinations"
            ]
          },
          "body_bytes": {
            "type": "integer",
            "description": "The size of the accepted body.",
            "minimum": 0
          },
          "body_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "The hex SHA-256 of the accepted body."
          },
          "content_type": {
            "type": "string",
            "description": "The body's content type."
          },
          "deliver_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "No delivery starts at or after it."
          },
          "retained_until": {
            "type": "string",
            "format": "date-time",
            "description": "When the body is erased."
          },
          "content_available": {
            "type": "boolean",
            "description": "Whether `/content` can return the body."
          },
          "delivery_counts": {
            "$ref": "#/components/schemas/DeliveryCounts"
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "redacted": {
            "type": "boolean",
            "description": "Whether the message was redacted."
          },
          "redaction_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "redacting",
              "complete",
              null
            ],
            "description": "`redacting` until its bytes are gone, then `complete`."
          },
          "redacted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "event_type",
          "external_id",
          "origin",
          "source_id",
          "status",
          "body_bytes",
          "body_sha256",
          "content_type",
          "deliver_at",
          "expires_at",
          "retained_until",
          "content_available",
          "delivery_counts",
          "price",
          "redacted",
          "redaction_status",
          "redacted_at",
          "metadata",
          "created_at"
        ],
        "additionalProperties": false,
        "description": "An accepted message: immutable bytes, an event type, and one tenant. Lists never include the body."
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery's ID, `wdd_...`. It's the `Motor-Delivery-Id` header.",
            "pattern": "^wdd_"
          },
          "message_id": {
            "type": "string",
            "description": "The message.",
            "pattern": "^wdm_"
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant.",
            "pattern": "^wdt_"
          },
          "endpoint_id": {
            "type": "string",
            "description": "The endpoint.",
            "pattern": "^wde_"
          },
          "generation": {
            "type": "integer",
            "description": "0 for the original; one more for each replay to the endpoint.",
            "minimum": 0
          },
          "replay_of": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^wdd_",
            "description": "The delivery that this one replays."
          },
          "replay_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^wdr_",
            "description": "The bulk replay that created it."
          },
          "transform_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The endpoint transform version that made the bytes."
          },
          "configuration": {
            "type": "string",
            "description": "`original` bytes, or the `current` transform of a replay.",
            "enum": [
              "original",
              "current"
            ]
          },
          "status": {
            "type": "string",
            "description": "`failed` and `expired` deliveries are the dead letters.",
            "enum": [
              "scheduled",
              "queued",
              "in_flight",
              "retry_wait",
              "succeeded",
              "failed",
              "expired",
              "canceled"
            ]
          },
          "blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a waiting delivery can't go yet, such as `endpoint_paused` or `circuit_open`."
          },
          "attempt_count": {
            "type": "integer",
            "description": "Attempts so far, at most 9.",
            "minimum": 0,
            "maximum": 9
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a waiting delivery is due; `null` once in flight or finished."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed, expired, or was canceled."
          },
          "body_bytes": {
            "type": "integer",
            "description": "The size of the outbound body.",
            "minimum": 0
          },
          "body_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "content_type": {
            "type": "string"
          },
          "rate_version": {
            "type": "string"
          },
          "delivery_units": {
            "type": "integer",
            "description": "`webhooks.delivery_16k` units of this generation.",
            "minimum": 1
          },
          "price_usd": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]{2,12}$",
            "description": "This generation's delivery charge. Retries add nothing."
          },
          "cancel_requested": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "message_id",
          "tenant_id",
          "endpoint_id",
          "generation",
          "replay_of",
          "replay_id",
          "transform_version",
          "configuration",
          "status",
          "blocked_reason",
          "attempt_count",
          "next_attempt_at",
          "expires_at",
          "completed_at",
          "reason",
          "body_bytes",
          "body_sha256",
          "content_type",
          "rate_version",
          "delivery_units",
          "price_usd",
          "cancel_requested",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "One message to one endpoint in one generation."
      },
      "CanceledDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The delivery's ID, `wdd_...`. It's the `Motor-Delivery-Id` header.",
            "pattern": "^wdd_"
          },
          "message_id": {
            "type": "string",
            "description": "The message.",
            "pattern": "^wdm_"
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant.",
            "pattern": "^wdt_"
          },
          "endpoint_id": {
            "type": "string",
            "description": "The endpoint.",
            "pattern": "^wde_"
          },
          "generation": {
            "type": "integer",
            "description": "0 for the original; one more for each replay to the endpoint.",
            "minimum": 0
          },
          "replay_of": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^wdd_",
            "description": "The delivery that this one replays."
          },
          "replay_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^wdr_",
            "description": "The bulk replay that created it."
          },
          "transform_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The endpoint transform version that made the bytes."
          },
          "configuration": {
            "type": "string",
            "description": "`original` bytes, or the `current` transform of a replay.",
            "enum": [
              "original",
              "current"
            ]
          },
          "status": {
            "type": "string",
            "description": "`failed` and `expired` deliveries are the dead letters.",
            "enum": [
              "scheduled",
              "queued",
              "in_flight",
              "retry_wait",
              "succeeded",
              "failed",
              "expired",
              "canceled"
            ]
          },
          "blocked_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why a waiting delivery can't go yet, such as `endpoint_paused` or `circuit_open`."
          },
          "attempt_count": {
            "type": "integer",
            "description": "Attempts so far, at most 9.",
            "minimum": 0,
            "maximum": 9
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a waiting delivery is due; `null` once in flight or finished."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed, expired, or was canceled."
          },
          "body_bytes": {
            "type": "integer",
            "description": "The size of the outbound body.",
            "minimum": 0
          },
          "body_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "content_type": {
            "type": "string"
          },
          "rate_version": {
            "type": "string"
          },
          "delivery_units": {
            "type": "integer",
            "description": "`webhooks.delivery_16k` units of this generation.",
            "minimum": 1
          },
          "price_usd": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]{2,12}$",
            "description": "This generation's delivery charge. Retries add nothing."
          },
          "cancel_requested": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "in_flight": {
            "type": "boolean",
            "description": "`true` when an attempt was already in flight: it finishes, but no retry follows."
          }
        },
        "required": [
          "id",
          "message_id",
          "tenant_id",
          "endpoint_id",
          "generation",
          "replay_of",
          "replay_id",
          "transform_version",
          "configuration",
          "status",
          "blocked_reason",
          "attempt_count",
          "next_attempt_at",
          "expires_at",
          "completed_at",
          "reason",
          "body_bytes",
          "body_sha256",
          "content_type",
          "rate_version",
          "delivery_units",
          "price_usd",
          "cancel_requested",
          "created_at",
          "updated_at",
          "in_flight"
        ],
        "additionalProperties": false,
        "description": "The delivery after cancellation."
      },
      "Attempt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The attempt's ID, `wda_...`. It's the `Motor-Attempt-Id` header.",
            "pattern": "^wda_"
          },
          "delivery_id": {
            "type": "string",
            "description": "The delivery.",
            "pattern": "^wdd_"
          },
          "number": {
            "type": "integer",
            "description": "1 for the first attempt.",
            "minimum": 1,
            "maximum": 9
          },
          "claim_generation": {
            "type": "integer",
            "description": "The claim that made the attempt. It equals `number`.",
            "minimum": 1
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The receiver's status, or `null` without a response."
          },
          "result": {
            "type": "string",
            "description": "`pending` while in flight; `success` for any 2xx; `retryable`; `permanent`; `unknown` when the worker stopped before recording a result, so the receiver may have it.",
            "enum": [
              "pending",
              "success",
              "retryable",
              "permanent",
              "unknown"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it failed without a useful response, such as a timeout or a refused connection."
          },
          "response_headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Only `content-type`, `retry-after`, and `x-request-id`, at most 2 KiB."
          },
          "response_body_base64": {
            "type": [
              "string",
              "null"
            ],
            "description": "Up to 4 KiB of the response body, when `response_body_logging` is on and within `response_retention_days`."
          },
          "response_truncated": {
            "type": "boolean"
          },
          "signature_timestamp": {
            "type": "integer",
            "description": "The `webhook-timestamp` that the attempt was signed with."
          },
          "destination_host": {
            "type": "string"
          },
          "endpoint_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "url_revision": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "probe": {
            "type": "boolean",
            "description": "Whether it was the probe of a half-open circuit."
          }
        },
        "required": [
          "id",
          "delivery_id",
          "number",
          "claim_generation",
          "started_at",
          "finished_at",
          "duration_ms",
          "http_status",
          "result",
          "error_code",
          "response_headers",
          "response_body_base64",
          "response_truncated",
          "signature_timestamp",
          "destination_host",
          "endpoint_version",
          "url_revision",
          "probe"
        ],
        "additionalProperties": false,
        "description": "One HTTP request of a delivery. Outgoing secrets, signatures, and URL queries are never stored."
      },
      "Replay": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The replay's ID, `wdr_...`.",
            "pattern": "^wdr_"
          },
          "endpoint_id": {
            "type": "string",
            "description": "The endpoint.",
            "pattern": "^wde_"
          },
          "created_after": {
            "type": "string",
            "format": "date-time"
          },
          "created_before": {
            "type": "string",
            "format": "date-time"
          },
          "statuses": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "failed",
                "expired",
                "succeeded",
                "canceled"
              ]
            }
          },
          "configuration": {
            "type": "string",
            "enum": [
              "original",
              "current"
            ]
          },
          "transform_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The transform that `current` uses, captured at submission."
          },
          "max_deliveries": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "max_cost_usd": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]+\\.[0-9]{2,12}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "completed",
              "canceled",
              "failed"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it stopped, such as `canceled`, `spending_limit`, `cost_ceiling_exceeded`, or `deadline`."
          },
          "selected_count": {
            "type": "integer",
            "description": "Deliveries selected at submission.",
            "minimum": 0
          },
          "created_count": {
            "type": "integer",
            "description": "New deliveries created so far.",
            "minimum": 0
          },
          "skipped_count": {
            "type": "integer",
            "description": "Selected deliveries skipped.",
            "minimum": 0
          },
          "pending_count": {
            "type": "integer",
            "description": "Selected deliveries not reached yet.",
            "minimum": 0
          },
          "charged_usd": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]{2,12}$",
            "description": "Charged so far: each batch is charged as it's created."
          },
          "rate_version": {
            "type": "string"
          },
          "deadline": {
            "type": "string",
            "format": "date-time",
            "description": "24 hours after submission. Expansion stops then."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "created_after",
          "created_before",
          "statuses",
          "configuration",
          "transform_version",
          "max_deliveries",
          "max_cost_usd",
          "status",
          "reason",
          "selected_count",
          "created_count",
          "skipped_count",
          "pending_count",
          "charged_usd",
          "rate_version",
          "deadline",
          "created_at",
          "updated_at",
          "completed_at"
        ],
        "additionalProperties": false,
        "description": "A bulk replay of one endpoint's deliveries in a window."
      },
      "ReplayItem": {
        "type": "object",
        "properties": {
          "number": {
            "type": "integer",
            "description": "The item's position, from 0.",
            "minimum": 0
          },
          "original_delivery_id": {
            "type": "string",
            "pattern": "^wdd_"
          },
          "delivery_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^wdd_",
            "description": "The new delivery, once created."
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "created",
              "skipped"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was skipped, such as `transform_failed` or the replay's stop reason."
          },
          "price_usd": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]{2,12}$"
          }
        },
        "required": [
          "number",
          "original_delivery_id",
          "delivery_id",
          "status",
          "reason",
          "price_usd"
        ],
        "additionalProperties": false,
        "description": "The result for one selected delivery."
      },
      "SignedPart": {
        "description": "A part of an `hmac` signature input.",
        "oneOf": [
          {
            "type": "string",
            "enum": [
              "body",
              "url"
            ],
            "description": "The raw body, or this source's receive URL as called."
          },
          {
            "type": "object",
            "properties": {
              "header": {
                "type": "string",
                "description": "A request header name; its value, trimmed."
              }
            },
            "required": [
              "header"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "literal": {
                "type": "string",
                "description": "UTF-8 text of at most 64 bytes.",
                "maxLength": 64
              }
            },
            "required": [
              "literal"
            ],
            "additionalProperties": false
          }
        ]
      },
      "SourceVerification": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "description": "The verifier. Immutable.",
            "enum": [
              "standard_webhooks",
              "stripe",
              "github",
              "hmac",
              "shopify",
              "slack",
              "twilio",
              "bearer"
            ]
          },
          "algorithm": {
            "type": "string",
            "description": "`hmac` only.",
            "enum": [
              "sha256",
              "sha1"
            ]
          },
          "header": {
            "type": "string",
            "description": "`hmac` only: the signature header, lowercased."
          },
          "encoding": {
            "type": "string",
            "description": "`hmac` only.",
            "enum": [
              "hex",
              "base64"
            ]
          },
          "prefix": {
            "type": "string",
            "description": "`hmac` only: the text before the signature, such as `sha256=`."
          },
          "signed_content": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignedPart"
            },
            "description": "`hmac` only."
          },
          "timestamp_header": {
            "type": "string",
            "description": "`hmac` only, when set."
          },
          "tolerance_seconds": {
            "type": "integer",
            "minimum": 1,
            "maximum": 900,
            "description": "`hmac` only, with `timestamp_header`."
          },
          "secret_hint": {
            "type": "string",
            "description": "The last four characters of a secret of at least 12, or empty. Motor never shows a secret."
          },
          "secret_version": {
            "type": "integer",
            "minimum": 1
          },
          "old_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Until when the previous secret also verifies."
          }
        },
        "required": [
          "kind",
          "secret_hint",
          "secret_version",
          "old_secret_expires_at"
        ],
        "additionalProperties": false,
        "description": "The verifier, without its secret. The `hmac` template can't change after creation."
      },
      "Source": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The source's ID, `wds_...`.",
            "pattern": "^wds_"
          },
          "tenant_id": {
            "type": "string",
            "description": "The tenant that every captured message belongs to. Immutable.",
            "pattern": "^wdt_"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "verification": {
            "$ref": "#/components/schemas/SourceVerification"
          },
          "receive_path": {
            "type": "string",
            "description": "The receive path with its token elided, such as `/webhooks/receive/…x9Qz`."
          },
          "token_version": {
            "type": "integer",
            "description": "One more for each `rotate_token`.",
            "minimum": 1
          },
          "status": {
            "type": "string",
            "description": "Paused sources answer `503` so that providers retry.",
            "enum": [
              "enabled",
              "paused"
            ]
          },
          "event_type": {
            "type": "string",
            "description": "The fixed active event type of captured messages."
          },
          "event_type_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "A JSON Pointer such as `/type` whose string, after `event_type_prefix`, names the type; or `$github_event` / `$shopify_topic` for those headers."
          },
          "event_type_prefix": {
            "type": "string",
            "description": "Text before the mapped type, at most 64 bytes.",
            "maxLength": 64
          },
          "dedup_header": {
            "type": [
              "string",
              "null"
            ],
            "description": "`hmac` and `bearer` only: a header whose value deduplicates for 35 days."
          },
          "billing_key_id": {
            "type": "string",
            "description": "The secret key that pays for captures.",
            "pattern": "^key_"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "counters": {
            "type": "object",
            "properties": {
              "accepted": {
                "type": "integer",
                "minimum": 0
              },
              "duplicates": {
                "type": "integer",
                "minimum": 0
              },
              "rejected": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "accepted",
              "duplicates",
              "rejected"
            ],
            "additionalProperties": false
          },
          "version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The configuration version, in the `ETag`."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "receive_url": {
            "type": "string",
            "description": "The full URL to give the provider. Only in the responses of create and `rotate_token`, and in their idempotent replays to the key that made the request. Keep it private.",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "name",
          "verification",
          "receive_path",
          "token_version",
          "status",
          "event_type",
          "event_type_path",
          "event_type_prefix",
          "dedup_header",
          "billing_key_id",
          "metadata",
          "counters",
          "version",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false,
        "description": "Verifies another provider's webhooks at a receive URL and turns them into messages of one tenant."
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's ID, `wdv_...`.",
            "pattern": "^wdv_"
          },
          "type": {
            "type": "string",
            "enum": [
              "webhooks.delivery.failed",
              "webhooks.delivery.expired",
              "webhooks.endpoint.disabled",
              "webhooks.endpoint.recovered",
              "webhooks.source.rejected",
              "webhooks.replay.completed",
              "webhooks.replay.failed",
              "webhooks.budget.blocked"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "mode": {
            "type": "string",
            "const": "live"
          },
          "resource_id": {
            "type": "string",
            "description": "The resource, such as a delivery, endpoint, source, or replay; the first one of a coalesced event."
          },
          "tenant_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "resource_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "data": {
            "type": "object",
            "description": "IDs, reasons, counts, and times. Never payloads or secrets."
          },
          "coalesced": {
            "type": "boolean",
            "description": "Whether the event counts several occurrences of the hour. Source rejections and budget blocks always coalesce by source, reason, and hour; terminal deliveries coalesce by endpoint and hour after 1,000 in an hour."
          },
          "count": {
            "type": "integer",
            "minimum": 1
          },
          "first_id": {
            "type": "string"
          },
          "last_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "mode",
          "resource_id",
          "tenant_id",
          "resource_version",
          "data",
          "coalesced",
          "count",
          "first_id",
          "last_id"
        ],
        "additionalProperties": false,
        "description": "An operational event, kept for 30 days. Motor doesn't send these as webhooks: poll `/events`."
      },
      "Meter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "enum": [
              "webhooks.ingest_64k",
              "webhooks.delivery_16k"
            ]
          },
          "unit": {
            "type": "string"
          },
          "unit_bytes": {
            "type": "integer"
          },
          "unit_price_usd": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]{2,12}$"
          }
        },
        "required": [
          "id",
          "unit",
          "unit_bytes",
          "unit_price_usd"
        ],
        "additionalProperties": false
      },
      "Rates": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "USD"
          },
          "version": {
            "type": "string"
          },
          "effective_at": {
            "type": "string",
            "format": "date-time"
          },
          "meters": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Meter"
            }
          }
        },
        "required": [
          "currency",
          "version",
          "effective_at",
          "meters"
        ],
        "additionalProperties": false,
        "description": "The published rates."
      },
      "Limit": {
        "type": "object",
        "properties": {
          "value": {
            "type": "integer",
            "minimum": 0
          },
          "unit": {
            "type": "string"
          },
          "measured": {
            "type": "boolean",
            "description": "`false` when the value is a ceiling that Motor hasn't yet shown under load. Absent when the limit is enforced as stated."
          }
        },
        "required": [
          "value",
          "unit"
        ],
        "additionalProperties": false
      },
      "Limits": {
        "type": "object",
        "properties": {
          "max_body_bytes": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_fanout_endpoints": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_transformed_bytes_per_message": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_attempts": {
            "$ref": "#/components/schemas/Limit"
          },
          "delivery_window_hours": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_schedule_days": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_endpoints_per_tenant": {
            "$ref": "#/components/schemas/Limit"
          },
          "read_requests_per_second": {
            "$ref": "#/components/schemas/Limit"
          },
          "config_writes_per_second": {
            "$ref": "#/components/schemas/Limit"
          },
          "admission_rate": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Limit"
              }
            ],
            "description": "Message admissions and source captures a second, with `measured: false`: a ceiling that no load test has shown yet. A team can also store at most 4 messages at once, so slow uploads lower it."
          },
          "source_requests_per_second": {
            "$ref": "#/components/schemas/Limit"
          },
          "dispatch_rate": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Limit"
              }
            ],
            "description": "Attempts a second across your endpoints, with `measured: false`: a ceiling that no load test has shown yet, not demonstrated throughput. Concurrency limits attempts first: with `max_concurrency` 3 and receivers that take the full 30-second timeout, a team gets about 0.1 attempts a second."
          },
          "max_concurrency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Limit"
              }
            ],
            "description": "Requests in flight at once across your endpoints: 3. Motor's job worker runs at most 3 attempts of a team at once, so it can't be raised yet."
          },
          "max_endpoint_concurrency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Limit"
              }
            ],
            "description": "The most that an endpoint's `max_concurrency` can be: 3."
          },
          "service_concurrency": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Limit"
              }
            ],
            "description": "Requests in flight at once across all of Motor's teams: 6. A team's attempts wait while it's reached, even below `max_concurrency`."
          },
          "max_tenants": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_event_types": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_endpoints": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_sources": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_pending_deliveries": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_content_bytes": {
            "$ref": "#/components/schemas/Limit"
          },
          "max_active_replays": {
            "$ref": "#/components/schemas/Limit"
          }
        },
        "required": [
          "max_body_bytes",
          "max_fanout_endpoints",
          "max_transformed_bytes_per_message",
          "max_attempts",
          "delivery_window_hours",
          "max_schedule_days",
          "max_endpoints_per_tenant",
          "read_requests_per_second",
          "config_writes_per_second",
          "admission_rate",
          "source_requests_per_second",
          "dispatch_rate",
          "max_concurrency",
          "max_endpoint_concurrency",
          "service_concurrency",
          "max_tenants",
          "max_event_types",
          "max_endpoints",
          "max_sources",
          "max_pending_deliveries",
          "max_content_bytes",
          "max_active_replays"
        ],
        "additionalProperties": false,
        "description": "Hard bounds and your team's effective limits. Employees can raise some limits after a capacity review; contact support@motor.dev."
      },
      "Capabilities": {
        "type": "object",
        "properties": {
          "service_id": {
            "type": "string",
            "const": "webhooks"
          },
          "region": {
            "type": "string"
          },
          "egress_ipv4_cidrs": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty: static sender IP addresses are not supported. Sender addresses may change; receivers requiring source-IP allowlisting are unsupported. Verify delivery signatures."
          },
          "ipv6_delivery": {
            "type": "boolean"
          },
          "verification_kinds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "content_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "limits": {
            "$ref": "#/components/schemas/Limits"
          },
          "rate_version": {
            "type": "string"
          }
        },
        "required": [
          "service_id",
          "region",
          "egress_ipv4_cidrs",
          "ipv6_delivery",
          "verification_kinds",
          "content_types",
          "limits",
          "rate_version"
        ],
        "additionalProperties": false
      },
      "Settings": {
        "type": "object",
        "properties": {
          "configuration_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The settings version, in the `ETag` `\"wd:settings:<version>\"`."
          },
          "payload_retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30,
            "description": "Days to keep message and delivery bodies. 30 by default."
          },
          "response_body_logging": {
            "type": "boolean",
            "description": "Whether attempts keep up to 4 KiB of the response body. Off by default."
          },
          "response_retention_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 7,
            "description": "Days to keep response bodies. 7 by default."
          },
          "approved_configuration_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$",
            "description": "The version of your team's limits that employees approved."
          },
          "limits": {
            "$ref": "#/components/schemas/Limits"
          }
        },
        "required": [
          "configuration_version",
          "payload_retention_days",
          "response_body_logging",
          "response_retention_days",
          "approved_configuration_version",
          "limits"
        ],
        "additionalProperties": false
      },
      "AnalyticsBucket": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time",
            "description": "The start of the UTC hour or day."
          },
          "admitted_messages": {
            "type": "integer",
            "minimum": 0
          },
          "ingest_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "deliveries": {
            "type": "integer",
            "minimum": 0
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "succeeded": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          },
          "expired": {
            "type": "integer",
            "minimum": 0
          },
          "canceled": {
            "type": "integer",
            "minimum": 0
          },
          "duplicates": {
            "type": "integer",
            "minimum": 0
          },
          "rejected_auth": {
            "type": "integer",
            "minimum": 0
          },
          "throttled": {
            "type": "integer",
            "minimum": 0
          },
          "queue_depth": {
            "type": "integer",
            "minimum": 0,
            "description": "The most deliveries that waited in a sample of the bucket's time, added across the endpoints in scope. Motor samples each minute."
          },
          "oldest_due_age_seconds": {
            "type": "integer",
            "minimum": 0,
            "description": "The longest that a waiting delivery was past its due time in a sample of the bucket's time, in seconds."
          }
        },
        "required": [
          "start",
          "admitted_messages",
          "ingest_bytes",
          "deliveries",
          "attempts",
          "succeeded",
          "failed",
          "expired",
          "canceled",
          "duplicates",
          "rejected_auth",
          "throttled",
          "queue_depth",
          "oldest_due_age_seconds"
        ],
        "additionalProperties": false,
        "description": "Counts of the transitions in one bucket. Only buckets with activity appear."
      },
      "Analytics": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string",
            "enum": [
              "hour",
              "day"
            ]
          },
          "created_after": {
            "type": "string",
            "format": "date-time"
          },
          "created_before": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsBucket"
            }
          },
          "queue_depth": {
            "type": "integer",
            "description": "Deliveries waiting now, for the team or the `tenant_id` / `endpoint_id` filter.",
            "minimum": 0
          },
          "oldest_due_age_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "How long the oldest due delivery has waited, or `null`."
          }
        },
        "required": [
          "bucket",
          "created_after",
          "created_before",
          "data",
          "queue_depth",
          "oldest_due_age_seconds"
        ],
        "additionalProperties": false,
        "description": "Operational counts, eventually consistent within about a minute. Not a billing record: see `GET /meta/usage`."
      },
      "Preview": {
        "type": "object",
        "properties": {
          "matches": {
            "type": "boolean",
            "description": "Whether the endpoint's filter matches and its transform succeeds."
          },
          "body_base64": {
            "type": [
              "string",
              "null"
            ],
            "description": "The bytes the endpoint would receive, or `null` when it doesn't match."
          },
          "content_type": {
            "type": "string"
          },
          "body_bytes": {
            "type": "integer",
            "description": "The size of those bytes; the original body's when it doesn't match.",
            "minimum": 0
          },
          "delivery_units": {
            "type": "integer",
            "description": "`webhooks.delivery_16k` units a delivery would cost; 0 when it doesn't match.",
            "minimum": 0
          },
          "transform_version": {
            "type": "string",
            "pattern": "^[1-9][0-9]*$"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why the transform failed, such as `transform_failed: ...`."
          }
        },
        "required": [
          "matches",
          "body_base64",
          "content_type",
          "body_bytes",
          "delivery_units",
          "transform_version",
          "errors"
        ],
        "additionalProperties": false
      },
      "MessageCancel": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "pattern": "^wdm_"
          },
          "canceled_count": {
            "type": "integer",
            "description": "Original deliveries canceled now.",
            "minimum": 0
          },
          "in_flight_count": {
            "type": "integer",
            "description": "Original deliveries in flight: they finish, and no retry follows.",
            "minimum": 0
          },
          "already_terminal_count": {
            "type": "integer",
            "description": "Original deliveries that had already finished.",
            "minimum": 0
          }
        },
        "required": [
          "message_id",
          "canceled_count",
          "in_flight_count",
          "already_terminal_count"
        ],
        "additionalProperties": false
      },
      "MessageRedaction": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "pattern": "^wdm_"
          },
          "status": {
            "type": "string",
            "const": "redacting"
          },
          "redacted_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "message_id",
          "status",
          "redacted_at"
        ],
        "additionalProperties": false
      },
      "ReceiveAck": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "string",
            "pattern": "^wdm_"
          },
          "duplicate": {
            "type": "boolean",
            "description": "`true` for a request Motor already accepted; nothing new is delivered or charged."
          }
        },
        "required": [
          "message_id",
          "duplicate"
        ],
        "additionalProperties": false
      },
      "SlackChallenge": {
        "type": "object",
        "properties": {
          "challenge": {
            "type": "string",
            "description": "Slack's `challenge`, unchanged.",
            "minLength": 1,
            "maxLength": 1024
          }
        },
        "required": [
          "challenge"
        ],
        "additionalProperties": false
      },
      "TenantList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tenant"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "EventTypeList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventType"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "EndpointList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Endpoint"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "MessageList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "DeliveryList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Delivery"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "AttemptList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attempt"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ReplayList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Replay"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ReplayItemList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReplayItem"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "SourceList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "EventList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` for the next page, or `null` at the end."
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      }
    }
  }
}
