# Generated by `bun run openapi` (web/scripts/build-openapi.ts) from
# web/src/lib/api/endpoint-registry and web/src/lib/api/types.
# Do not edit by hand; change the registry or the types and run it again.
openapi: 3.1.0
info:
  title: SendMock API
  version: 1.0.0
  description: |-
    The REST API of SendMock, the local email, SMS and webhook testing server.

    - JSON in and out; field names are snake_case.
    - Errors: `{ "error": { "code": "not_found", "message": "..." } }` with the matching HTTP status.
    - Lists that can grow are paged with an opaque `next_cursor`.
    - No auth by default; with `--ui-auth` the same basic auth or an API token protects the API.

    Generated from the endpoint registry and the TypeScript API types (`bun run openapi`); do not edit by hand.
servers:
  - url: http://127.0.0.1:8025
    description: Default local address
tags:
  - name: System
  - name: Seed
  - name: Logs
  - name: Test helpers
  - name: Automation
  - name: Email
  - name: Inbound routes
  - name: Tag rules
  - name: Forward rules
  - name: SMS
  - name: Outcome rules
  - name: Verify
  - name: Numbers
  - name: Email providers
  - name: SMS providers
  - name: HTTP Catcher
  - name: Payments
  - name: Checkout
  - name: Payment flows
  - name: Payment gateways
  - name: Payment methods
  - name: Webhook endpoints
  - name: Webhook rules
  - name: Webhook deliveries
  - name: Saved deliveries
  - name: Webhook templates
  - name: Webhook variables
  - name: Projects
  - name: Push
paths:
  /api/v1/health:
    get:
      operationId: getHealth
      summary: Liveness check; answers while the server runs.
      tags:
        - System
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HealthStatus"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock health
      x-sendmock-mcp: sendmock_status
      x-sendmock-ui: Sidebar > live connection dot
  /api/v1/info:
    get:
      operationId: getInfo
      summary: Version, listen addresses and enabled features.
      tags:
        - System
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AppInfo"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock status
      x-sendmock-mcp: sendmock_status
      x-sendmock-ui: Settings > About
  /api/v1/stats:
    get:
      operationId: getStats
      summary: Counts and rates shown on the Overview.
      tags:
        - System
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AppStats"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock stats
      x-sendmock-mcp: sendmock_stats
      x-sendmock-ui: Overview
  /api/v1/updates:
    get:
      operationId: getUpdates
      summary: Whether a newer release exists for this channel, with its notes and upgrade command.
      tags:
        - System
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateCheckResult"
        "409":
          $ref: "#/components/responses/Conflict"
        "502":
          $ref: "#/components/responses/BadGateway"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock update check
      x-sendmock-mcp: sendmock_update_check
      x-sendmock-ui: Settings > About > Check GitHub Releases for updates
  /api/v1/settings:
    get:
      operationId: getSettings
      summary: Every runtime setting.
      tags:
        - System
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AppSettings"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock settings get
      x-sendmock-mcp: sendmock_settings_get
      x-sendmock-ui: Settings
    patch:
      operationId: patchSettings
      summary: Change settings; send only the changed keys.
      tags:
        - System
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AppSettingsUpdate"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AppSettings"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock settings set
      x-sendmock-mcp: sendmock_settings_update
      x-sendmock-ui: Settings > Save changes
  /api/v1/reset:
    post:
      operationId: postReset
      summary: Delete all traffic and restore the seed configuration.
      tags:
        - System
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock reset --yes
      x-sendmock-mcp: sendmock_reset
      x-sendmock-ui: Settings > General > Reset to seed
  /api/v1/samples/{kind}:
    post:
      operationId: postSamplesByKind
      summary: Create a sample email, SMS, verification or HTTP request through the normal path.
      tags:
        - System
      parameters:
        - name: kind
          in: path
          required: true
          description: "What to create: `email`, `sms`, `verification` or `http`."
          schema:
            type: string
          example: email
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SampleOptions"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreatedSample"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sample <kind>
      x-sendmock-mcp: sendmock_sample_send
      x-sendmock-ui: Empty screens > Send a sample email, SMS, verification or request
  /api/v1/seed/status:
    get:
      operationId: getSeedStatus
      summary: Whether a seed file is loaded and when it was applied.
      tags:
        - Seed
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SeedStatus"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock seed status
      x-sendmock-mcp: sendmock_seed_status
      x-sendmock-ui: Settings > Seed
  /api/v1/seed/export:
    get:
      operationId: getSeedExport
      summary: The current configuration as sendmock.seed.toml.
      tags:
        - Seed
      responses:
        "200":
          description: OK.
          content:
            application/toml:
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock seed export
      x-sendmock-mcp: sendmock_seed_export
      x-sendmock-ui: Settings > Seed > Export sendmock.seed.toml
  /api/v1/seed/validate:
    post:
      operationId: postSeedValidate
      summary: Check a seed file without applying it.
      tags:
        - Seed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SeedFileRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SeedValidation"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock seed validate <file>
      x-sendmock-mcp: sendmock_seed_validate
      x-sendmock-ui: Settings > Seed > Validate
  /api/v1/seed/apply:
    post:
      operationId: postSeedApply
      summary: Apply a seed file; 422 with the errors when it is invalid.
      tags:
        - Seed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SeedFileRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SeedValidation"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock seed apply <file>
      x-sendmock-mcp: sendmock_seed_apply
      x-sendmock-ui: Settings > Seed > Apply a seed file
  /api/v1/logs/smtp:
    get:
      operationId: getLogsSmtp
      summary: SMTP sessions, newest first, including rejected ones.
      tags:
        - Logs
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: result
          in: query
          required: false
          description: delivered or failed.
          schema:
            type: string
          example: delivered
        - name: query
          in: query
          required: false
          description: Client, EHLO name or user.
          schema:
            type: string
          example: laravel.test
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_SmtpSession"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock logs smtp
      x-sendmock-mcp: sendmock_logs_smtp
      x-sendmock-ui: Logs > SMTP sessions
  /api/v1/logs/smtp/{sessionId}:
    get:
      operationId: getLogsSmtpBySessionId
      summary: One SMTP session with its transcript.
      tags:
        - Logs
      parameters:
        - name: sessionId
          in: path
          required: true
          description: The SMTP session's ID, from `GET /api/v1/logs/smtp`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmtpSession"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock logs smtp show <sessionId>
      x-sendmock-mcp: sendmock_logs_smtp_get
      x-sendmock-ui: Logs > SMTP sessions > open a session
  /api/v1/logs/http:
    get:
      operationId: getLogsHttp
      summary: Requests to the native and provider APIs, newest first.
      tags:
        - Logs
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: api
          in: query
          required: false
          description: Which API, e.g. twilio.
          schema:
            type: string
          example: twilio
        - name: status_class
          in: query
          required: false
          description: 2xx, 4xx or 5xx.
          schema:
            $ref: "#/components/schemas/ApiStatusClass"
          example: 4xx
        - name: path
          in: query
          required: false
          description: Part of the path.
          schema:
            type: string
          example: /Messages.json
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_ApiRequestLogEntry"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock logs http
      x-sendmock-mcp: sendmock_logs_http
      x-sendmock-ui: Logs > API requests
  /api/v1/logs/http/{requestId}:
    get:
      operationId: getLogsHttpByRequestId
      summary: One API request with its request and response.
      tags:
        - Logs
      parameters:
        - name: requestId
          in: path
          required: true
          description: The captured request's ID, from `GET /api/v1/http/requests` or `GET /api/v1/logs/http`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApiRequestLogEntry"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock logs http show <requestId>
      x-sendmock-mcp: sendmock_logs_http_get
      x-sendmock-ui: Logs > API requests > open a request
  /api/v1/wait/email:
    get:
      operationId: getWaitEmail
      summary: Wait until a matching email arrives; 408 on timeout.
      tags:
        - Test helpers
      parameters:
        - name: to
          in: query
          required: false
          description: A recipient contains.
          schema:
            type: string
          example: user@example.test
        - name: subject
          in: query
          required: false
          description: Subject contains.
          schema:
            type: string
          example: Verify your email
        - name: since
          in: query
          required: false
          description: "Only match items newer than this time (default: 30 s ago)."
          schema:
            type: string
          example: 2026-10-26T09:30:00Z
        - name: timeout
          in: query
          required: false
          description: How long to wait, e.g. 10s (default 10s, at most 60s).
          schema:
            type: string
          example: 10s
        - name: project
          in: query
          required: false
          description: Only this project's emails (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailDetail"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email wait
      x-sendmock-mcp: sendmock_email_wait
      x-sendmock-ui: Mail (new emails appear live)
  /api/v1/wait/sms:
    get:
      operationId: getWaitSms
      summary: Wait until a matching SMS arrives; 408 on timeout.
      tags:
        - Test helpers
      parameters:
        - name: to
          in: query
          required: false
          description: The recipient number.
          schema:
            type: string
          example: "+8801700000000"
        - name: from
          in: query
          required: false
          description: The sender number.
          schema:
            type: string
          example: "+15550001111"
        - name: since
          in: query
          required: false
          description: "Only match items newer than this time (default: 30 s ago)."
          schema:
            type: string
          example: 2026-10-26T09:30:00Z
        - name: timeout
          in: query
          required: false
          description: How long to wait, e.g. 10s (default 10s, at most 60s).
          schema:
            type: string
          example: 10s
        - name: project
          in: query
          required: false
          description: Only this project's messages (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsMessageDetail"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms wait
      x-sendmock-mcp: sendmock_sms_wait
      x-sendmock-ui: SMS (new messages appear live)
  /api/v1/wait/http:
    get:
      operationId: getWaitHttp
      summary: Wait until the catcher records a matching request; 408 on timeout.
      tags:
        - Test helpers
      parameters:
        - name: bin
          in: query
          required: false
          description: The bin name.
          schema:
            type: string
          example: slack
        - name: method
          in: query
          required: false
          description: The HTTP method.
          schema:
            type: string
          example: POST
        - name: since
          in: query
          required: false
          description: "Only match items newer than this time (default: 30 s ago)."
          schema:
            type: string
          example: 2026-10-26T09:30:00Z
        - name: timeout
          in: query
          required: false
          description: How long to wait, e.g. 10s (default 10s, at most 60s).
          schema:
            type: string
          example: 10s
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapturedHttpRequest"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http wait
      x-sendmock-mcp: sendmock_http_wait
      x-sendmock-ui: HTTP Catcher (new requests appear live)
  /api/v1/wait/webhook:
    get:
      operationId: getWaitWebhook
      summary: Wait until a matching delivery finishes; 408 on timeout.
      tags:
        - Test helpers
      parameters:
        - name: endpoint
          in: query
          required: false
          description: The endpoint id or name.
          schema:
            type: string
          example: Team Slack alerts
        - name: event
          in: query
          required: false
          description: The event type, e.g. email.received.
          schema:
            type: string
          example: email.received
        - name: status
          in: query
          required: false
          description: succeeded or failed.
          schema:
            type: string
          example: failed
        - name: since
          in: query
          required: false
          description: "Only match items newer than this time (default: 30 s ago)."
          schema:
            type: string
          example: 2026-10-26T09:30:00Z
        - name: timeout
          in: query
          required: false
          description: How long to wait, e.g. 10s (default 10s, at most 60s).
          schema:
            type: string
          example: 10s
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDeliveryDetail"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook deliveries wait
      x-sendmock-mcp: sendmock_webhook_delivery_wait
      x-sendmock-ui: Webhooks > Deliveries (new deliveries appear live)
  /api/v1/wait/payment:
    get:
      operationId: getWaitPayment
      summary: Wait until a payment reaches a status; 408 on timeout.
      tags:
        - Test helpers
      parameters:
        - name: provider
          in: query
          required: false
          description: The gateway key, e.g. stripe.
          schema:
            type: string
          example: stripe
        - name: status
          in: query
          required: false
          description: The status to wait for, e.g. succeeded.
          schema:
            type: string
          example: succeeded
        - name: since
          in: query
          required: false
          description: "Only match items newer than this time (default: 30 s ago)."
          schema:
            type: string
          example: 2026-10-26T09:30:00Z
        - name: timeout
          in: query
          required: false
          description: How long to wait, e.g. 10s (default 10s, at most 60s).
          schema:
            type: string
          example: 10s
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentDetail"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments wait
      x-sendmock-mcp: sendmock_payment_wait
      x-sendmock-ui: Payments (new and changed payments appear live)
  /api/v1/otp:
    get:
      operationId: getOtp
      summary: The latest one-time code sent to a recipient.
      tags:
        - Test helpers
      parameters:
        - name: to
          in: query
          required: true
          description: Email address or phone number.
          schema:
            type: string
          example: user@example.test
        - name: channel
          in: query
          required: false
          description: "email, sms or verify (default: any)."
          schema:
            type: string
          example: email
        - name: timeout
          in: query
          required: false
          description: Waits up to this long for one to arrive, e.g. 10s (at most 60s); 408 on timeout. Without it the answer is immediate.
          schema:
            type: string
          example: 10s
        - name: project
          in: query
          required: false
          description: Only this project's messages (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OtpLookup"
        "404":
          $ref: "#/components/responses/NotFound"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock otp --to <recipient>
      x-sendmock-mcp: sendmock_otp_get
      x-sendmock-ui: "Mail, SMS and Verify: the code beside each message"
  /api/v1/links:
    get:
      operationId: getLinks
      summary: The links of the latest email to a recipient.
      tags:
        - Test helpers
      parameters:
        - name: to
          in: query
          required: true
          description: The recipient address.
          schema:
            type: string
          example: user@example.test
        - name: timeout
          in: query
          required: false
          description: Waits up to this long for one to arrive, e.g. 10s (at most 60s); 408 on timeout. Without it the answer is immediate.
          schema:
            type: string
          example: 10s
        - name: project
          in: query
          required: false
          description: Only this project's emails (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LinksLookup"
        "404":
          $ref: "#/components/responses/NotFound"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock links --to <recipient>
      x-sendmock-mcp: sendmock_links_get
      x-sendmock-ui: Mail > open email > links panel
  /api/v1/events/recent:
    get:
      operationId: getEventsRecent
      summary: "The latest events, newest first: the polling twin of the live stream."
      tags:
        - Automation
      parameters:
        - name: since
          in: query
          required: false
          description: Only events newer than this time.
          schema:
            type: string
          example: 2026-10-26T09:30:00Z
        - name: type
          in: query
          required: false
          description: An event type, e.g. http.captured.
          schema:
            type: string
          example: http.captured
        - name: limit
          in: query
          required: false
          description: At most this many (default 50).
          schema:
            type: integer
          example: 50
        - name: project
          in: query
          required: false
          description: Only events about this project's emails, SMS and verifications (its key); every event when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/AppEvent"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock events tail
      x-sendmock-mcp: sendmock_events_recent
      x-sendmock-ui: Notification bell
  /api/v1/integrations/{stack}:
    get:
      operationId: getIntegrationsByStack
      summary: Copy-ready settings for a stack, as Settings > Connection shows them.
      tags:
        - Automation
      parameters:
        - name: stack
          in: path
          required: true
          description: "Your app's stack: a language (`laravel`, `node`, `python`, `go`, `java`, `ruby`, `dotnet`, `curl`) or a framework (`php`, `express`, `nestjs`, `django`, `flask`, `fastapi`, `spring`, `rails`, `aspnet`)."
          schema:
            type: string
          example: laravel
        - name: channel
          in: query
          required: false
          description: email, sms or http (default email).
          schema:
            type: string
          example: email
        - name: host
          in: query
          required: false
          description: "Where the app runs: local, docker-host or compose."
          schema:
            type: string
          example: local
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IntegrationSnippet"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock integrate <stack>
      x-sendmock-mcp: sendmock_integration_snippet
      x-sendmock-ui: Settings > Connection
  /api/v1/scenarios/validate:
    post:
      operationId: postScenariosValidate
      summary: Check a scenario file without running it.
      tags:
        - Automation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScenarioRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScenarioValidation"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock scenario validate <file>
      x-sendmock-mcp: sendmock_scenario_validate
      x-sendmock-ui: Scenarios > Validate
  /api/v1/scenarios/run:
    post:
      operationId: postScenariosRun
      summary: Run a scenario file step by step and report each step.
      tags:
        - Automation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScenarioRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScenarioReport"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock scenario run <file>
      x-sendmock-mcp: sendmock_scenario_run
      x-sendmock-ui: Scenarios > Run
  /api/v1/ai/agents:
    get:
      operationId: getAiAgents
      summary: For each AI agent, the install command and its MCP configuration.
      tags:
        - Automation
      parameters:
        - name: target
          in: query
          required: false
          description: Only this agent.
          schema:
            $ref: "#/components/schemas/AiAgentTarget"
          example: claude-code
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/AiAgentSetup"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock ai install --target <agent>
      x-sendmock-mcp: sendmock_ai_agents
      x-sendmock-ui: Settings > Connection > AI agents
  /api/v1/ai/skill:
    get:
      operationId: getAiSkill
      summary: The SendMock agent skill as Markdown.
      tags:
        - Automation
      responses:
        "200":
          description: OK.
          content:
            text/markdown:
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock ai skill
      x-sendmock-mcp: sendmock://docs/skill
      x-sendmock-ui: Settings > Connection > AI agents > Download the skill
  /api/v1/emails:
    get:
      operationId: getEmails
      summary: Stored emails, newest first, with search and filters.
      tags:
        - Email
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: query
          in: query
          required: false
          description: "Search text; supports from:, to: and tag: prefixes."
          schema:
            type: string
          example: to:user@example.test reset
        - name: from
          in: query
          required: false
          description: Sender contains.
          schema:
            type: string
          example: no-reply@shop.test
        - name: to
          in: query
          required: false
          description: A recipient contains.
          schema:
            type: string
          example: user@example.test
        - name: tag
          in: query
          required: false
          description: Has this tag.
          schema:
            type: string
          example: signup
        - name: is_unread
          in: query
          required: false
          description: Only unread.
          schema:
            type: boolean
          example: true
        - name: has_attachment
          in: query
          required: false
          description: Only with attachments.
          schema:
            type: boolean
          example: true
        - name: source
          in: query
          required: false
          description: "How it arrived: smtp, sendmail, native_api, verify, simulated, or an email provider's key, e.g. sendgrid."
          schema:
            $ref: "#/components/schemas/EmailSource"
          example: smtp
        - name: direction
          in: query
          required: false
          description: Outbound from your app or inbound to it.
          schema:
            $ref: "#/components/schemas/EmailDirection"
          example: outbound
        - name: project
          in: query
          required: false
          description: Only this project's emails (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_EmailSummary"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email list
      x-sendmock-mcp: sendmock_email_list
      x-sendmock-ui: Mail
    delete:
      operationId: deleteEmails
      summary: Delete every email, or only those that match the filters.
      tags:
        - Email
      parameters:
        - name: query
          in: query
          required: false
          description: "Search text; supports from:, to: and tag: prefixes."
          schema:
            type: string
          example: to:user@example.test reset
        - name: from
          in: query
          required: false
          description: Sender contains.
          schema:
            type: string
          example: no-reply@shop.test
        - name: to
          in: query
          required: false
          description: A recipient contains.
          schema:
            type: string
          example: user@example.test
        - name: tag
          in: query
          required: false
          description: Has this tag.
          schema:
            type: string
          example: signup
        - name: is_unread
          in: query
          required: false
          description: Only unread.
          schema:
            type: boolean
          example: true
        - name: has_attachment
          in: query
          required: false
          description: Only with attachments.
          schema:
            type: boolean
          example: true
        - name: source
          in: query
          required: false
          description: "How it arrived: smtp, sendmail, native_api, verify, simulated, or an email provider's key, e.g. sendgrid."
          schema:
            $ref: "#/components/schemas/EmailSource"
          example: smtp
        - name: direction
          in: query
          required: false
          description: Outbound from your app or inbound to it.
          schema:
            $ref: "#/components/schemas/EmailDirection"
          example: outbound
        - name: project
          in: query
          required: false
          description: Only this project's emails (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email delete-all --yes
      x-sendmock-mcp: sendmock_email_delete_all
      x-sendmock-ui: Mail > Delete all
  /api/v1/emails/latest:
    get:
      operationId: getEmailsLatest
      summary: The newest email to a recipient.
      tags:
        - Email
      parameters:
        - name: to
          in: query
          required: true
          description: The recipient address.
          schema:
            type: string
          example: user@example.test
        - name: subject
          in: query
          required: false
          description: Subject contains.
          schema:
            type: string
          example: Reset your password
        - name: project
          in: query
          required: false
          description: Only this project's emails (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email latest --to <address>
      x-sendmock-mcp: sendmock_email_latest
      x-sendmock-ui: "Mail > search to:"
  /api/v1/emails/inbound:
    post:
      operationId: postEmailsInbound
      summary: Create an incoming email from fields or raw MIME; fires email.inbound.
      tags:
        - Email
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailInboundRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeSendResult"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email inbound
      x-sendmock-mcp: sendmock_email_inbound
      x-sendmock-ui: Mail > Import .eml > Incoming to your app
  /api/v1/emails/{emailId}:
    get:
      operationId: getEmailsByEmailId
      summary: One email with bodies, headers, attachments and extracted codes.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email show <emailId>
      x-sendmock-mcp: sendmock_email_get
      x-sendmock-ui: Mail > open email
    patch:
      operationId: patchEmailsByEmailId
      summary: Mark read or unread, or change tags.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailUpdate"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailSummary"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email update <emailId>
      x-sendmock-mcp: sendmock_email_update
      x-sendmock-ui: Mail > open email > Mark as read, tags
    delete:
      operationId: deleteEmailsByEmailId
      summary: Delete one email.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email delete <emailId>
      x-sendmock-mcp: sendmock_email_delete
      x-sendmock-ui: Mail > open email > Delete
  /api/v1/emails/{emailId}/timeline:
    get:
      operationId: getEmailsByEmailIdTimeline
      summary: "Delivery events: received, delivered, opened, bounced."
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/EmailTimelineEntry"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email timeline <emailId>
      x-sendmock-mcp: sendmock_email_timeline
      x-sendmock-ui: Mail > open email > Timeline
  /api/v1/emails/{emailId}/html-check:
    get:
      operationId: getEmailsByEmailIdHtmlCheck
      summary: HTML and CSS support across email clients.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HtmlCheckReport"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email check <emailId> html
      x-sendmock-mcp: sendmock_email_check
      x-sendmock-ui: Mail > open email > Checks
  /api/v1/emails/{emailId}/list-unsubscribe:
    get:
      operationId: getEmailsByEmailIdListUnsubscribe
      summary: List-Unsubscribe and one-click unsubscribe checks.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListUnsubscribeReport"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email check <emailId> unsubscribe
      x-sendmock-mcp: sendmock_email_check
      x-sendmock-ui: Mail > open email > Headers
  /api/v1/emails/{emailId}/mime:
    get:
      operationId: getEmailsByEmailIdMime
      summary: The MIME tree of the message.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MimePart"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email mime <emailId>
      x-sendmock-mcp: sendmock_email_mime
      x-sendmock-ui: Mail > open email > MIME
  /api/v1/emails/{emailId}/mime/{partId}:
    get:
      operationId: getEmailsByEmailIdMimeByPartId
      summary: Download one MIME part, decoded, by its position in the MIME tree.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: partId
          in: path
          required: true
          description: The part's position in the MIME tree, as `GET /emails/{emailId}/mime` numbers it, e.g. `1.2`.
          schema:
            type: string
          example: "1.2"
      responses:
        "200":
          description: OK.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email mime-part <emailId> <partId>
      x-sendmock-mcp: sendmock://emails/{emailId}/mime/{partId}
      x-sendmock-ui: Mail > open email > MIME, download a part
  /api/v1/emails/{emailId}/raw:
    get:
      operationId: getEmailsByEmailIdRaw
      summary: The raw message source.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            message/rfc822:
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email raw <emailId>
      x-sendmock-mcp: sendmock://emails/{emailId}/raw
      x-sendmock-ui: Mail > open email > Source, download .eml
  /api/v1/emails/{emailId}/attachments/{attachmentIndex}:
    get:
      operationId: getEmailsByEmailIdAttachmentsByAttachmentIndex
      summary: Download one attachment.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: attachmentIndex
          in: path
          required: true
          description: Position of the file in the email's `attachments`, starting at 0.
          schema:
            type: integer
          example: 0
      responses:
        "200":
          description: OK.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email attachments <emailId> <attachmentIndex>
      x-sendmock-mcp: sendmock://emails/{emailId}/attachments/{attachmentIndex}
      x-sendmock-ui: Mail > open email > Attachments
  /api/v1/emails/{emailId}/parts/{attachmentIndex}/thumbnail:
    get:
      operationId: getEmailsByEmailIdPartsByAttachmentIndexThumbnail
      summary: A preview image of an attachment.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: attachmentIndex
          in: path
          required: true
          description: Position of the file in the email's `attachments`, starting at 0.
          schema:
            type: integer
          example: 0
      responses:
        "200":
          description: OK.
          content:
            image/*:
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email thumbnail <emailId> <attachmentIndex>
      x-sendmock-mcp: sendmock://emails/{emailId}/parts/{attachmentIndex}/thumbnail
      x-sendmock-ui: Mail > open email > Attachments (thumbnails)
  /api/v1/emails/{emailId}/link-check:
    post:
      operationId: postEmailsByEmailIdLinkCheck
      summary: Check every link in the message.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/LinkCheckResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email check <emailId> links
      x-sendmock-mcp: sendmock_email_check
      x-sendmock-ui: Mail > open email > Checks
  /api/v1/emails/{emailId}/spam-check:
    post:
      operationId: postEmailsByEmailIdSpamCheck
      summary: Score the message with the spam rules.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpamCheckReport"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email check <emailId> spam
      x-sendmock-mcp: sendmock_email_check
      x-sendmock-ui: Mail > open email > Checks
  /api/v1/emails/{emailId}/open:
    post:
      operationId: postEmailsByEmailIdOpen
      summary: Record an open and fire email.opened.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OpenEventRequest"
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email open <emailId>
      x-sendmock-mcp: sendmock_email_open
      x-sendmock-ui: Mail > open email (opening it fires the open)
  /api/v1/emails/{emailId}/opens:
    get:
      operationId: getEmailsByEmailIdOpens
      summary: Every recorded open of the email, oldest first.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/OpenRecord"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email opens <emailId>
      x-sendmock-mcp: sendmock_email_opens
      x-sendmock-ui: Mail > open email > Timeline (opened entries)
  /api/v1/emails/{emailId}/clicks:
    post:
      operationId: postEmailsByEmailIdClicks
      summary: Record a click on one of the email's links and fire email.clicked.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailClickRequest"
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email click <emailId>
      x-sendmock-mcp: sendmock_email_click
      x-sendmock-ui: Mail > open email > click a link in the preview, or Simulate click
    get:
      operationId: getEmailsByEmailIdClicks
      summary: Every recorded click on the email's links, newest first.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/EmailClickRecord"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email clicks <emailId>
      x-sendmock-mcp: sendmock_email_clicks
      x-sendmock-ui: Mail > open email > Timeline (clicked entries)
  /api/v1/emails/{emailId}/release:
    post:
      operationId: postEmailsByEmailIdRelease
      summary: Send the email on through the allowlisted relay.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailReleaseRequest"
      responses:
        "204":
          description: No content.
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email release <emailId>
      x-sendmock-mcp: sendmock_email_release
      x-sendmock-ui: Mail > open email > Release to real SMTP
  /api/v1/emails/{emailId}/simulate:
    post:
      operationId: postEmailsByEmailIdSimulate
      summary: Simulate a delivery outcome such as a bounce or complaint.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SimulatedEmailOutcome"
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email simulate <emailId> <event>
      x-sendmock-mcp: sendmock_email_simulate
      x-sendmock-ui: Mail > open email > Simulate
  /api/v1/emails/{emailId}/reply:
    post:
      operationId: postEmailsByEmailIdReply
      summary: Reply as the recipient; the reply arrives as inbound email.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailReplyRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email reply <emailId>
      x-sendmock-mcp: sendmock_email_reply
      x-sendmock-ui: Mail > open email > Reply, Reply all
  /api/v1/emails/{emailId}/forward:
    post:
      operationId: postEmailsByEmailIdForward
      summary: Forward as the recipient; the copy arrives as inbound email.
      tags:
        - Email
      parameters:
        - name: emailId
          in: path
          required: true
          description: The email's ID, from `GET /api/v1/emails`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailForwardRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email forward <emailId>
      x-sendmock-mcp: sendmock_email_forward
      x-sendmock-ui: Mail > open email > Forward
  /api/v1/send:
    post:
      operationId: postSend
      summary: "Native send: JSON with optional base64 attachments."
      tags:
        - Email
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NativeSendRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeSendResult"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email send
      x-sendmock-mcp: sendmock_email_send
      x-sendmock-ui: Settings > Connection > Send this request
  /api/v1/send/raw:
    post:
      operationId: postSendRaw
      summary: Store a raw message as sent by your app, as the sendmail shim does.
      tags:
        - Email
      requestBody:
        required: true
        content:
          message/rfc822:
            schema:
              type: string
              format: binary
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeSendResult"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sendmail
      x-sendmock-mcp: sendmock_email_send_raw
      x-sendmock-ui: Mail > Import .eml > Sent by your app
  /api/v1/inbound-routes:
    get:
      operationId: getInboundRoutes
      summary: Routes for incoming email, in priority order.
      tags:
        - Inbound routes
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/InboundRoute"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock route list
      x-sendmock-mcp: sendmock_inbound_route_list
      x-sendmock-ui: Webhooks > Inbound routes
    post:
      operationId: postInboundRoutes
      summary: Add a route.
      tags:
        - Inbound routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InboundRouteInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InboundRoute"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock route create
      x-sendmock-mcp: sendmock_inbound_route_create
      x-sendmock-ui: Webhooks > Inbound routes > Add route
  /api/v1/inbound-routes/{routeId}:
    patch:
      operationId: patchInboundRoutesByRouteId
      summary: Change a route.
      tags:
        - Inbound routes
      parameters:
        - name: routeId
          in: path
          required: true
          description: The inbound route's ID, from `GET /api/v1/inbound-routes`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InboundRouteInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InboundRoute"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock route update <routeId>
      x-sendmock-mcp: sendmock_inbound_route_update
      x-sendmock-ui: Webhooks > Inbound routes > Edit, move
    delete:
      operationId: deleteInboundRoutesByRouteId
      summary: Delete a route.
      tags:
        - Inbound routes
      parameters:
        - name: routeId
          in: path
          required: true
          description: The inbound route's ID, from `GET /api/v1/inbound-routes`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock route delete <routeId>
      x-sendmock-mcp: sendmock_inbound_route_delete
      x-sendmock-ui: Webhooks > Inbound routes > Delete
  /api/v1/inbound-routes/test:
    post:
      operationId: postInboundRoutesTest
      summary: Which routes a recipient or header would match, and what runs.
      tags:
        - Inbound routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InboundRouteTestRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InboundRouteTestResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock route test
      x-sendmock-mcp: sendmock_inbound_route_test
      x-sendmock-ui: Webhooks > Inbound routes > route sheet > Preview
  /api/v1/inbound-routes/match:
    post:
      operationId: postInboundRoutesMatch
      summary: "Where an incoming email would go: the routes and webhook rules it would run."
      tags:
        - Inbound routes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InboundRouteMatchRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InboundRouteMatchResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock route match
      x-sendmock-mcp: sendmock_inbound_route_match
      x-sendmock-ui: Mail > Reply, Reply all, Forward > Delivers to
  /api/v1/tag-rules:
    get:
      operationId: getTagRules
      summary: Every tag rule, in the order they run.
      tags:
        - Tag rules
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TagRule"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email tag-rules list
      x-sendmock-mcp: sendmock_tag_rule_list
      x-sendmock-ui: Settings > Email > Tag rules
    post:
      operationId: postTagRules
      summary: Add a tag rule at the end of the list.
      tags:
        - Tag rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TagRuleInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TagRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email tag-rules create
      x-sendmock-mcp: sendmock_tag_rule_create
      x-sendmock-ui: Settings > Email > Tag rules > Add rule
  /api/v1/tag-rules/{ruleId}:
    patch:
      operationId: patchTagRulesByRuleId
      summary: Change a tag rule, or switch it on or off.
      tags:
        - Tag rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TagRuleInputPatch"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TagRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email tag-rules update <ruleId>
      x-sendmock-mcp: sendmock_tag_rule_update
      x-sendmock-ui: Settings > Email > Tag rules > Edit, enabled switch
    delete:
      operationId: deleteTagRulesByRuleId
      summary: Delete a tag rule.
      tags:
        - Tag rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email tag-rules delete <ruleId>
      x-sendmock-mcp: sendmock_tag_rule_delete
      x-sendmock-ui: Settings > Email > Tag rules > Delete
  /api/v1/tag-rules/{ruleId}/move:
    post:
      operationId: postTagRulesByRuleIdMove
      summary: Move a tag rule up or down.
      tags:
        - Tag rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageRuleMove"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TagRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email tag-rules move <ruleId>
      x-sendmock-mcp: sendmock_tag_rule_move
      x-sendmock-ui: Settings > Email > Tag rules > Move up, Move down
  /api/v1/forward-rules:
    get:
      operationId: getForwardRules
      summary: Every forward rule, in the order they run.
      tags:
        - Forward rules
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ForwardRule"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email forward-rules list
      x-sendmock-mcp: sendmock_forward_rule_list
      x-sendmock-ui: Settings > Email > Auto-forward rules
    post:
      operationId: postForwardRules
      summary: Add a forward rule at the end of the list.
      tags:
        - Forward rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ForwardRuleInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForwardRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email forward-rules create
      x-sendmock-mcp: sendmock_forward_rule_create
      x-sendmock-ui: Settings > Email > Auto-forward rules > Add rule
  /api/v1/forward-rules/{ruleId}:
    patch:
      operationId: patchForwardRulesByRuleId
      summary: Change a forward rule, or switch it on or off.
      tags:
        - Forward rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ForwardRuleInputPatch"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ForwardRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email forward-rules update <ruleId>
      x-sendmock-mcp: sendmock_forward_rule_update
      x-sendmock-ui: Settings > Email > Auto-forward rules > Edit, enabled switch
    delete:
      operationId: deleteForwardRulesByRuleId
      summary: Delete a forward rule.
      tags:
        - Forward rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email forward-rules delete <ruleId>
      x-sendmock-mcp: sendmock_forward_rule_delete
      x-sendmock-ui: Settings > Email > Auto-forward rules > Delete
  /api/v1/forward-rules/{ruleId}/move:
    post:
      operationId: postForwardRulesByRuleIdMove
      summary: Move a forward rule up or down.
      tags:
        - Forward rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageRuleMove"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ForwardRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email forward-rules move <ruleId>
      x-sendmock-mcp: sendmock_forward_rule_move
      x-sendmock-ui: Settings > Email > Auto-forward rules > Move up, Move down
  /api/v1/sms:
    get:
      operationId: getSms
      summary: SMS and WhatsApp messages, newest first, with filters.
      tags:
        - SMS
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: query
          in: query
          required: false
          description: Number or text.
          schema:
            type: string
          example: code
        - name: from
          in: query
          required: false
          description: Sender number.
          schema:
            type: string
          example: "+15550001111"
        - name: to
          in: query
          required: false
          description: Recipient number.
          schema:
            type: string
          example: "+8801700000000"
        - name: status
          in: query
          required: false
          description: Delivery status.
          schema:
            $ref: "#/components/schemas/SmsStatus"
          example: delivered
        - name: direction
          in: query
          required: false
          description: Outbound from your app or inbound to it.
          schema:
            $ref: "#/components/schemas/SmsDirection"
          example: outbound
        - name: thread_id
          in: query
          required: false
          description: Only this conversation.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: project
          in: query
          required: false
          description: Only this project's messages (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_SmsMessage"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms list
      x-sendmock-mcp: sendmock_sms_list
      x-sendmock-ui: SMS
    delete:
      operationId: deleteSms
      summary: Delete every message.
      tags:
        - SMS
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms delete-all --yes
      x-sendmock-mcp: sendmock_sms_delete_all
      x-sendmock-ui: Settings > General > Delete all SMS
    post:
      operationId: postSms
      summary: Native send, with optional media URLs or inline media.
      tags:
        - SMS
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NativeSmsRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsMessageDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms send
      x-sendmock-mcp: sendmock_sms_send
      x-sendmock-ui: Settings > Connection > Send this request
  /api/v1/sms/threads:
    get:
      operationId: getSmsThreads
      summary: Conversations, one per contact and your number.
      tags:
        - SMS
      parameters:
        - name: project
          in: query
          required: false
          description: Only this project's messages (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SmsThread"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms threads
      x-sendmock-mcp: sendmock_sms_threads
      x-sendmock-ui: SMS > conversation list
  /api/v1/sms/{smsId}:
    get:
      operationId: getSmsBySmsId
      summary: One message with its status history and callbacks.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsMessageDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms show <smsId>
      x-sendmock-mcp: sendmock_sms_get
      x-sendmock-ui: SMS > message > Message details
    delete:
      operationId: deleteSmsBySmsId
      summary: Delete one message.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms delete <smsId>
      x-sendmock-mcp: sendmock_sms_delete
      x-sendmock-ui: SMS > message menu > Delete
  /api/v1/sms/{smsId}/media/{mediaIndex}:
    get:
      operationId: getSmsBySmsIdMediaByMediaIndex
      summary: Download one media item of an MMS or WhatsApp message.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: mediaIndex
          in: path
          required: true
          description: Position of the media file in the SMS's `media`, starting at 0.
          schema:
            type: integer
          example: 0
      responses:
        "200":
          description: OK.
          content:
            "*/*":
              schema:
                type: string
                format: binary
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms media <smsId> <mediaIndex>
      x-sendmock-mcp: sendmock://sms/{smsId}/media/{mediaIndex}
      x-sendmock-ui: SMS > message > media
  /api/v1/sms/{smsId}/open:
    post:
      operationId: postSmsBySmsIdOpen
      summary: Record a read and fire sms.opened.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OpenEventRequest"
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms open <smsId>
      x-sendmock-mcp: sendmock_sms_open
      x-sendmock-ui: SMS > message menu > Simulate read
  /api/v1/sms/{smsId}/opens:
    get:
      operationId: getSmsBySmsIdOpens
      summary: Every recorded read of an outbound message, oldest first.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/OpenRecord"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms opens <smsId>
      x-sendmock-mcp: sendmock_sms_opens
      x-sendmock-ui: SMS > message ticks (read)
  /api/v1/sms/{smsId}/reply-webhook/resend:
    post:
      operationId: postSmsBySmsIdReplyWebhookResend
      summary: Send an inbound message's reply webhook again.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsMessageDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms resend-reply-webhook <smsId>
      x-sendmock-mcp: sendmock_sms_reply_webhook_resend
      x-sendmock-ui: SMS > Message details > Reply webhook > Resend reply webhook
  /api/v1/sms/{smsId}/status:
    post:
      operationId: postSmsBySmsIdStatus
      summary: Set a delivery status by hand and fire its callback.
      tags:
        - SMS
      parameters:
        - name: smsId
          in: path
          required: true
          description: The SMS's ID, from `GET /api/v1/sms`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SmsStatusUpdate"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsMessageDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms status <smsId> <status>
      x-sendmock-mcp: sendmock_sms_set_status
      x-sendmock-ui: SMS > Message details > Set status
  /api/v1/sms/inbound:
    post:
      operationId: postSmsInbound
      summary: Simulate a message from a contact to one of your numbers.
      tags:
        - SMS
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InboundSmsRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsMessageDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms inbound
      x-sendmock-mcp: sendmock_sms_simulate_inbound
      x-sendmock-ui: SMS > conversation > Reply as recipient
  /api/v1/outcome-rules/email:
    get:
      operationId: getOutcomeRulesEmail
      summary: Email outcome rules, checked from top to bottom.
      tags:
        - Outcome rules
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/EmailOutcomeRule"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule email list
      x-sendmock-mcp: sendmock_outcome_rule_list
      x-sendmock-ui: Settings > Email > Custom outcome addresses
    post:
      operationId: postOutcomeRulesEmail
      summary: Add an email outcome rule.
      tags:
        - Outcome rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailOutcomeRuleInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailOutcomeRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule email create
      x-sendmock-mcp: sendmock_outcome_rule_create
      x-sendmock-ui: Settings > Email > Custom outcome addresses > Add address
  /api/v1/outcome-rules/email/{ruleId}:
    patch:
      operationId: patchOutcomeRulesEmailByRuleId
      summary: Change an email outcome rule; send only the changed keys.
      tags:
        - Outcome rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailOutcomeRuleInputPatch"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EmailOutcomeRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule email update <ruleId>
      x-sendmock-mcp: sendmock_outcome_rule_update
      x-sendmock-ui: Settings > Email > Custom outcome addresses > Edit, enabled switch
    delete:
      operationId: deleteOutcomeRulesEmailByRuleId
      summary: Delete an email outcome rule.
      tags:
        - Outcome rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule email delete <ruleId>
      x-sendmock-mcp: sendmock_outcome_rule_delete
      x-sendmock-ui: Settings > Email > Custom outcome addresses > Delete
  /api/v1/outcome-rules/email/{ruleId}/move:
    post:
      operationId: postOutcomeRulesEmailByRuleIdMove
      summary: Move an email outcome rule up or down.
      tags:
        - Outcome rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OutcomeRuleMove"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/EmailOutcomeRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule email move <ruleId>
      x-sendmock-mcp: sendmock_outcome_rule_move
      x-sendmock-ui: Settings > Email > Custom outcome addresses > Move up, Move down
  /api/v1/outcome-rules/sms:
    get:
      operationId: getOutcomeRulesSms
      summary: SMS outcome rules, checked from top to bottom.
      tags:
        - Outcome rules
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SmsOutcomeRule"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule sms list
      x-sendmock-mcp: sendmock_outcome_rule_list
      x-sendmock-ui: Settings > SMS > Custom outcome numbers
    post:
      operationId: postOutcomeRulesSms
      summary: Add an SMS outcome rule.
      tags:
        - Outcome rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SmsOutcomeRuleInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsOutcomeRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule sms create
      x-sendmock-mcp: sendmock_outcome_rule_create
      x-sendmock-ui: Settings > SMS > Custom outcome numbers > Add number
  /api/v1/outcome-rules/sms/{ruleId}:
    patch:
      operationId: patchOutcomeRulesSmsByRuleId
      summary: Change an SMS outcome rule; send only the changed keys.
      tags:
        - Outcome rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SmsOutcomeRuleInputPatch"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SmsOutcomeRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule sms update <ruleId>
      x-sendmock-mcp: sendmock_outcome_rule_update
      x-sendmock-ui: Settings > SMS > Custom outcome numbers > Edit, enabled switch
    delete:
      operationId: deleteOutcomeRulesSmsByRuleId
      summary: Delete an SMS outcome rule.
      tags:
        - Outcome rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule sms delete <ruleId>
      x-sendmock-mcp: sendmock_outcome_rule_delete
      x-sendmock-ui: Settings > SMS > Custom outcome numbers > Delete
  /api/v1/outcome-rules/sms/{ruleId}/move:
    post:
      operationId: postOutcomeRulesSmsByRuleIdMove
      summary: Move an SMS outcome rule up or down.
      tags:
        - Outcome rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OutcomeRuleMove"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SmsOutcomeRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule sms move <ruleId>
      x-sendmock-mcp: sendmock_outcome_rule_move
      x-sendmock-ui: Settings > SMS > Custom outcome numbers > Move up, Move down
  /api/v1/outcome-rules/email/test:
    post:
      operationId: postOutcomeRulesEmailTest
      summary: Which custom rule, magic address or profile decides an address's outcome.
      tags:
        - Outcome rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EmailOutcomeTestRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OutcomeTestResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule email test <address>
      x-sendmock-mcp: sendmock_outcome_rule_test
      x-sendmock-ui: Settings > Email > Test an address
  /api/v1/outcome-rules/sms/test:
    post:
      operationId: postOutcomeRulesSmsTest
      summary: Which custom rule, magic number or profile decides a number's outcome.
      tags:
        - Outcome rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SmsOutcomeTestRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OutcomeTestResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock outcome-rule sms test <number>
      x-sendmock-mcp: sendmock_outcome_rule_test
      x-sendmock-ui: Settings > SMS > Test a number
  /api/v1/verify:
    get:
      operationId: getVerify
      summary: Verifications your app started, newest first.
      tags:
        - Verify
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: status
          in: query
          required: false
          description: pending, approved or failed.
          schema:
            type: string
          example: pending
        - name: to
          in: query
          required: false
          description: Number or email.
          schema:
            type: string
          example: "+8801700000000"
        - name: channel
          in: query
          required: false
          description: How the code was sent.
          schema:
            $ref: "#/components/schemas/VerifyChannel"
          example: sms
        - name: project
          in: query
          required: false
          description: Only this project's verifications (its key); every project's when not set.
          schema:
            type: string
          example: shop
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_Verification"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify list
      x-sendmock-mcp: sendmock_verify_list
      x-sendmock-ui: SMS > Verify
  /api/v1/verify/{verificationSid}:
    get:
      operationId: getVerifyByVerificationSid
      summary: One verification with its code, attempts and timeline.
      tags:
        - Verify
      parameters:
        - name: verificationSid
          in: path
          required: true
          description: The verification's SID, from `GET /api/v1/verify`.
          schema:
            type: string
          example: VE00000000000000000000000000000001
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerificationDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify show <verificationSid>
      x-sendmock-mcp: sendmock_verify_get
      x-sendmock-ui: SMS > Verify > open a verification
  /api/v1/verify/{verificationSid}/force:
    post:
      operationId: postVerifyByVerificationSidForce
      summary: "Force an outcome: approved, expired, canceled or max attempts."
      tags:
        - Verify
      parameters:
        - name: verificationSid
          in: path
          required: true
          description: The verification's SID, from `GET /api/v1/verify`.
          schema:
            type: string
          example: VE00000000000000000000000000000001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VerificationForceRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerificationDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify force <verificationSid> <status>
      x-sendmock-mcp: sendmock_verify_force
      x-sendmock-ui: SMS > Verify > verification > Approve, Cancel, Expire, Max attempts
  /api/v1/verify/services:
    get:
      operationId: getVerifyServices
      summary: Verify services (code length, fixed code, lifetime).
      tags:
        - Verify
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/VerifyService"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify services list
      x-sendmock-mcp: sendmock_verify_service_list
      x-sendmock-ui: SMS > Verify > Services
    post:
      operationId: postVerifyServices
      summary: Add a Verify service.
      tags:
        - Verify
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VerifyServiceInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerifyService"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify services create
      x-sendmock-mcp: sendmock_verify_service_create
      x-sendmock-ui: SMS > Verify > Services > New service
  /api/v1/verify/services/{serviceSid}:
    patch:
      operationId: patchVerifyServicesByServiceSid
      summary: Change a Verify service.
      tags:
        - Verify
      parameters:
        - name: serviceSid
          in: path
          required: true
          description: "The service SID: `MG...` for a Messaging Service, `VA...` for a Verify service."
          schema:
            type: string
          example: MG00000000000000000000000000000001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VerifyServiceInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerifyService"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify services update <serviceSid>
      x-sendmock-mcp: sendmock_verify_service_update
      x-sendmock-ui: SMS > Verify > Services > Edit
    delete:
      operationId: deleteVerifyServicesByServiceSid
      summary: Delete a Verify service.
      tags:
        - Verify
      parameters:
        - name: serviceSid
          in: path
          required: true
          description: "The service SID: `MG...` for a Messaging Service, `VA...` for a Verify service."
          schema:
            type: string
          example: MG00000000000000000000000000000001
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock verify services delete <serviceSid>
      x-sendmock-mcp: sendmock_verify_service_delete
      x-sendmock-ui: SMS > Verify > Services > Delete
  /api/v1/numbers:
    get:
      operationId: getNumbers
      summary: Fake numbers your app sends from, with their webhooks.
      tags:
        - Numbers
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/VirtualNumber"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock numbers list
      x-sendmock-mcp: sendmock_number_list
      x-sendmock-ui: Numbers
    post:
      operationId: postNumbers
      summary: Add a number.
      tags:
        - Numbers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VirtualNumberInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VirtualNumber"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock numbers add
      x-sendmock-mcp: sendmock_number_upsert
      x-sendmock-ui: Numbers > Add number
  /api/v1/numbers/{numberId}:
    patch:
      operationId: patchNumbersByNumberId
      summary: Change a number.
      tags:
        - Numbers
      parameters:
        - name: numberId
          in: path
          required: true
          description: The virtual number's ID, from `GET /api/v1/numbers`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VirtualNumberInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VirtualNumber"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock numbers update <numberId>
      x-sendmock-mcp: sendmock_number_upsert
      x-sendmock-ui: Numbers > Edit
    delete:
      operationId: deleteNumbersByNumberId
      summary: Delete a number.
      tags:
        - Numbers
      parameters:
        - name: numberId
          in: path
          required: true
          description: The virtual number's ID, from `GET /api/v1/numbers`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock numbers remove <numberId>
      x-sendmock-mcp: sendmock_number_delete
      x-sendmock-ui: Numbers > Delete
  /api/v1/messaging-services:
    get:
      operationId: getMessagingServices
      summary: Messaging Services that pool numbers.
      tags:
        - Numbers
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/MessagingService"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms services list
      x-sendmock-mcp: sendmock_messaging_service_list
      x-sendmock-ui: Numbers > Messaging Services
    post:
      operationId: postMessagingServices
      summary: Add a Messaging Service.
      tags:
        - Numbers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessagingServiceInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessagingService"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms services create
      x-sendmock-mcp: sendmock_messaging_service_create
      x-sendmock-ui: Numbers > Messaging Services > New Messaging Service
  /api/v1/messaging-services/{serviceSid}:
    patch:
      operationId: patchMessagingServicesByServiceSid
      summary: Change a Messaging Service.
      tags:
        - Numbers
      parameters:
        - name: serviceSid
          in: path
          required: true
          description: "The service SID: `MG...` for a Messaging Service, `VA...` for a Verify service."
          schema:
            type: string
          example: MG00000000000000000000000000000001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessagingServiceInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessagingService"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms services update <serviceSid>
      x-sendmock-mcp: sendmock_messaging_service_update
      x-sendmock-ui: Numbers > Messaging Services > Edit
    delete:
      operationId: deleteMessagingServicesByServiceSid
      summary: Delete a Messaging Service.
      tags:
        - Numbers
      parameters:
        - name: serviceSid
          in: path
          required: true
          description: "The service SID: `MG...` for a Messaging Service, `VA...` for a Verify service."
          schema:
            type: string
          example: MG00000000000000000000000000000001
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms services delete <serviceSid>
      x-sendmock-mcp: sendmock_messaging_service_delete
      x-sendmock-ui: Numbers > Messaging Services > Delete
  /api/v1/emails/providers:
    get:
      operationId: getEmailsProviders
      summary: Email providers, built in and custom, removed ones included.
      tags:
        - Email providers
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/MessageProviderDefinition"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers list
      x-sendmock-mcp: sendmock_email_provider_list
      x-sendmock-ui: Mail > Providers
    post:
      operationId: postEmailsProviders
      summary: Add an email provider, blank or copied from another.
      tags:
        - Email providers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageProviderCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers create
      x-sendmock-mcp: sendmock_email_provider_create
      x-sendmock-ui: Mail > Providers > Add provider
  /api/v1/emails/providers/{providerKey}:
    get:
      operationId: getEmailsProvidersByProviderKey
      summary: One provider definition; secret credentials masked.
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers show <providerKey>
      x-sendmock-mcp: sendmock_email_provider_get
      x-sendmock-ui: Mail > Providers > provider
    patch:
      operationId: patchEmailsProvidersByProviderKey
      summary: Change a provider; 400 with the problems for template errors, bad paths or a path clash.
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageProviderInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers update <providerKey>
      x-sendmock-mcp: sendmock_email_provider_update
      x-sendmock-ui: Mail > Providers > provider > Save provider
    delete:
      operationId: deleteEmailsProvidersByProviderKey
      summary: Remove a built-in (restorable) or delete a custom provider; its messages stay.
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers delete <providerKey>
      x-sendmock-mcp: sendmock_email_provider_delete
      x-sendmock-ui: Mail > Providers > provider > Remove or Delete
  /api/v1/emails/providers/{providerKey}/restore:
    post:
      operationId: postEmailsProvidersByProviderKeyRestore
      summary: Bring a removed built-in back as it was.
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers restore <providerKey>
      x-sendmock-mcp: sendmock_email_provider_restore
      x-sendmock-ui: Mail > Providers > Removed > Restore
  /api/v1/emails/providers/{providerKey}/reset:
    post:
      operationId: postEmailsProvidersByProviderKeyReset
      summary: Put a built-in provider back as shipped.
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers reset <providerKey>
      x-sendmock-mcp: sendmock_email_provider_reset
      x-sendmock-ui: Mail > Providers > provider > Reset to default
  /api/v1/emails/providers/{providerKey}/preview:
    post:
      operationId: postEmailsProvidersByProviderKeyPreview
      summary: "Run a sample request through a definition: the message it would store and the answer it would give."
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageProviderPreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderPreview"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers preview <providerKey>
      x-sendmock-mcp: sendmock_email_provider_preview
      x-sendmock-ui: Mail > Providers > provider > Preview
  /api/v1/emails/providers/{providerKey}/credentials/{credentialName}:
    get:
      operationId: getEmailsProvidersByProviderKeyCredentialsByCredentialName
      summary: Reveal one secret credential (asked for after a confirmation).
      tags:
        - Email providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
        - name: credentialName
          in: path
          required: true
          description: The credential's name in the gateway or provider, e.g. `secret_key` or `api_key`.
          schema:
            type: string
          example: secret_key
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProviderCredentialReveal"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock email providers credential <providerKey> <credentialName> --reveal
      x-sendmock-mcp: null
      x-sendmock-mcp-exempt: Agents may set secrets but never read them back; the CLI and UI reveal them after a confirmation.
      x-sendmock-ui: Mail > Providers > provider > General > Reveal
  /api/v1/sms/providers:
    get:
      operationId: getSmsProviders
      summary: SMS providers, built in and custom, removed ones included.
      tags:
        - SMS providers
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/MessageProviderDefinition"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers list
      x-sendmock-mcp: sendmock_sms_provider_list
      x-sendmock-ui: SMS > Providers
    post:
      operationId: postSmsProviders
      summary: Add an SMS provider, blank or copied from another.
      tags:
        - SMS providers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageProviderCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers create
      x-sendmock-mcp: sendmock_sms_provider_create
      x-sendmock-ui: SMS > Providers > Add provider
  /api/v1/sms/providers/{providerKey}:
    get:
      operationId: getSmsProvidersByProviderKey
      summary: One provider definition; secret credentials masked.
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers show <providerKey>
      x-sendmock-mcp: sendmock_sms_provider_get
      x-sendmock-ui: SMS > Providers > provider
    patch:
      operationId: patchSmsProvidersByProviderKey
      summary: Change a provider; 400 with the problems for template errors, bad paths or a path clash.
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageProviderInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers update <providerKey>
      x-sendmock-mcp: sendmock_sms_provider_update
      x-sendmock-ui: SMS > Providers > provider > Save provider
    delete:
      operationId: deleteSmsProvidersByProviderKey
      summary: Remove a built-in (restorable) or delete a custom provider; its messages stay.
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers delete <providerKey>
      x-sendmock-mcp: sendmock_sms_provider_delete
      x-sendmock-ui: SMS > Providers > provider > Remove or Delete
  /api/v1/sms/providers/{providerKey}/restore:
    post:
      operationId: postSmsProvidersByProviderKeyRestore
      summary: Bring a removed built-in back as it was.
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers restore <providerKey>
      x-sendmock-mcp: sendmock_sms_provider_restore
      x-sendmock-ui: SMS > Providers > Removed > Restore
  /api/v1/sms/providers/{providerKey}/reset:
    post:
      operationId: postSmsProvidersByProviderKeyReset
      summary: Put a built-in provider back as shipped.
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers reset <providerKey>
      x-sendmock-mcp: sendmock_sms_provider_reset
      x-sendmock-ui: SMS > Providers > provider > Reset to default
  /api/v1/sms/providers/{providerKey}/preview:
    post:
      operationId: postSmsProvidersByProviderKeyPreview
      summary: "Run a sample request through a definition: the message it would store and the answer it would give."
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageProviderPreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageProviderPreview"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers preview <providerKey>
      x-sendmock-mcp: sendmock_sms_provider_preview
      x-sendmock-ui: SMS > Providers > provider > Preview
  /api/v1/sms/providers/{providerKey}/credentials/{credentialName}:
    get:
      operationId: getSmsProvidersByProviderKeyCredentialsByCredentialName
      summary: Reveal one secret credential (asked for after a confirmation).
      tags:
        - SMS providers
      parameters:
        - name: providerKey
          in: path
          required: true
          description: The email or SMS provider's key, e.g. `sendgrid` or `twilio`, from its providers list.
          schema:
            type: string
          example: twilio
        - name: credentialName
          in: path
          required: true
          description: The credential's name in the gateway or provider, e.g. `secret_key` or `api_key`.
          schema:
            type: string
          example: secret_key
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProviderCredentialReveal"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms providers credential <providerKey> <credentialName> --reveal
      x-sendmock-mcp: null
      x-sendmock-mcp-exempt: Agents may set secrets but never read them back; the CLI and UI reveal them after a confirmation.
      x-sendmock-ui: SMS > Providers > provider > General > Reveal
  /api/v1/sms/whatsapp-cloud/verify-webhook:
    post:
      operationId: postSmsWhatsappCloudVerifyWebhook
      summary: Send Meta's callback URL check to the app and report whether it answered the challenge.
      tags:
        - SMS providers
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WhatsappWebhookVerificationRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WhatsappWebhookVerification"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock sms whatsapp-cloud verify-webhook
      x-sendmock-mcp: sendmock_sms_whatsapp_verify_webhook
      x-sendmock-ui: SMS > Providers > WhatsApp Cloud > Verify callback URL
  /api/v1/http/bins:
    get:
      operationId: getHttpBins
      summary: Bins, each a capture URL with its own responses.
      tags:
        - HTTP Catcher
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/HttpBin"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http bin list
      x-sendmock-mcp: sendmock_http_bin_list
      x-sendmock-ui: HTTP Catcher > bins
    post:
      operationId: postHttpBins
      summary: Add a bin; 409 when the name is taken.
      tags:
        - HTTP Catcher
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HttpBinInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HttpBin"
        "400":
          $ref: "#/components/responses/BadRequest"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http bin create
      x-sendmock-mcp: sendmock_http_bin_create
      x-sendmock-ui: HTTP Catcher > New bin
  /api/v1/http/bins/{binId}:
    patch:
      operationId: patchHttpBinsByBinId
      summary: Change a bin's default response.
      tags:
        - HTTP Catcher
      parameters:
        - name: binId
          in: path
          required: true
          description: The HTTP bin's ID, from `GET /api/v1/http/bins`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HttpBinUpdate"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HttpBin"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http bin update <binId>
      x-sendmock-mcp: sendmock_http_bin_update
      x-sendmock-ui: HTTP Catcher > bin > Responses > Edit default reply
    delete:
      operationId: deleteHttpBinsByBinId
      summary: Delete a bin and its requests.
      tags:
        - HTTP Catcher
      parameters:
        - name: binId
          in: path
          required: true
          description: The HTTP bin's ID, from `GET /api/v1/http/bins`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http bin delete <binId>
      x-sendmock-mcp: sendmock_http_bin_delete
      x-sendmock-ui: HTTP Catcher > bin > Delete bin
  /api/v1/http/bins/{binId}/responses:
    get:
      operationId: getHttpBinsByBinIdResponses
      summary: A bin's response rules, checked from top to bottom.
      tags:
        - HTTP Catcher
      parameters:
        - name: binId
          in: path
          required: true
          description: The HTTP bin's ID, from `GET /api/v1/http/bins`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/HttpResponseRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http response list <binId>
      x-sendmock-mcp: sendmock_http_response_list
      x-sendmock-ui: HTTP Catcher > bin > Responses
    put:
      operationId: putHttpBinsByBinIdResponses
      summary: Replace a bin's response rules.
      tags:
        - HTTP Catcher
      parameters:
        - name: binId
          in: path
          required: true
          description: The HTTP bin's ID, from `GET /api/v1/http/bins`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/HttpResponseRule"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/HttpResponseRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http response set <binId>
      x-sendmock-mcp: sendmock_http_response_set
      x-sendmock-ui: HTTP Catcher > bin > Responses > Add rule, edit, move, enabled switch
  /api/v1/http/bins/{binId}/responses/preview:
    post:
      operationId: postHttpBinsByBinIdResponsesPreview
      summary: Which rule a captured request would match, and its answer.
      tags:
        - HTTP Catcher
      parameters:
        - name: binId
          in: path
          required: true
          description: The HTTP bin's ID, from `GET /api/v1/http/bins`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HttpRulePreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HttpRulePreviewResult"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http response preview <binId>
      x-sendmock-mcp: sendmock_http_response_preview
      x-sendmock-ui: HTTP Catcher > bin > Responses > rule sheet > Preview
  /api/v1/http/requests:
    get:
      operationId: getHttpRequests
      summary: Captured requests, newest first.
      tags:
        - HTTP Catcher
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: bin_id
          in: query
          required: false
          description: Only this bin.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_CapturedHttpRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http list
      x-sendmock-mcp: sendmock_http_list
      x-sendmock-ui: HTTP Catcher > Requests
    delete:
      operationId: deleteHttpRequests
      summary: Delete captured requests, all or one bin's.
      tags:
        - HTTP Catcher
      parameters:
        - name: bin_id
          in: query
          required: false
          description: Only this bin.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http clear
      x-sendmock-mcp: sendmock_http_clear
      x-sendmock-ui: HTTP Catcher > bin > Clear requests
  /api/v1/http/requests/{requestId}:
    get:
      operationId: getHttpRequestsByRequestId
      summary: One captured request and what SendMock answered.
      tags:
        - HTTP Catcher
      parameters:
        - name: requestId
          in: path
          required: true
          description: The captured request's ID, from `GET /api/v1/http/requests` or `GET /api/v1/logs/http`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapturedHttpRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http show <requestId>
      x-sendmock-mcp: sendmock_http_get
      x-sendmock-ui: HTTP Catcher > open a request
  /api/v1/http/requests/{requestId}/files/{fileIndex}:
    get:
      operationId: getHttpRequestsByRequestIdFilesByFileIndex
      summary: Download a file uploaded in a captured request.
      tags:
        - HTTP Catcher
      parameters:
        - name: requestId
          in: path
          required: true
          description: The captured request's ID, from `GET /api/v1/http/requests` or `GET /api/v1/logs/http`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: fileIndex
          in: path
          required: true
          description: Position of the uploaded file in the request's `files`, starting at 0.
          schema:
            type: integer
          example: 0
      responses:
        "200":
          description: OK.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http file <requestId> <fileIndex>
      x-sendmock-mcp: sendmock://http/requests/{requestId}/files/{fileIndex}
      x-sendmock-ui: HTTP Catcher > request > Body > files
  /api/v1/http/requests/{requestId}/forward:
    post:
      operationId: postHttpRequestsByRequestIdForward
      summary: Send a captured request on to another URL.
      tags:
        - HTTP Catcher
      parameters:
        - name: requestId
          in: path
          required: true
          description: The captured request's ID, from `GET /api/v1/http/requests` or `GET /api/v1/logs/http`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HttpForwardRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HttpForwardResult"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http forward <requestId>
      x-sendmock-mcp: sendmock_http_forward
      x-sendmock-ui: HTTP Catcher > request > Forward to URL
  /catch/{binPath}:
    get:
      operationId: getCatchByBinPath
      summary: Capture a request in a bin and answer with its matching response rule or default response.
      tags:
        - HTTP Catcher
      parameters:
        - name: binPath
          in: path
          required: true
          description: The bin's name, then any path your app adds, e.g. `slack/services/T000/B000`.
          schema:
            type: string
          example: slack
      responses:
        "200":
          description: OK.
          content:
            "*/*":
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http send <bin>
      x-sendmock-mcp: sendmock_http_send
      x-sendmock-ui: HTTP Catcher > Send a sample request
    post:
      operationId: postCatchByBinPath
      summary: Capture a request in a bin and answer with its matching response rule or default response.
      tags:
        - HTTP Catcher
      parameters:
        - name: binPath
          in: path
          required: true
          description: The bin's name, then any path your app adds, e.g. `slack/services/T000/B000`.
          schema:
            type: string
          example: slack
      requestBody:
        required: true
        content:
          "*/*":
            schema:
              type: string
              format: binary
      responses:
        "200":
          description: OK.
          content:
            "*/*":
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http send <bin>
      x-sendmock-mcp: sendmock_http_send
      x-sendmock-ui: HTTP Catcher > Send a sample request
    put:
      operationId: putCatchByBinPath
      summary: Capture a request in a bin and answer with its matching response rule or default response.
      tags:
        - HTTP Catcher
      parameters:
        - name: binPath
          in: path
          required: true
          description: The bin's name, then any path your app adds, e.g. `slack/services/T000/B000`.
          schema:
            type: string
          example: slack
      requestBody:
        required: true
        content:
          "*/*":
            schema:
              type: string
              format: binary
      responses:
        "200":
          description: OK.
          content:
            "*/*":
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http send <bin>
      x-sendmock-mcp: sendmock_http_send
      x-sendmock-ui: HTTP Catcher > Send a sample request
    patch:
      operationId: patchCatchByBinPath
      summary: Capture a request in a bin and answer with its matching response rule or default response.
      tags:
        - HTTP Catcher
      parameters:
        - name: binPath
          in: path
          required: true
          description: The bin's name, then any path your app adds, e.g. `slack/services/T000/B000`.
          schema:
            type: string
          example: slack
      requestBody:
        required: true
        content:
          "*/*":
            schema:
              type: string
              format: binary
      responses:
        "200":
          description: OK.
          content:
            "*/*":
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http send <bin>
      x-sendmock-mcp: sendmock_http_send
      x-sendmock-ui: HTTP Catcher > Send a sample request
    delete:
      operationId: deleteCatchByBinPath
      summary: Capture a request in a bin and answer with its matching response rule or default response.
      tags:
        - HTTP Catcher
      parameters:
        - name: binPath
          in: path
          required: true
          description: The bin's name, then any path your app adds, e.g. `slack/services/T000/B000`.
          schema:
            type: string
          example: slack
      responses:
        "200":
          description: OK.
          content:
            "*/*":
              schema:
                type: string
                format: binary
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock http send <bin>
      x-sendmock-mcp: sendmock_http_send
      x-sendmock-ui: HTTP Catcher > Send a sample request
  /api/v1/payments:
    get:
      operationId: getPayments
      summary: Test payments, newest first, with filters.
      tags:
        - Payments
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: status
          in: query
          required: false
          description: succeeded, pending, failed, refunded or disputed.
          schema:
            type: string
          example: succeeded
        - name: provider
          in: query
          required: false
          description: Gateway key.
          schema:
            type: string
          example: stripe
        - name: currency
          in: query
          required: false
          description: ISO 4217 code.
          schema:
            type: string
          example: USD
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_PaymentSummary"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments list
      x-sendmock-mcp: sendmock_payment_list
      x-sendmock-ui: Payments
    post:
      operationId: postPayments
      summary: Create a payment and pay it with a test card, as an app's server does without a checkout page.
      tags:
        - Payments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments create
      x-sendmock-mcp: sendmock_payment_create
      x-sendmock-ui: Payments > New payment
  /api/v1/payments/test-cards:
    get:
      operationId: getPaymentsTestCards
      summary: The test values of every enabled payment method.
      tags:
        - Payments
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentMethodDefinition"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments test-cards
      x-sendmock-mcp: sendmock_payment_test_cards
      x-sendmock-ui: Settings > Payments > Test values
  /api/v1/payments/{paymentId}:
    get:
      operationId: getPaymentsByPaymentId
      summary: One payment with line items, timeline, redirects and notifications.
      tags:
        - Payments
      parameters:
        - name: paymentId
          in: path
          required: true
          description: The payment's ID, from `GET /api/v1/payments`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments show <paymentId>
      x-sendmock-mcp: sendmock_payment_get
      x-sendmock-ui: Payments > open payment
  /api/v1/payments/{paymentId}/notify:
    post:
      operationId: postPaymentsByPaymentIdNotify
      summary: Send the payment's notification (IPN or webhook) again.
      tags:
        - Payments
      parameters:
        - name: paymentId
          in: path
          required: true
          description: The payment's ID, from `GET /api/v1/payments`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments notify <paymentId>
      x-sendmock-mcp: sendmock_payment_notify
      x-sendmock-ui: Payments > payment > Resend notification
  /api/v1/payments/{paymentId}/simulate:
    post:
      operationId: postPaymentsByPaymentIdSimulate
      summary: "Move the payment on: capture, refund, dispute, fail."
      tags:
        - Payments
      parameters:
        - name: paymentId
          in: path
          required: true
          description: The payment's ID, from `GET /api/v1/payments`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentSimulateRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments simulate <paymentId> <action>
      x-sendmock-mcp: sendmock_payment_simulate
      x-sendmock-ui: Payments > payment > Simulate
  /api/v1/payments/checkout:
    post:
      operationId: postPaymentsCheckout
      summary: Start a hosted checkout on a gateway and get its payment page URL.
      tags:
        - Payments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentCheckoutCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments checkout create
      x-sendmock-mcp: sendmock_payment_create_checkout
      x-sendmock-ui: Payments > Gateways > gateway > Checkout > Open a test checkout
  /api/v1/payments/subscriptions:
    get:
      operationId: getPaymentsSubscriptions
      summary: Subscriptions, newest first.
      tags:
        - Payments
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentSubscription"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments subscriptions list
      x-sendmock-mcp: sendmock_subscription_list
      x-sendmock-ui: Payments > Subscriptions
    post:
      operationId: postPaymentsSubscriptions
      summary: Start a subscription on a gateway, with an optional trial.
      tags:
        - Payments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentSubscriptionCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentSubscription"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments subscriptions create
      x-sendmock-mcp: sendmock_subscription_create
      x-sendmock-ui: Payments > Subscriptions > New subscription
  /api/v1/payments/subscriptions/{subscriptionId}:
    get:
      operationId: getPaymentsSubscriptionsBySubscriptionId
      summary: One subscription with its timeline and renewal payments.
      tags:
        - Payments
      parameters:
        - name: subscriptionId
          in: path
          required: true
          description: The subscription's ID, from `GET /api/v1/payments/subscriptions`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentSubscription"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments subscriptions show <subscriptionId>
      x-sendmock-mcp: sendmock_subscription_get
      x-sendmock-ui: Payments > Subscriptions > open subscription
  /api/v1/payments/subscriptions/{subscriptionId}/advance:
    post:
      operationId: postPaymentsSubscriptionsBySubscriptionIdAdvance
      summary: Move the subscription's clock to its next renewal and charge it.
      tags:
        - Payments
      parameters:
        - name: subscriptionId
          in: path
          required: true
          description: The subscription's ID, from `GET /api/v1/payments/subscriptions`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentSubscription"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments subscriptions advance <subscriptionId>
      x-sendmock-mcp: sendmock_subscription_advance
      x-sendmock-ui: Payments > Subscriptions > Advance to renewal
  /api/v1/payments/subscriptions/{subscriptionId}/cancel:
    post:
      operationId: postPaymentsSubscriptionsBySubscriptionIdCancel
      summary: Cancel the subscription now or at the end of its period.
      tags:
        - Payments
      parameters:
        - name: subscriptionId
          in: path
          required: true
          description: The subscription's ID, from `GET /api/v1/payments/subscriptions`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentSubscriptionCancelRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentSubscription"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments subscriptions cancel <subscriptionId>
      x-sendmock-mcp: sendmock_subscription_cancel
      x-sendmock-ui: Payments > Subscriptions > Cancel
  /api/v1/checkout-sessions/{sessionId}:
    get:
      operationId: getCheckoutSessionsBySessionId
      summary: "What a test checkout page shows: order, methods and flows."
      tags:
        - Checkout
      parameters:
        - name: sessionId
          in: path
          required: true
          description: The SMTP session's ID, from `GET /api/v1/logs/smtp`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CheckoutSession"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments checkout show <sessionId>
      x-sendmock-mcp: sendmock_checkout_get
      x-sendmock-ui: Test checkout page
  /api/v1/checkout-sessions/{sessionId}/complete:
    post:
      operationId: postCheckoutSessionsBySessionIdComplete
      summary: Pay, decline or cancel from the checkout page.
      tags:
        - Checkout
      parameters:
        - name: sessionId
          in: path
          required: true
          description: The SMTP session's ID, from `GET /api/v1/logs/smtp`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CheckoutCompleteRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CheckoutSession"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments checkout complete <sessionId> <action>
      x-sendmock-mcp: sendmock_checkout_complete
      x-sendmock-ui: Test checkout page > pay, Test controls
  /api/v1/payments/flows:
    get:
      operationId: getPaymentsFlows
      summary: "Flows: the steps a checkout page runs for a method."
      tags:
        - Payment flows
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentFlowDefinition"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows list
      x-sendmock-mcp: sendmock_payment_flow_list
      x-sendmock-ui: Payments > Flows
    post:
      operationId: postPaymentsFlows
      summary: Add a flow.
      tags:
        - Payment flows
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentFlowInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows create
      x-sendmock-mcp: sendmock_payment_flow_create
      x-sendmock-ui: Payments > Flows > Add flow
  /api/v1/payments/flows/{flowKey}:
    get:
      operationId: getPaymentsFlowsByFlowKey
      summary: One payment flow with its steps.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows show <flowKey>
      x-sendmock-mcp: sendmock_payment_flow_get
      x-sendmock-ui: Payments > Flows > Edit
    patch:
      operationId: patchPaymentsFlowsByFlowKey
      summary: Change a flow.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentFlowInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows update <flowKey>
      x-sendmock-mcp: sendmock_payment_flow_update
      x-sendmock-ui: Payments > Flows > flow > Save flow
    delete:
      operationId: deletePaymentsFlowsByFlowKey
      summary: Delete a custom flow; 409 while a method uses it.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows delete <flowKey>
      x-sendmock-mcp: sendmock_payment_flow_delete
      x-sendmock-ui: Payments > Flows > flow > Delete
  /api/v1/payments/flows/{flowKey}/reset:
    post:
      operationId: postPaymentsFlowsByFlowKeyReset
      summary: Put a built-in flow back as shipped.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows reset <flowKey>
      x-sendmock-mcp: sendmock_payment_flow_reset
      x-sendmock-ui: Payments > Flows > flow > Reset to default
  /api/v1/payments/flows/{flowKey}/steps:
    post:
      operationId: postPaymentsFlowsByFlowKeySteps
      summary: Add a step to a flow.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentFlowStepAddRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows steps add <flowKey>
      x-sendmock-mcp: sendmock_payment_flow_step_add
      x-sendmock-ui: Payments > Flows > flow > Add step
  /api/v1/payments/flows/{flowKey}/steps/{stepIndex}:
    patch:
      operationId: patchPaymentsFlowsByFlowKeyStepsByStepIndex
      summary: Change one step of a flow.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
        - name: stepIndex
          in: path
          required: true
          description: Position of the step in the flow, starting at 0.
          schema:
            type: integer
          example: 0
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentFlowStepUpdateRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows steps update <flowKey> <stepIndex>
      x-sendmock-mcp: sendmock_payment_flow_step_update
      x-sendmock-ui: Payments > Flows > flow > step labels, Move up, Move down
    delete:
      operationId: deletePaymentsFlowsByFlowKeyStepsByStepIndex
      summary: Remove one step of a flow.
      tags:
        - Payment flows
      parameters:
        - name: flowKey
          in: path
          required: true
          description: The payment flow's key, e.g. `card` or `wallet`.
          schema:
            type: string
          example: card
        - name: stepIndex
          in: path
          required: true
          description: Position of the step in the flow, starting at 0.
          schema:
            type: integer
          example: 0
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentFlowDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows steps remove <flowKey> <stepIndex>
      x-sendmock-mcp: sendmock_payment_flow_step_remove
      x-sendmock-ui: Payments > Flows > flow > Remove step
  /api/v1/payments/step-types:
    get:
      operationId: getPaymentsStepTypes
      summary: The step types a flow can use, with their fields.
      tags:
        - Payment flows
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentStepTypeInfo"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows step-types
      x-sendmock-mcp: sendmock_payment_step_type_list
      x-sendmock-ui: Payments > Flows > flow > Add step menu
  /api/v1/payments/flow-variables:
    get:
      operationId: getPaymentsFlowVariables
      summary: The variables a step label can use.
      tags:
        - Payment flows
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentFlowVariable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments flows variables
      x-sendmock-mcp: sendmock_payment_flow_variable_list
      x-sendmock-ui: Payments > Flows > flow > Label variables
  /api/v1/payments/gateways:
    get:
      operationId: getPaymentsGateways
      summary: Gateways with their checkout, redirect and notification setup.
      tags:
        - Payment gateways
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentGatewayDefinition"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways list
      x-sendmock-mcp: sendmock_payment_gateway_list
      x-sendmock-ui: Payments > Gateways
    post:
      operationId: postPaymentsGateways
      summary: Add a custom gateway.
      tags:
        - Payment gateways
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentGatewayCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentGatewayDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways create
      x-sendmock-mcp: sendmock_payment_gateway_create
      x-sendmock-ui: Payments > Gateways > Add gateway
  /api/v1/payments/gateways/{gatewayKey}:
    get:
      operationId: getPaymentsGatewaysByGatewayKey
      summary: One gateway definition; secret credentials masked.
      tags:
        - Payment gateways
      parameters:
        - name: gatewayKey
          in: path
          required: true
          description: The payment gateway's key, e.g. `stripe` or `sslcommerz`.
          schema:
            type: string
          example: stripe
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentGatewayDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways show <gatewayKey>
      x-sendmock-mcp: sendmock_payment_gateway_get
      x-sendmock-ui: Payments > Gateways > Edit
    patch:
      operationId: patchPaymentsGatewaysByGatewayKey
      summary: Change a gateway; secret credentials stay masked.
      tags:
        - Payment gateways
      parameters:
        - name: gatewayKey
          in: path
          required: true
          description: The payment gateway's key, e.g. `stripe` or `sslcommerz`.
          schema:
            type: string
          example: stripe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentGatewayInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentGatewayDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways update <gatewayKey>
      x-sendmock-mcp: sendmock_payment_gateway_update
      x-sendmock-ui: Payments > Gateways > gateway > Save gateway
    delete:
      operationId: deletePaymentsGatewaysByGatewayKey
      summary: Delete a custom gateway; 409 while payments use it.
      tags:
        - Payment gateways
      parameters:
        - name: gatewayKey
          in: path
          required: true
          description: The payment gateway's key, e.g. `stripe` or `sslcommerz`.
          schema:
            type: string
          example: stripe
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways delete <gatewayKey>
      x-sendmock-mcp: sendmock_payment_gateway_delete
      x-sendmock-ui: Payments > Gateways > gateway > Delete
  /api/v1/payments/gateways/{gatewayKey}/reset:
    post:
      operationId: postPaymentsGatewaysByGatewayKeyReset
      summary: Put a built-in gateway back as shipped.
      tags:
        - Payment gateways
      parameters:
        - name: gatewayKey
          in: path
          required: true
          description: The payment gateway's key, e.g. `stripe` or `sslcommerz`.
          schema:
            type: string
          example: stripe
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentGatewayDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways reset <gatewayKey>
      x-sendmock-mcp: sendmock_payment_gateway_reset
      x-sendmock-ui: Payments > Gateways > gateway > Reset to default
  /api/v1/payments/gateways/{gatewayKey}/preview:
    post:
      operationId: postPaymentsGatewaysByGatewayKeyPreview
      summary: Render a gateway's redirect and notification for a payment.
      tags:
        - Payment gateways
      parameters:
        - name: gatewayKey
          in: path
          required: true
          description: The payment gateway's key, e.g. `stripe` or `sslcommerz`.
          schema:
            type: string
          example: stripe
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentGatewayPreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentGatewayPreview"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways preview <gatewayKey>
      x-sendmock-mcp: sendmock_payment_gateway_preview
      x-sendmock-ui: Payments > Gateways > gateway > Redirect, Notification preview
  /api/v1/payments/gateways/{gatewayKey}/credentials/{credentialName}:
    get:
      operationId: getPaymentsGatewaysByGatewayKeyCredentialsByCredentialName
      summary: Reveal one secret credential (asked for after a confirmation).
      tags:
        - Payment gateways
      parameters:
        - name: gatewayKey
          in: path
          required: true
          description: The payment gateway's key, e.g. `stripe` or `sslcommerz`.
          schema:
            type: string
          example: stripe
        - name: credentialName
          in: path
          required: true
          description: The credential's name in the gateway or provider, e.g. `secret_key` or `api_key`.
          schema:
            type: string
          example: secret_key
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GatewayCredentialReveal"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments gateways credential <gatewayKey> <credentialName> --reveal
      x-sendmock-mcp: null
      x-sendmock-mcp-exempt: Agents may set secrets but never read them back; the CLI and UI reveal them after a confirmation.
      x-sendmock-ui: Payments > Gateways > gateway > Merchant > Reveal
  /api/v1/payments/methods:
    get:
      operationId: getPaymentsMethods
      summary: Methods customers pay with, and their test values.
      tags:
        - Payment methods
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentMethodDefinition"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments methods list
      x-sendmock-mcp: sendmock_payment_method_list
      x-sendmock-ui: Payments > Methods
    post:
      operationId: postPaymentsMethods
      summary: Add a custom method.
      tags:
        - Payment methods
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentMethodInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentMethodDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments methods create
      x-sendmock-mcp: sendmock_payment_method_create
      x-sendmock-ui: Payments > Methods > Add method
  /api/v1/payments/methods/{methodKey}:
    get:
      operationId: getPaymentsMethodsByMethodKey
      summary: One payment method with its test values.
      tags:
        - Payment methods
      parameters:
        - name: methodKey
          in: path
          required: true
          description: The payment method's key, e.g. `bkash` or `card`.
          schema:
            type: string
          example: bkash
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentMethodDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments methods show <methodKey>
      x-sendmock-mcp: sendmock_payment_method_get
      x-sendmock-ui: Payments > Methods > Edit
    patch:
      operationId: patchPaymentsMethodsByMethodKey
      summary: Change a method.
      tags:
        - Payment methods
      parameters:
        - name: methodKey
          in: path
          required: true
          description: The payment method's key, e.g. `bkash` or `card`.
          schema:
            type: string
          example: bkash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentMethodInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentMethodDefinition"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments methods update <methodKey>
      x-sendmock-mcp: sendmock_payment_method_update
      x-sendmock-ui: Payments > Methods > method > Save method, enabled switch
    delete:
      operationId: deletePaymentsMethodsByMethodKey
      summary: Delete a custom method; 409 while a gateway offers it.
      tags:
        - Payment methods
      parameters:
        - name: methodKey
          in: path
          required: true
          description: The payment method's key, e.g. `bkash` or `card`.
          schema:
            type: string
          example: bkash
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments methods delete <methodKey>
      x-sendmock-mcp: sendmock_payment_method_delete
      x-sendmock-ui: Payments > Methods > method > Delete
  /api/v1/payments/methods/{methodKey}/reset:
    post:
      operationId: postPaymentsMethodsByMethodKeyReset
      summary: Put a built-in method back as shipped.
      tags:
        - Payment methods
      parameters:
        - name: methodKey
          in: path
          required: true
          description: The payment method's key, e.g. `bkash` or `card`.
          schema:
            type: string
          example: bkash
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentMethodDefinition"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock payments methods reset <methodKey>
      x-sendmock-mcp: sendmock_payment_method_reset
      x-sendmock-ui: Payments > Methods > method > Reset to default
  /api/v1/webhooks/endpoints:
    get:
      operationId: getWebhooksEndpoints
      summary: "Where webhooks go: URL, template, secret and retry policy."
      tags:
        - Webhook endpoints
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WebhookEndpoint"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint list
      x-sendmock-mcp: sendmock_webhook_endpoint_list
      x-sendmock-ui: Webhooks > Endpoints
    post:
      operationId: postWebhooksEndpoints
      summary: Add an endpoint; its signing secret is generated.
      tags:
        - Webhook endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookEndpointInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookEndpoint"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint create
      x-sendmock-mcp: sendmock_webhook_endpoint_create
      x-sendmock-ui: Webhooks > Endpoints > Add endpoint
  /api/v1/webhooks/endpoints/{endpointId}:
    get:
      operationId: getWebhooksEndpointsByEndpointId
      summary: One endpoint; its secret masked.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookEndpoint"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint show <endpointId>
      x-sendmock-mcp: sendmock_webhook_endpoint_get
      x-sendmock-ui: Webhooks > Endpoints > Edit
    patch:
      operationId: patchWebhooksEndpointsByEndpointId
      summary: Change an endpoint; send only the changed keys.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookEndpointInputPatch"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookEndpoint"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint update <endpointId>
      x-sendmock-mcp: sendmock_webhook_endpoint_update
      x-sendmock-ui: Webhooks > Endpoints > endpoint > Save changes, enabled switch
    delete:
      operationId: deleteWebhooksEndpointsByEndpointId
      summary: Delete an endpoint and its rules.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint delete <endpointId>
      x-sendmock-mcp: sendmock_webhook_endpoint_delete
      x-sendmock-ui: Webhooks > Endpoints > Delete
  /api/v1/webhooks/endpoints/preview:
    post:
      operationId: postWebhooksEndpointsPreview
      summary: Render an unsaved endpoint's request against a message.
      tags:
        - Webhook endpoints
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EndpointPreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EndpointPreviewResult"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook render --endpoint-id <endpointId>
      x-sendmock-mcp: sendmock_webhook_render
      x-sendmock-ui: Webhooks > Endpoints > endpoint > Request preview; Send to webhook > Preview
  /api/v1/webhooks/endpoints/{endpointId}/secret:
    get:
      operationId: getWebhooksEndpointsByEndpointIdSecret
      summary: Reveal the signing secret (asked for after a confirmation).
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RevealedEndpointSecret"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint secret <endpointId> --reveal
      x-sendmock-mcp: null
      x-sendmock-mcp-exempt: Agents may set secrets but never read them back; the CLI and UI reveal them after a confirmation.
      x-sendmock-ui: Webhooks > Endpoints > endpoint > Security > Reveal
  /api/v1/webhooks/endpoints/{endpointId}/rotate-secret:
    post:
      operationId: postWebhooksEndpointsByEndpointIdRotateSecret
      summary: New signing secret; the old one keeps working for the overlap.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RotateSecretRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookEndpoint"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint rotate-secret <endpointId>
      x-sendmock-mcp: sendmock_webhook_endpoint_rotate_secret
      x-sendmock-ui: Webhooks > Endpoints > endpoint > Security > Rotate secret
  /api/v1/webhooks/endpoints/{endpointId}/save-as-template:
    post:
      operationId: postWebhooksEndpointsByEndpointIdSaveAsTemplate
      summary: Save the endpoint's request as a custom template.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SaveAsTemplateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateSummary"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint save-as-template <endpointId>
      x-sendmock-mcp: sendmock_webhook_endpoint_save_as_template
      x-sendmock-ui: Webhooks > Endpoints > endpoint > Request > Save as template
  /api/v1/webhooks/endpoints/{endpointId}/send:
    post:
      operationId: postWebhooksEndpointsByEndpointIdSend
      summary: Send a webhook for a chosen message or the sample, by hand.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ManualSendRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDelivery"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook send --endpoint <endpointId>
      x-sendmock-mcp: sendmock_webhook_send
      x-sendmock-ui: Mail, SMS, HTTP > Send to webhook; Webhooks > Composer > Send
  /api/v1/webhooks/endpoints/{endpointId}/test:
    post:
      operationId: postWebhooksEndpointsByEndpointIdTest
      summary: Send a test.ping delivery.
      tags:
        - Webhook endpoints
      parameters:
        - name: endpointId
          in: path
          required: true
          description: The webhook endpoint's ID, from `GET /api/v1/webhooks/endpoints`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDelivery"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook endpoint test <endpointId>
      x-sendmock-mcp: sendmock_webhook_endpoint_test
      x-sendmock-ui: Webhooks > Endpoints > Send test
  /api/v1/webhooks/rules:
    get:
      operationId: getWebhooksRules
      summary: Which events go to which endpoint, checked from top to bottom.
      tags:
        - Webhook rules
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WebhookRule"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule list
      x-sendmock-mcp: sendmock_webhook_rule_list
      x-sendmock-ui: Webhooks > Rules
    post:
      operationId: postWebhooksRules
      summary: Add a rule.
      tags:
        - Webhook rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookRuleInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule create
      x-sendmock-mcp: sendmock_webhook_rule_create
      x-sendmock-ui: Webhooks > Rules > Add rule
  /api/v1/webhooks/rules/{ruleId}:
    get:
      operationId: getWebhooksRulesByRuleId
      summary: One webhook rule with its filter.
      tags:
        - Webhook rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule show <ruleId>
      x-sendmock-mcp: sendmock_webhook_rule_get
      x-sendmock-ui: Webhooks > Rules > Edit
    patch:
      operationId: patchWebhooksRulesByRuleId
      summary: Change a rule; send only the changed keys.
      tags:
        - Webhook rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookRuleInputPatch"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookRule"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule update <ruleId>
      x-sendmock-mcp: sendmock_webhook_rule_update
      x-sendmock-ui: Webhooks > Rules > rule > Save changes, enabled switch
    delete:
      operationId: deleteWebhooksRulesByRuleId
      summary: Delete a rule.
      tags:
        - Webhook rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule delete <ruleId>
      x-sendmock-mcp: sendmock_webhook_rule_delete
      x-sendmock-ui: Webhooks > Rules > Delete
  /api/v1/webhooks/rules/{ruleId}/move:
    post:
      operationId: postWebhooksRulesByRuleIdMove
      summary: Move a rule up or down; answers the reordered list.
      tags:
        - Webhook rules
      parameters:
        - name: ruleId
          in: path
          required: true
          description: The rule's ID, from the list of rules of the same kind.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookRuleMove"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WebhookRule"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule move <ruleId>
      x-sendmock-mcp: sendmock_webhook_rule_move
      x-sendmock-ui: Webhooks > Rules > Move up, Move down
  /api/v1/webhooks/rules/preview:
    post:
      operationId: postWebhooksRulesPreview
      summary: Which recent messages an unsaved rule would match.
      tags:
        - Webhook rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RulePreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RulePreviewResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule preview
      x-sendmock-mcp: sendmock_webhook_rule_preview
      x-sendmock-ui: Webhooks > Rules > rule sheet > Preview
  /api/v1/webhooks/rules/match:
    post:
      operationId: postWebhooksRulesMatch
      summary: Which webhooks an event would trigger, before an action fires it.
      tags:
        - Webhook rules
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookRuleMatchRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookRuleMatchResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook rule match
      x-sendmock-mcp: sendmock_webhook_rule_match
      x-sendmock-ui: Webhooks row and menu hints on every simulating action; Payload on each webhook
  /api/v1/webhooks/deliveries:
    get:
      operationId: getWebhooksDeliveries
      summary: Every webhook request sent, newest first.
      tags:
        - Webhook deliveries
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: status
          in: query
          required: false
          description: succeeded, failed or pending.
          schema:
            type: string
          example: failed
        - name: endpoint_id
          in: query
          required: false
          description: Only this endpoint.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: event_type
          in: query
          required: false
          description: Only this event.
          schema:
            $ref: "#/components/schemas/AppEventType"
          example: email.received
        - name: subject_id
          in: query
          required: false
          description: Only the deliveries an email, SMS or other message caused, by its ID.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9E
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_WebhookDelivery"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook deliveries list
      x-sendmock-mcp: sendmock_webhook_delivery_list
      x-sendmock-ui: Webhooks > Deliveries
  /api/v1/webhooks/deliveries/{deliveryId}:
    get:
      operationId: getWebhooksDeliveriesByDeliveryId
      summary: "One delivery: request, response and every attempt."
      tags:
        - Webhook deliveries
      parameters:
        - name: deliveryId
          in: path
          required: true
          description: The webhook delivery's ID, from `GET /api/v1/webhooks/deliveries`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDeliveryDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook deliveries show <deliveryId>
      x-sendmock-mcp: sendmock_webhook_delivery_get
      x-sendmock-ui: Webhooks > Deliveries > open a delivery
  /api/v1/webhooks/deliveries/{deliveryId}/cancel:
    post:
      operationId: postWebhooksDeliveriesByDeliveryIdCancel
      summary: Stop the remaining retries.
      tags:
        - Webhook deliveries
      parameters:
        - name: deliveryId
          in: path
          required: true
          description: The webhook delivery's ID, from `GET /api/v1/webhooks/deliveries`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDeliveryDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook deliveries cancel <deliveryId>
      x-sendmock-mcp: sendmock_webhook_delivery_cancel
      x-sendmock-ui: Webhooks > Deliveries > delivery > Cancel retries
  /api/v1/webhooks/deliveries/{deliveryId}/replay:
    post:
      operationId: postWebhooksDeliveriesByDeliveryIdReplay
      summary: Send the delivery again, as it was or edited.
      tags:
        - Webhook deliveries
      parameters:
        - name: deliveryId
          in: path
          required: true
          description: The webhook delivery's ID, from `GET /api/v1/webhooks/deliveries`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeliveryReplayRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDelivery"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook deliveries replay <deliveryId>
      x-sendmock-mcp: sendmock_webhook_delivery_replay
      x-sendmock-ui: Webhooks > Deliveries > delivery > Replay, Edit and replay
  /api/v1/webhooks/metrics:
    get:
      operationId: getWebhooksMetrics
      summary: Volume, success rate, latency and failures over a range.
      tags:
        - Webhook deliveries
      parameters:
        - name: range
          in: query
          required: true
          description: 24h or 7d.
          schema:
            $ref: "#/components/schemas/WebhookMetricsRange"
          example: 24h
        - name: endpoint_id
          in: query
          required: false
          description: Only this endpoint.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookMetrics"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook metrics
      x-sendmock-mcp: sendmock_webhook_metrics
      x-sendmock-ui: Webhooks > Overview
  /api/v1/webhooks/saved:
    get:
      operationId: getWebhooksSaved
      summary: Bookmarked requests, kept through pruning and reset.
      tags:
        - Saved deliveries
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/SavedDelivery"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook saved list
      x-sendmock-mcp: sendmock_webhook_saved_list
      x-sendmock-ui: Webhooks > Saved
    post:
      operationId: postWebhooksSaved
      summary: Save a delivery's request under a name.
      tags:
        - Saved deliveries
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SavedDeliveryInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SavedDelivery"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook saved create --delivery <deliveryId>
      x-sendmock-mcp: sendmock_webhook_saved_create
      x-sendmock-ui: Webhooks > Deliveries > delivery > Save
  /api/v1/webhooks/saved/{savedId}:
    patch:
      operationId: patchWebhooksSavedBySavedId
      summary: Rename a saved delivery.
      tags:
        - Saved deliveries
      parameters:
        - name: savedId
          in: path
          required: true
          description: The saved delivery's ID, from `GET /api/v1/webhooks/saved`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SavedDeliveryRename"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SavedDelivery"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook saved rename <savedId>
      x-sendmock-mcp: sendmock_webhook_saved_update
      x-sendmock-ui: Webhooks > Saved > Rename
    delete:
      operationId: deleteWebhooksSavedBySavedId
      summary: Delete a saved delivery.
      tags:
        - Saved deliveries
      parameters:
        - name: savedId
          in: path
          required: true
          description: The saved delivery's ID, from `GET /api/v1/webhooks/saved`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook saved delete <savedId>
      x-sendmock-mcp: sendmock_webhook_saved_delete
      x-sendmock-ui: Webhooks > Saved > Delete
  /api/v1/webhooks/saved/{savedId}/send:
    post:
      operationId: postWebhooksSavedBySavedIdSend
      summary: Send a saved request to its endpoint or another one.
      tags:
        - Saved deliveries
      parameters:
        - name: savedId
          in: path
          required: true
          description: The saved delivery's ID, from `GET /api/v1/webhooks/saved`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SavedDeliverySendRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookDelivery"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook saved send <savedId>
      x-sendmock-mcp: sendmock_webhook_saved_send
      x-sendmock-ui: Webhooks > Saved > Send
  /api/v1/webhooks/saved/{savedId}/template:
    post:
      operationId: postWebhooksSavedBySavedIdTemplate
      summary: Turn a saved request into a custom template.
      tags:
        - Saved deliveries
      parameters:
        - name: savedId
          in: path
          required: true
          description: The saved delivery's ID, from `GET /api/v1/webhooks/saved`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SaveAsTemplateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateSummary"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook saved save-as-template <savedId>
      x-sendmock-mcp: sendmock_webhook_saved_save_as_template
      x-sendmock-ui: Webhooks > Saved > Save as template
  /api/v1/webhooks/templates:
    get:
      operationId: getWebhooksTemplates
      summary: Built-in and custom payload templates.
      tags:
        - Webhook templates
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WebhookTemplateSummary"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template list
      x-sendmock-mcp: sendmock_webhook_template_list
      x-sendmock-ui: Webhooks > Templates
    post:
      operationId: postWebhooksTemplates
      summary: Add a custom template, starting as native JSON.
      tags:
        - Webhook templates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateCreateRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateSummary"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template create
      x-sendmock-mcp: sendmock_webhook_template_create
      x-sendmock-ui: Webhooks > Templates > New template
  /api/v1/webhooks/templates/{templateId}:
    get:
      operationId: getWebhooksTemplatesByTemplateId
      summary: One template with its method, headers and body template.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template show <templateId>
      x-sendmock-mcp: sendmock_webhook_template_get
      x-sendmock-ui: Webhooks > Templates > open a template
    patch:
      operationId: patchWebhooksTemplatesByTemplateId
      summary: Edit a template; each save keeps a revision, 422 when it does not render.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateUpdate"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateDetail"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template update <templateId>
      x-sendmock-mcp: sendmock_webhook_template_update
      x-sendmock-ui: Webhooks > Templates > template > Edit, Save template
    delete:
      operationId: deleteWebhooksTemplatesByTemplateId
      summary: Delete a custom template; 409 while endpoints use it.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
        - name: endpoints
          in: query
          required: false
          description: "detach: endpoints that use it keep their own copy of it instead of failing."
          schema:
            type: string
          example: detach
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template delete <templateId>
      x-sendmock-mcp: sendmock_webhook_template_delete
      x-sendmock-ui: Webhooks > Templates > template > Delete
  /api/v1/webhooks/templates/import:
    post:
      operationId: postWebhooksTemplatesImport
      summary: Import a template file; 409 when the id is taken.
      tags:
        - Webhook templates
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateImportRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateSummary"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/Unprocessable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template import <file>
      x-sendmock-mcp: sendmock_webhook_template_import
      x-sendmock-ui: Webhooks > Templates > Import a template
  /api/v1/webhooks/templates/{templateId}/export:
    get:
      operationId: getWebhooksTemplatesByTemplateIdExport
      summary: The template as TOML (variable names, never values).
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      responses:
        "200":
          description: OK.
          content:
            application/toml:
              schema:
                type: string
                format: binary
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template export <templateId>
      x-sendmock-mcp: sendmock_webhook_template_export
      x-sendmock-ui: Webhooks > Templates > template > Export
  /api/v1/webhooks/templates/{templateId}/revisions:
    get:
      operationId: getWebhooksTemplatesByTemplateIdRevisions
      summary: Saved revisions, newest first.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/TemplateRevision"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template history <templateId>
      x-sendmock-mcp: sendmock_webhook_template_revisions
      x-sendmock-ui: Webhooks > Templates > template > History
  /api/v1/webhooks/templates/{templateId}/revisions/{revision}/restore:
    post:
      operationId: postWebhooksTemplatesByTemplateIdRevisionsByRevisionRestore
      summary: Restore a revision as a new save.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
        - name: revision
          in: path
          required: true
          description: The template revision number, from its history.
          schema:
            type: integer
          example: 1
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template restore <templateId> <revision>
      x-sendmock-mcp: sendmock_webhook_template_restore
      x-sendmock-ui: Webhooks > Templates > template > History > Restore
  /api/v1/webhooks/templates/{templateId}/render:
    post:
      operationId: postWebhooksTemplatesByTemplateIdRender
      summary: Render against an email, an SMS or the sample, optionally a draft.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateRenderRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateRenderResult"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template render <templateId>
      x-sendmock-mcp: sendmock_webhook_template_render
      x-sendmock-ui: Webhooks > Templates > template > Preview
  /api/v1/webhooks/templates/{templateId}/reset:
    post:
      operationId: postWebhooksTemplatesByTemplateIdReset
      summary: Put an edited built-in template back as shipped.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateDetail"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template reset <templateId>
      x-sendmock-mcp: sendmock_webhook_template_reset
      x-sendmock-ui: Webhooks > Templates > template > Reset to default
  /api/v1/webhooks/templates/{templateId}/clone:
    post:
      operationId: postWebhooksTemplatesByTemplateIdClone
      summary: Copy a template into a new custom one.
      tags:
        - Webhook templates
      parameters:
        - name: templateId
          in: path
          required: true
          description: The webhook template's ID, e.g. `slack.incoming_webhook` or `custom.ops_alert`.
          schema:
            type: string
          example: slack.incoming_webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TemplateCloneRequest"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookTemplateSummary"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template clone <templateId>
      x-sendmock-mcp: sendmock_webhook_template_clone
      x-sendmock-ui: Webhooks > Templates > template > Clone
  /api/v1/webhooks/template-reference:
    get:
      operationId: getWebhooksTemplateReference
      summary: Every value a template can read for the chosen events.
      tags:
        - Webhook templates
      parameters:
        - name: events
          in: query
          required: false
          description: Comma-separated event types.
          schema:
            type: string
          example: email.received,sms.received
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TemplateReference"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook template reference
      x-sendmock-mcp: sendmock_webhook_template_reference
      x-sendmock-ui: Webhooks > Templates > template editor > reference panel
  /api/v1/webhooks/variables:
    get:
      operationId: getWebhooksVariables
      summary: Global and endpoint variables; secret values are masked.
      tags:
        - Webhook variables
      parameters:
        - name: endpoint_id
          in: query
          required: false
          description: Only this endpoint's variables.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WebhookVariable"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook var list
      x-sendmock-mcp: sendmock_webhook_variable_list
      x-sendmock-ui: Webhooks > Variables
    post:
      operationId: postWebhooksVariables
      summary: Add a variable.
      tags:
        - Webhook variables
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookVariableInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookVariable"
        "400":
          $ref: "#/components/responses/BadRequest"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook var set <name> <value>
      x-sendmock-mcp: sendmock_webhook_variable_set
      x-sendmock-ui: Webhooks > Variables > Add variable
  /api/v1/webhooks/variables/{variableId}:
    patch:
      operationId: patchWebhooksVariablesByVariableId
      summary: Change a variable.
      tags:
        - Webhook variables
      parameters:
        - name: variableId
          in: path
          required: true
          description: The webhook variable's ID, from `GET /api/v1/webhooks/variables`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WebhookVariableInput"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookVariable"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook var update <variableId>
      x-sendmock-mcp: sendmock_webhook_variable_update
      x-sendmock-ui: Webhooks > Variables > Edit
    delete:
      operationId: deleteWebhooksVariablesByVariableId
      summary: Delete a variable.
      tags:
        - Webhook variables
      parameters:
        - name: variableId
          in: path
          required: true
          description: The webhook variable's ID, from `GET /api/v1/webhooks/variables`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook var unset <variableId>
      x-sendmock-mcp: sendmock_webhook_variable_unset
      x-sendmock-ui: Webhooks > Variables > Delete
  /api/v1/webhooks/variables/{variableId}/regenerate:
    post:
      operationId: postWebhooksVariablesByVariableIdRegenerate
      summary: Make a new fixed value for a generated-once random variable.
      tags:
        - Webhook variables
      parameters:
        - name: variableId
          in: path
          required: true
          description: The webhook variable's ID, from `GET /api/v1/webhooks/variables`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WebhookVariable"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook var regenerate <variableId>
      x-sendmock-mcp: sendmock_webhook_variable_regenerate
      x-sendmock-ui: Webhooks > Variables > Regenerate
  /api/v1/webhooks/variables/preview:
    post:
      operationId: postWebhooksVariablesPreview
      summary: What a variable definition resolves to against the sample.
      tags:
        - Webhook variables
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/VariablePreviewRequest"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VariablePreviewResult"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock webhook var preview
      x-sendmock-mcp: sendmock_webhook_variable_preview
      x-sendmock-ui: Webhooks > Variables > variable sheet > Resolves to
  /api/v1/projects:
    get:
      operationId: getProjects
      summary: Every project, default first, with the traffic each holds.
      tags:
        - Projects
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Project"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock projects list
      x-sendmock-mcp: sendmock_project_list
      x-sendmock-ui: Settings > Projects
    post:
      operationId: postProjects
      summary: Add a project that apps can send traffic to by its key.
      tags:
        - Projects
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ProjectInput"
      responses:
        "201":
          description: Created.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        "400":
          $ref: "#/components/responses/BadRequest"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock projects create
      x-sendmock-mcp: sendmock_project_create
      x-sendmock-ui: Settings > Projects > New project
  /api/v1/projects/{projectKey}:
    patch:
      operationId: patchProjectsByProjectKey
      summary: Rename a project; its key stays the same.
      tags:
        - Projects
      parameters:
        - name: projectKey
          in: path
          required: true
          description: The project's key, from the list of projects.
          schema:
            type: string
          example: shop
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ProjectUpdate"
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Project"
        "400":
          $ref: "#/components/responses/BadRequest"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock projects update <projectKey>
      x-sendmock-mcp: sendmock_project_update
      x-sendmock-ui: Settings > Projects > Rename
    delete:
      operationId: deleteProjectsByProjectKey
      summary: Delete a project with its emails, SMS and verifications.
      tags:
        - Projects
      parameters:
        - name: projectKey
          in: path
          required: true
          description: The project's key, from the list of projects.
          schema:
            type: string
          example: shop
      responses:
        "204":
          description: No content.
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock projects delete <projectKey>
      x-sendmock-mcp: sendmock_project_delete
      x-sendmock-ui: Settings > Projects > Delete
  /api/v1/push:
    get:
      operationId: getPush
      summary: Push notifications, newest first, with filters.
      tags:
        - Push
      parameters:
        - name: cursor
          in: query
          required: false
          description: The next_cursor of the previous page.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        - name: limit
          in: query
          required: false
          description: Items per page, 1 to 200 (default 50).
          schema:
            type: integer
          example: 50
        - name: project
          in: query
          required: false
          description: Only this project's notifications (its key); every project's when not set.
          schema:
            type: string
          example: shop
        - name: device_token
          in: query
          required: false
          description: Only notifications to this device token.
          schema:
            type: string
          example: dQw4w9WgXcQ:APA91bE1
        - name: provider
          in: query
          required: false
          description: fcm, expo or onesignal.
          schema:
            $ref: "#/components/schemas/PushProvider"
          example: fcm
        - name: status
          in: query
          required: false
          description: sent or failed.
          schema:
            $ref: "#/components/schemas/PushStatus"
          example: sent
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageOf_PushNotification"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock push list
      x-sendmock-mcp: sendmock_push_list
      x-sendmock-ui: Push
    delete:
      operationId: deletePush
      summary: Delete every push notification, or one project's.
      tags:
        - Push
      parameters:
        - name: project
          in: query
          required: false
          description: Only this project's notifications (its key); every project's when not set.
          schema:
            type: string
          example: shop
        - name: device_token
          in: query
          required: false
          description: Only notifications to this device token.
          schema:
            type: string
          example: dQw4w9WgXcQ:APA91bE1
        - name: provider
          in: query
          required: false
          description: fcm, expo or onesignal.
          schema:
            $ref: "#/components/schemas/PushProvider"
          example: fcm
        - name: status
          in: query
          required: false
          description: sent or failed.
          schema:
            $ref: "#/components/schemas/PushStatus"
          example: sent
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock push clear
      x-sendmock-mcp: sendmock_push_delete_all
      x-sendmock-ui: Push > Clear all
  /api/v1/push/{pushId}:
    get:
      operationId: getPushByPushId
      summary: One push notification with its request and answer.
      tags:
        - Push
      parameters:
        - name: pushId
          in: path
          required: true
          description: The notification's id, from `GET /api/v1/push`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PushNotification"
        "404":
          $ref: "#/components/responses/NotFound"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock push show <pushId>
      x-sendmock-mcp: sendmock_push_get
      x-sendmock-ui: Push > open a notification
    delete:
      operationId: deletePushByPushId
      summary: Delete one push notification.
      tags:
        - Push
      parameters:
        - name: pushId
          in: path
          required: true
          description: The notification's id, from `GET /api/v1/push`.
          schema:
            type: string
          example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      responses:
        "204":
          description: No content.
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock push delete <pushId>
      x-sendmock-mcp: sendmock_push_delete
      x-sendmock-ui: Push > open a notification > Delete
  /api/v1/wait/push:
    get:
      operationId: getWaitPush
      summary: Wait until a matching push notification arrives; 408 on timeout.
      tags:
        - Push
      parameters:
        - name: device_token
          in: query
          required: false
          description: The device token.
          schema:
            type: string
          example: dQw4w9WgXcQ:APA91bE1
        - name: project
          in: query
          required: false
          description: Only this project's notifications (its key); every project's when not set.
          schema:
            type: string
          example: shop
        - name: since
          in: query
          required: false
          description: "Only notifications sent after this time (default: 30 s ago)."
          schema:
            type: string
          example: 2026-11-07T10:00:00Z
        - name: timeout
          in: query
          required: false
          description: How long to wait, e.g. 10s (default 10s, at most 60s).
          schema:
            type: string
          example: 10s
      responses:
        "200":
          description: OK.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PushNotification"
        "408":
          $ref: "#/components/responses/Timeout"
        default:
          $ref: "#/components/responses/Error"
      x-sendmock-cli: sendmock push wait
      x-sendmock-mcp: sendmock_push_wait
      x-sendmock-ui: Push (new notifications appear live)
components:
  schemas:
    ActivityBucket:
      type: object
      properties:
        bucket_start:
          $ref: "#/components/schemas/IsoTimestamp"
        email_count:
          type: number
        sms_count:
          type: number
        http_request_count:
          type: number
        webhook_delivery_count:
          type: number
      required:
        - bucket_start
        - email_count
        - sms_count
        - http_request_count
        - webhook_delivery_count
      description: One hour of traffic in the Overview activity chart.
    AiAgentSetup:
      type: object
      properties:
        target:
          $ref: "#/components/schemas/AiAgentTarget"
        name:
          type: string
        install_command:
          type: string
        mcp_config_path:
          type: string
          description: Where the MCP configuration goes, e.g. `.cursor/mcp.json`.
        mcp_config:
          type: string
        instructions_path:
          type: string
          description: Where the skill or instructions go, e.g. `.claude/skills/sendmock/`.
        npx_install_command:
          type: string
          description: The install command for someone who runs SendMock through npx, with nothing installed.
        npx_mcp_config:
          type: string
          description: The MCP configuration that starts SendMock with `npx -y sendmock mcp`.
      required:
        - target
        - name
        - install_command
        - mcp_config_path
        - mcp_config
        - instructions_path
        - npx_install_command
        - npx_mcp_config
      description: "One item of GET /api/v1/ai/agents: how to connect an AI agent."
    AiAgentTarget:
      type: string
      enum:
        - claude-code
        - codex
        - cursor
        - gemini
        - vscode
    ApiErrorBody:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            field:
              type: string
          required:
            - code
            - message
      required:
        - error
    ApiRequestLinkedMessage:
      type: object
      properties:
        kind:
          type: string
          enum:
            - email
            - sms
        id:
          $ref: "#/components/schemas/Ulid"
        sms_thread_id:
          type:
            - string
            - "null"
          description: Conversation of a linked SMS, for the "Open message" link.
      required:
        - kind
        - id
        - sms_thread_id
    ApiRequestLogEntry:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        api:
          type: string
        method:
          type: string
        path:
          type: string
        request_headers:
          type: object
          additionalProperties:
            type: string
        request_body:
          type: string
        response_status:
          type: number
        response_body:
          type: string
        duration_ms:
          type: number
        linked_message:
          anyOf:
            - $ref: "#/components/schemas/ApiRequestLinkedMessage"
            - type: "null"
          description: The SMS or email this request created; null for rejected requests.
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - api
        - method
        - path
        - request_headers
        - request_body
        - response_status
        - response_body
        - duration_ms
        - linked_message
        - created_at
    ApiStatusClass:
      type: string
      enum:
        - 2xx
        - 4xx
        - 5xx
    AppEvent:
      type: object
      properties:
        id:
          type: string
        type:
          $ref: "#/components/schemas/AppEventType"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        data:
          type: object
          additionalProperties: {}
          description: Trimmed to list-view fields of the subject (email, SMS, delivery, ...).
      required:
        - id
        - type
        - created_at
        - data
      description: Envelope pushed over the realtime WebSocket and sent in native webhooks.
    AppEventType:
      type: string
      enum:
        - email.received
        - email.inbound
        - email.opened
        - email.clicked
        - email.delivered
        - email.deferred
        - email.bounced
        - email.complained
        - email.unsubscribed
        - email.released
        - email.deleted
        - sms.sent
        - sms.status
        - sms.opened
        - sms.inbound
        - sms.reply_webhook
        - verify.started
        - verify.checked
        - verify.expired
        - push.sent
        - push.failed
        - http.captured
        - payment.created
        - payment.authorized
        - payment.succeeded
        - payment.failed
        - payment.canceled
        - payment.refunded
        - payment.partially_refunded
        - payment.dispute_opened
        - payment.dispute_updated
        - payment.dispute_closed
        - checkout.completed
        - checkout.expired
        - subscription.created
        - subscription.renewed
        - subscription.payment_failed
        - subscription.canceled
        - webhook.delivered
        - webhook.failed
        - test.ping
        - traffic.pruned
    AppInfo:
      type: object
      properties:
        version:
          type: string
        channel:
          $ref: "#/components/schemas/ReleaseChannel"
        uptime_seconds:
          type: number
        smtp_address:
          type: string
        http_address:
          type: string
        provider_address:
          type:
            - string
            - "null"
        catcher_address:
          type:
            - string
            - "null"
          description: The catch-all catcher port (`--catcher-addr`); null when it is off.
        pop3_address:
          type:
            - string
            - "null"
          description: The POP3 listener (`--pop3-addr`), which serves the captured mail per project; null when it is off.
        database_path:
          type: string
        database_size_bytes:
          type: number
        is_container:
          type: boolean
          description: True when SendMock runs in Docker, so the UI defaults to container hostnames.
        available_operations:
          type: array
          items:
            type: string
          description: The `operationId`s this binary serves; the UI shows Not available yet for the rest.
      required:
        - version
        - channel
        - uptime_seconds
        - smtp_address
        - http_address
        - provider_address
        - catcher_address
        - pop3_address
        - database_path
        - database_size_bytes
        - is_container
        - available_operations
    AppSettings:
      type: object
      properties:
        max_emails:
          type: number
          description: The most emails kept; the oldest are deleted past it. 0 keeps every email (no limit).
          examples:
            - 1000
        max_sms:
          type: number
          description: The most SMS kept (with verifications and push notifications); the oldest are deleted past it. 0 keeps every SMS (no limit).
          examples:
            - 1000
        max_age_days:
          type:
            - number
            - "null"
          description: Null keeps traffic until the count limits prune it.
          examples:
            - 7
        is_plus_address_tagging_enabled:
          type: boolean
          description: Tags `user+invoice@app.test` with `invoice`.
          examples:
            - true
        email_outcome_profile:
          $ref: "#/components/schemas/EmailOutcomeProfile"
          description: "`off` sends no delivery events, `auto-delivered` marks every email delivered after a short delay, `realistic` adds bounces and complaints at the rates below."
          examples:
            - off
        email_outcome_bounce_rate_percent:
          type: number
          description: Used by the `realistic` outcome profile.
          examples:
            - 5
        email_outcome_complaint_rate_percent:
          type: number
          description: Complaints in the `realistic` outcome profile, 0 to 100.
          examples:
            - 1
        relay_smtp_url:
          type:
            - string
            - "null"
          description: Relay for release and auto-forward; the password is always masked.
          examples:
            - smtp://user:pass@smtp.yourcompany.com:587
        relay_recipient_allowlist:
          type: array
          items:
            type: string
          description: Glob patterns; release stays off while this is empty.
          examples:
            - - "*@yourcompany.com"
        spamassassin_address:
          type:
            - string
            - "null"
          description: "`host:port` of a SpamAssassin `spamd`; null turns the spam check off."
          examples:
            - 127.0.0.1:783
        sms_simulation_profile:
          $ref: "#/components/schemas/SmsSimulationProfile"
          description: "`instant` delivers at once, `realistic` goes queued, sent, then delivered over a few seconds, `manual` stays sent until you pick a status."
          examples:
            - instant
        sms_failure_rate_percent:
          type: number
          description: The share of SMS that fail at random, 0 to 100.
          examples:
            - 0
        is_strict_twilio_test_mode:
          type: boolean
          description: Rejects numbers that are not Twilio test numbers with error 21606, like real test credentials.
          examples:
            - false
        is_magic_numbers_enabled:
          type: boolean
          description: "Off: the built-in Twilio and SendMock numbers behave like any number."
          examples:
            - true
        is_magic_addresses_enabled:
          type: boolean
          description: "Off: the built-in magic addresses behave like any address."
          examples:
            - true
        fire_opened_events_on_view:
          type: boolean
          description: Fires `email.opened` and `sms.opened` when you open a message in the UI.
          examples:
            - true
        opened_event_mode:
          type: string
          enum:
            - first_open
            - every_open
          description: "`first_open` fires on the first view only, `every_open` on each view."
          examples:
            - first_open
        chaos_smtp_reject_next_count:
          type: number
          description: Rejects the next N SMTP messages, to test your app's retries.
          examples:
            - 0
        chaos_smtp_reject_code:
          $ref: "#/components/schemas/ChaosSmtpRejectCode"
          description: "The SMTP code used for rejected messages: 421, 450, 550 or 552."
          examples:
            - 450
        chaos_smtp_reject_recipient_pattern:
          type:
            - string
            - "null"
          description: Glob; matching recipients get `550 No such user`.
          examples:
            - "*@unknown.test"
        chaos_smtp_command_latency_ms:
          type: number
          description: Delay added to every SMTP command, in milliseconds.
          examples:
            - 0
        is_chaos_smtp_drop_during_data_enabled:
          type: boolean
          description: Drops the connection during `DATA`, to test half-sent messages.
          examples:
            - false
        otp_patterns:
          type: array
          items:
            type: string
          description: Ordered; the first capture group of the first match is the code.
          examples:
            - - code[:\s]+(\d{4,8})
        update_check_mode:
          $ref: "#/components/schemas/UpdateCheckMode"
          description: "When SendMock looks for a newer release: `off` never calls out, `manual` only on request, `daily` on start and once a day."
          examples:
            - off
        inbound_email_domains:
          type: array
          items:
            type: string
          description: Mail for these domains is incoming; offered as Forward suggestions.
          examples:
            - - reply.app.test
        payment_merchant_name:
          type: string
          description: Shown on checkout pages and as `{merchant}` in step labels.
          examples:
            - Demo Shop
        payment_default_currency:
          type: string
          description: For hosted checkouts created without a currency.
          examples:
            - USD
        payment_outcome_profile:
          $ref: "#/components/schemas/PaymentOutcomeProfile"
          description: "What a new hosted checkout does: `interactive` waits for the page, `auto_success` and `auto_decline` settle at once, `random` succeeds at the rate below."
          examples:
            - interactive
        payment_random_success_rate_percent:
          type: number
          description: Used by the `random` outcome profile.
          examples:
            - 80
        verify_default_code_length:
          type: number
          description: Digits in each code of a Verify service made without its own code length, 4 to 10.
          examples:
            - 6
        verify_default_ttl_seconds:
          type: number
          description: How long a code stays valid, in seconds, for a Verify service made without its own TTL.
          examples:
            - 600
        verify_fixed_code:
          type:
            - string
            - "null"
          description: Sent by every Verify service without its own fixed code; null for random codes.
          examples:
            - "123456"
      required:
        - max_emails
        - max_sms
        - max_age_days
        - is_plus_address_tagging_enabled
        - email_outcome_profile
        - email_outcome_bounce_rate_percent
        - email_outcome_complaint_rate_percent
        - relay_smtp_url
        - relay_recipient_allowlist
        - spamassassin_address
        - sms_simulation_profile
        - sms_failure_rate_percent
        - is_strict_twilio_test_mode
        - is_magic_numbers_enabled
        - is_magic_addresses_enabled
        - fire_opened_events_on_view
        - opened_event_mode
        - chaos_smtp_reject_next_count
        - chaos_smtp_reject_code
        - chaos_smtp_reject_recipient_pattern
        - chaos_smtp_command_latency_ms
        - is_chaos_smtp_drop_during_data_enabled
        - otp_patterns
        - update_check_mode
        - inbound_email_domains
        - payment_merchant_name
        - payment_default_currency
        - payment_outcome_profile
        - payment_random_success_rate_percent
        - verify_default_code_length
        - verify_default_ttl_seconds
        - verify_fixed_code
    AppSettingsUpdate:
      type: object
      properties:
        max_emails:
          type: number
          description: The most emails kept; the oldest are deleted past it. 0 keeps every email (no limit).
          examples:
            - 1000
        max_sms:
          type: number
          description: The most SMS kept (with verifications and push notifications); the oldest are deleted past it. 0 keeps every SMS (no limit).
          examples:
            - 1000
        max_age_days:
          type:
            - number
            - "null"
          description: Null keeps traffic until the count limits prune it.
          examples:
            - 7
        is_plus_address_tagging_enabled:
          type: boolean
          description: Tags `user+invoice@app.test` with `invoice`.
          examples:
            - true
        email_outcome_profile:
          $ref: "#/components/schemas/EmailOutcomeProfile"
          description: "`off` sends no delivery events, `auto-delivered` marks every email delivered after a short delay, `realistic` adds bounces and complaints at the rates below."
          examples:
            - off
        email_outcome_bounce_rate_percent:
          type: number
          description: Used by the `realistic` outcome profile.
          examples:
            - 5
        email_outcome_complaint_rate_percent:
          type: number
          description: Complaints in the `realistic` outcome profile, 0 to 100.
          examples:
            - 1
        relay_smtp_url:
          type:
            - string
            - "null"
          description: Relay for release and auto-forward; the password is always masked.
          examples:
            - smtp://user:pass@smtp.yourcompany.com:587
        relay_recipient_allowlist:
          type: array
          items:
            type: string
          description: Glob patterns; release stays off while this is empty.
          examples:
            - - "*@yourcompany.com"
        spamassassin_address:
          type:
            - string
            - "null"
          description: "`host:port` of a SpamAssassin `spamd`; null turns the spam check off."
          examples:
            - 127.0.0.1:783
        sms_simulation_profile:
          $ref: "#/components/schemas/SmsSimulationProfile"
          description: "`instant` delivers at once, `realistic` goes queued, sent, then delivered over a few seconds, `manual` stays sent until you pick a status."
          examples:
            - instant
        sms_failure_rate_percent:
          type: number
          description: The share of SMS that fail at random, 0 to 100.
          examples:
            - 0
        is_strict_twilio_test_mode:
          type: boolean
          description: Rejects numbers that are not Twilio test numbers with error 21606, like real test credentials.
          examples:
            - false
        is_magic_numbers_enabled:
          type: boolean
          description: "Off: the built-in Twilio and SendMock numbers behave like any number."
          examples:
            - true
        is_magic_addresses_enabled:
          type: boolean
          description: "Off: the built-in magic addresses behave like any address."
          examples:
            - true
        fire_opened_events_on_view:
          type: boolean
          description: Fires `email.opened` and `sms.opened` when you open a message in the UI.
          examples:
            - true
        opened_event_mode:
          type: string
          enum:
            - first_open
            - every_open
          description: "`first_open` fires on the first view only, `every_open` on each view."
          examples:
            - first_open
        chaos_smtp_reject_next_count:
          type: number
          description: Rejects the next N SMTP messages, to test your app's retries.
          examples:
            - 0
        chaos_smtp_reject_code:
          $ref: "#/components/schemas/ChaosSmtpRejectCode"
          description: "The SMTP code used for rejected messages: 421, 450, 550 or 552."
          examples:
            - 450
        chaos_smtp_reject_recipient_pattern:
          type:
            - string
            - "null"
          description: Glob; matching recipients get `550 No such user`.
          examples:
            - "*@unknown.test"
        chaos_smtp_command_latency_ms:
          type: number
          description: Delay added to every SMTP command, in milliseconds.
          examples:
            - 0
        is_chaos_smtp_drop_during_data_enabled:
          type: boolean
          description: Drops the connection during `DATA`, to test half-sent messages.
          examples:
            - false
        otp_patterns:
          type: array
          items:
            type: string
          description: Ordered; the first capture group of the first match is the code.
          examples:
            - - code[:\s]+(\d{4,8})
        update_check_mode:
          $ref: "#/components/schemas/UpdateCheckMode"
          description: "When SendMock looks for a newer release: `off` never calls out, `manual` only on request, `daily` on start and once a day."
          examples:
            - off
        inbound_email_domains:
          type: array
          items:
            type: string
          description: Mail for these domains is incoming; offered as Forward suggestions.
          examples:
            - - reply.app.test
        payment_merchant_name:
          type: string
          description: Shown on checkout pages and as `{merchant}` in step labels.
          examples:
            - Demo Shop
        payment_default_currency:
          type: string
          description: For hosted checkouts created without a currency.
          examples:
            - USD
        payment_outcome_profile:
          $ref: "#/components/schemas/PaymentOutcomeProfile"
          description: "What a new hosted checkout does: `interactive` waits for the page, `auto_success` and `auto_decline` settle at once, `random` succeeds at the rate below."
          examples:
            - interactive
        payment_random_success_rate_percent:
          type: number
          description: Used by the `random` outcome profile.
          examples:
            - 80
        verify_default_code_length:
          type: number
          description: Digits in each code of a Verify service made without its own code length, 4 to 10.
          examples:
            - 6
        verify_default_ttl_seconds:
          type: number
          description: How long a code stays valid, in seconds, for a Verify service made without its own TTL.
          examples:
            - 600
        verify_fixed_code:
          type:
            - string
            - "null"
          description: Sent by every Verify service without its own fixed code; null for random codes.
          examples:
            - "123456"
      description: "Body of PATCH /api/v1/settings: only the changed keys."
    AppStats:
      type: object
      properties:
        email_count:
          type: number
        emails_today:
          type: number
        unread_email_count:
          type: number
        sms_count:
          type: number
        sms_today:
          type: number
        unread_sms_count:
          type: number
        verification_count:
          type: number
        pending_verification_count:
          type: number
        http_request_count:
          type: number
        http_requests_today:
          type: number
        webhook_delivery_count:
          type: number
        webhook_success_rate:
          type:
            - number
            - "null"
        webhook_p95_latency_ms:
          type:
            - number
            - "null"
        payment_count:
          type: number
        payments_today:
          type: number
        payment_success_rate:
          type:
            - number
            - "null"
          description: Succeeded among finished payments; null before any finished.
        payment_revenue:
          type: array
          items:
            type: object
            properties:
              currency:
                type: string
              amount_minor:
                type: number
            required:
              - currency
              - amount_minor
          description: Captured minus refunded, per currency, largest first (test money).
        activity:
          type: array
          items:
            $ref: "#/components/schemas/ActivityBucket"
          description: 24 hourly buckets, oldest first, ending with the current hour.
        endpoint_metrics:
          type: array
          items:
            $ref: "#/components/schemas/EndpointMetrics"
        recent_failures:
          type: array
          items:
            $ref: "#/components/schemas/RecentFailedDelivery"
      required:
        - email_count
        - emails_today
        - unread_email_count
        - sms_count
        - sms_today
        - unread_sms_count
        - verification_count
        - pending_verification_count
        - http_request_count
        - http_requests_today
        - webhook_delivery_count
        - webhook_success_rate
        - webhook_p95_latency_ms
        - payment_count
        - payments_today
        - payment_success_rate
        - payment_revenue
        - activity
        - endpoint_metrics
        - recent_failures
      description: "GET /api/v1/stats: everything the Overview shows."
    AvailableRelease:
      type: object
      properties:
        version:
          type: string
          examples:
            - 0.2.0-beta.1
        published_at:
          $ref: "#/components/schemas/IsoTimestamp"
        release_notes_markdown:
          type: string
          description: The release's `CHANGELOG.md` section, in Markdown.
        release_url:
          type: string
          examples:
            - https://github.com/shibbirweb/sendmock/releases/tag/v0.2.0-beta.1
        upgrade_command:
          type:
            - string
            - "null"
          description: The command for the install method; null when the method is unknown, so follow `release_url`.
          examples:
            - brew upgrade sendmock
      required:
        - version
        - published_at
        - release_notes_markdown
        - release_url
        - upgrade_command
      description: The newer release an update check offers.
    BodyFieldType:
      type: string
      enum:
        - text
        - number
        - boolean
        - json
        - file
    CapturedHttpFile:
      type: object
      properties:
        file_index:
          type: number
        field_name:
          type: string
        filename:
          type: string
        content_type:
          type: string
        size_bytes:
          type: number
      required:
        - file_index
        - field_name
        - filename
        - content_type
        - size_bytes
      description: A file uploaded in a multipart request.
    CapturedHttpRequest:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        bin_id:
          $ref: "#/components/schemas/Ulid"
        bin_name:
          type: string
        method:
          type: string
        url:
          type: string
          description: Full URL as received, query included.
        path:
          type: string
        query:
          type: object
          additionalProperties:
            type: string
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
        content_type:
          type:
            - string
            - "null"
        files:
          type: array
          items:
            $ref: "#/components/schemas/CapturedHttpFile"
        client_ip:
          type: string
        response_status:
          type: number
        response_headers:
          type: object
          additionalProperties:
            type: string
        response_body:
          type: string
        matched_rule_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The rule that answered; null for the default reply.
        matched_rule_name:
          type:
            - string
            - "null"
        is_simulated_failure:
          type: boolean
        duration_ms:
          type: number
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - bin_id
        - bin_name
        - method
        - url
        - path
        - query
        - headers
        - body
        - content_type
        - files
        - client_ip
        - response_status
        - response_headers
        - response_body
        - matched_rule_id
        - matched_rule_name
        - is_simulated_failure
        - duration_ms
        - created_at
    CardTestOutcome:
      type: string
      enum:
        - succeed
        - decline
        - three_ds
        - succeed_then_dispute
    ChaosSmtpRejectCode:
      type: number
      enum:
        - 421
        - 450
        - 550
        - 552
      description: SMTP reply codes the chaos options can answer with.
    CheckoutAction:
      type: string
      enum:
        - pay
        - decline
        - cancel
        - delay
        - require_three_ds
        - three_ds_approve
        - three_ds_fail
    CheckoutCard:
      type: object
      properties:
        number:
          type: string
          description: A test card number of the method.
          examples:
            - "4242424242424242"
        exp_month:
          type: number
          description: Expiry month, 1 to 12.
          examples:
            - 12
        exp_year:
          type: number
          description: Expiry year, four digits.
          examples:
            - 2030
        cvc:
          type: string
          description: Any three or four digits.
          examples:
            - "123"
        holder_name:
          type: string
          description: The name on the card.
          examples:
            - Sam Tester
      required:
        - number
        - exp_month
        - exp_year
        - cvc
        - holder_name
      description: A card typed on the checkout page; only test cards are accepted, and none is stored.
    CheckoutCompleteRequest:
      type: object
      properties:
        action:
          $ref: "#/components/schemas/CheckoutAction"
          description: "What the customer does: `pay`, `decline`, `cancel`, `delay` (pending), `require_three_ds`, `three_ds_approve` or `three_ds_fail`."
          examples:
            - pay
        method_key:
          type: string
          description: The method the customer paid with.
          examples:
            - card
        card:
          $ref: "#/components/schemas/CheckoutCard"
          description: The card typed, for card methods.
        entries:
          $ref: "#/components/schemas/CheckoutStepEntries"
          description: What was typed in the flow's other steps.
        decline_reason:
          $ref: "#/components/schemas/DeclineReason"
          description: "For `decline`: why the bank declined."
          examples:
            - insufficient_funds
      required:
        - action
      description: Body of POST /api/v1/checkout-sessions/{sessionId}/complete.
    CheckoutSession:
      type: object
      properties:
        session_id:
          $ref: "#/components/schemas/Ulid"
        payment_id:
          $ref: "#/components/schemas/Ulid"
        provider:
          $ref: "#/components/schemas/PaymentProvider"
        provider_name:
          type: string
        merchant_name:
          type: string
        amount_minor:
          type: number
        currency:
          type: string
        line_items:
          type: array
          items:
            $ref: "#/components/schemas/PaymentLineItem"
        customer_email:
          type:
            - string
            - "null"
        accent:
          type: string
          description: The gateway's accent, `#rrggbb`.
        methods:
          type: array
          items:
            $ref: "#/components/schemas/PaymentMethodDefinition"
          description: The enabled methods the gateway offers, in order.
        flows:
          type: array
          items:
            $ref: "#/components/schemas/PaymentFlowDefinition"
          description: The flows those methods run.
        state:
          $ref: "#/components/schemas/CheckoutState"
        failure_code:
          anyOf:
            - $ref: "#/components/schemas/DeclineReason"
            - type: string
              const: expired
            - type: "null"
        redirect:
          anyOf:
            - $ref: "#/components/schemas/PaymentRedirect"
            - type: "null"
          description: Where the browser goes once the checkout is finished.
      required:
        - session_id
        - payment_id
        - provider
        - provider_name
        - merchant_name
        - amount_minor
        - currency
        - line_items
        - customer_email
        - accent
        - methods
        - flows
        - state
        - failure_code
        - redirect
      description: "GET /api/v1/checkout-sessions/{sessionId}: what the test checkout page shows."
    CheckoutState:
      type: string
      enum:
        - open
        - requires_three_ds
        - pending
        - completed
        - failed
        - canceled
        - expired
      description: Where a test checkout stands, from the customer's side.
    CheckoutStepEntries:
      type: object
      properties:
        number:
          type: string
          description: An account number or voucher code.
          examples:
            - "01770000001"
        otp:
          type: string
          description: The one-time code typed in an OTP step.
          examples:
            - "123456"
        pin:
          type: string
          description: The PIN typed in a PIN step.
          examples:
            - "12121"
      description: What the customer typed in a flow's steps; only the flow's own steps are read.
    CreatedBy:
      type: string
      enum:
        - ui
        - api
        - cli
        - mcp
        - seed
      description: Who created a configuration item; agents get a badge in the UI.
    CreatedSample:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/SampleKind"
        id:
          type: string
          description: Email or SMS ID, or the verification SID.
      required:
        - kind
        - id
    DeclineReason:
      type: string
      enum:
        - insufficient_funds
        - expired_card
        - incorrect_cvc
        - generic_decline
        - fraudulent
        - authentication_failed
    DeliveryAttemptSummary:
      type: object
      properties:
        delivery_id:
          $ref: "#/components/schemas/Ulid"
        attempt:
          type: number
        status:
          $ref: "#/components/schemas/DeliveryStatus"
        status_code:
          type:
            - number
            - "null"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - delivery_id
        - attempt
        - status
        - status_code
        - created_at
      description: One attempt of the same event, for the detail's attempt list.
    DeliveryOutcomeBucket:
      type: object
      properties:
        bucket_start:
          $ref: "#/components/schemas/IsoTimestamp"
        succeeded_count:
          type: number
        retrying_count:
          type: number
          description: Pending, in flight, or failed with a retry still to come.
        failed_count:
          type: number
          description: Exhausted, render failed, cancelled, or failed with no retry left.
        p50_latency_ms:
          type:
            - number
            - "null"
        p95_latency_ms:
          type:
            - number
            - "null"
      required:
        - bucket_start
        - succeeded_count
        - retrying_count
        - failed_count
        - p50_latency_ms
        - p95_latency_ms
      description: One hour (24h) or day (7d) of deliveries by outcome.
    DeliveryReplayRequest:
      type: object
      properties:
        rerender:
          type: boolean
          description: Renders the request again with today's template and variables; false resends the stored request as it was.
          examples:
            - false
        body:
          type: string
          description: An edited body and headers; left out to resend the stored request.
          examples:
            - '{"type": "email.received"}'
        headers:
          type: object
          additionalProperties:
            type: string
          description: Edited headers, by name; left out to resend the stored ones.
          examples:
            - X-Replay: "1"
      required:
        - rerender
      description: Body of POST /api/v1/webhooks/deliveries/{deliveryId}/replay.
    DeliveryStatus:
      type: string
      enum:
        - pending
        - render_failed
        - in_flight
        - succeeded
        - failed
        - exhausted
        - cancelled
    DeliverySubject:
      type: object
      properties:
        kind:
          type: string
          enum:
            - email
            - sms
        id:
          $ref: "#/components/schemas/Ulid"
        title:
          type: string
          description: Subject, or the SMS body.
        sms_thread_id:
          type:
            - string
            - "null"
      required:
        - kind
        - id
        - title
        - sms_thread_id
      description: The email or SMS that caused a delivery.
    DeliveryTrigger:
      type: string
      enum:
        - auto
        - manual
        - replay
        - chosen
      description: "Why a delivery was made: a rule (`auto`), by hand, a replay, or `chosen` for one simulation."
    EmailAddress:
      type: object
      properties:
        name:
          type: string
        address:
          type: string
      required:
        - name
        - address
    EmailAttachment:
      type: object
      properties:
        index:
          type: number
        filename:
          type: string
        content_type:
          type: string
        size_bytes:
          type: number
        content_id:
          type:
            - string
            - "null"
        is_inline:
          type: boolean
        download_url:
          type: string
        thumbnail_url:
          type:
            - string
            - "null"
      required:
        - index
        - filename
        - content_type
        - size_bytes
        - content_id
        - is_inline
        - download_url
        - thumbnail_url
    EmailClickRecord:
      type: object
      properties:
        clicked_at:
          $ref: "#/components/schemas/IsoTimestamp"
        url:
          type: string
        source:
          $ref: "#/components/schemas/OpenSource"
        user_agent:
          type:
            - string
            - "null"
      required:
        - clicked_at
        - url
        - source
        - user_agent
      description: One click on an email's link, newest first in `GET /emails/{emailId}/clicks`.
    EmailClickRequest:
      type: object
      properties:
        url:
          type: string
          description: The link that was clicked; one of the email's links (`extracted.links`).
          examples:
            - https://app.test/verify?token=abc123
        source:
          $ref: "#/components/schemas/OpenSource"
          description: "Who clicked it: `ui` (a link in the preview), `manual` (Simulate click) or `api` (a script). Defaults to `api`."
          examples:
            - api
        user_agent:
          type: string
          description: The browser or client that clicked, kept in the click history. The UI sends its own.
          examples:
            - Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5)
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      required:
        - url
      description: Body of `POST /emails/{emailId}/clicks`.
    EmailDeliveryStatus:
      type: string
      enum:
        - delivered
        - deferred
        - bounced
        - complained
        - unsubscribed
      description: Simulated delivery outcome, null when no outcome was simulated.
    EmailDetail:
      type: object
      properties:
        message_id:
          type:
            - string
            - "null"
        cc:
          type: array
          items:
            $ref: "#/components/schemas/EmailAddress"
        bcc:
          type: array
          items:
            $ref: "#/components/schemas/EmailAddress"
        reply_to:
          type: array
          items:
            $ref: "#/components/schemas/EmailAddress"
        envelope_from:
          type: string
        envelope_to:
          type: array
          items:
            type: string
        headers:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        text_body:
          type:
            - string
            - "null"
        html_body:
          type:
            - string
            - "null"
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/EmailAttachment"
        extracted:
          $ref: "#/components/schemas/ExtractedData"
        opened_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        click_count:
          type: number
          description: Every recorded click on the email's links (`GET /emails/{emailId}/clicks`).
        smtp_session_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        smtp_auth_user:
          type:
            - string
            - "null"
        template:
          anyOf:
            - $ref: "#/components/schemas/EmailTemplateData"
            - type: "null"
        response_to:
          anyOf:
            - $ref: "#/components/schemas/EmailResponseLink"
            - type: "null"
          description: "On a reply or forward: the original email it answers."
        responses:
          type: array
          items:
            $ref: "#/components/schemas/EmailResponseLink"
          description: "On an original: the replies and forwards made from it, oldest first."
        id:
          $ref: "#/components/schemas/Ulid"
        received_at:
          $ref: "#/components/schemas/IsoTimestamp"
        from:
          $ref: "#/components/schemas/EmailAddress"
        to:
          type: array
          items:
            $ref: "#/components/schemas/EmailAddress"
        subject:
          type: string
        snippet:
          type: string
        size_bytes:
          type: number
        attachment_count:
          type: number
        is_read:
          type: boolean
        tags:
          type: array
          items:
            type: string
        source:
          $ref: "#/components/schemas/EmailSource"
        delivery_status:
          anyOf:
            - $ref: "#/components/schemas/EmailDeliveryStatus"
            - type: "null"
        open_count:
          type: number
        has_otp:
          type: boolean
        direction:
          $ref: "#/components/schemas/EmailDirection"
        response_kind:
          anyOf:
            - $ref: "#/components/schemas/EmailResponseKind"
            - type: "null"
          description: Set on inbound emails made by Reply or Forward, for the list icon.
        project:
          type: string
          description: "The project the email was sent to: `default` unless the sender named another."
          examples:
            - default
      required:
        - attachment_count
        - attachments
        - bcc
        - cc
        - click_count
        - delivery_status
        - direction
        - envelope_from
        - envelope_to
        - extracted
        - from
        - has_otp
        - headers
        - html_body
        - id
        - is_read
        - message_id
        - open_count
        - opened_at
        - project
        - received_at
        - reply_to
        - response_kind
        - response_to
        - responses
        - size_bytes
        - smtp_auth_user
        - smtp_session_id
        - snippet
        - source
        - subject
        - tags
        - template
        - text_body
        - to
    EmailDirection:
      type: string
      enum:
        - outbound
        - inbound
      description: "`outbound`: mail your app sent; `inbound`: mail coming in to your app."
    EmailForwardRequest:
      type: object
      properties:
        to:
          type: string
          description: Where the email is forwarded, e.g. your app's inbound address.
          examples:
            - support@inbound.app.test
        body:
          type: string
          description: A note above the forwarded message.
          examples:
            - Can you look at this one?
        from:
          type: string
          description: Who forwards; defaults to the original recipient.
          examples:
            - user@example.test
        subject:
          type: string
          description: "Defaults to `Fwd: <original subject>`."
          examples:
            - "Fwd: Your invoice"
        include_original:
          type: boolean
          description: Adds the original below a "Forwarded message" block (default true).
          examples:
            - true
        include_attachments:
          type: boolean
          description: Forwards the original attachments too (default true).
          examples:
            - true
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      required:
        - to
      description: Body of POST /api/v1/emails/{emailId}/forward (simulate the recipient forwarding).
    EmailInboundRequest:
      type: object
      properties:
        from:
          type: string
          description: The sender, as an address or `Name <address>`.
          examples:
            - Sam <sam@customer.test>
        to:
          type: array
          items:
            type: string
          description: The recipients, usually your app's inbound address.
          examples:
            - - support@inbound.app.test
        subject:
          type: string
          description: The subject line.
          examples:
            - Order arrived damaged
        text:
          type: string
          description: The plain-text body.
          examples:
            - The box was crushed, can I get a replacement?
        html:
          type: string
          description: The HTML body.
          examples:
            - <p>The box was crushed, can I get a replacement?</p>
        raw:
          type: string
          description: A whole message (RFC 5322); when set, the other fields are ignored.
          examples:
            - "From: sam@customer.test\r

              To: support@inbound.app.test\r

              Subject: Hi\r

              \r

              Hello"
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      description: "Body of POST /api/v1/emails/inbound: an incoming email from fields, or raw MIME in `raw`."
    EmailOutcomeKind:
      type: string
      enum:
        - delivered
        - hard_bounce
        - soft_bounce
        - complaint
        - unsubscribe
        - reject
      description: What a custom outcome address does to a matching email.
    EmailOutcomeProfile:
      type: string
      enum:
        - off
        - auto-delivered
        - realistic
    EmailOutcomeRule:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        position:
          type: number
        pattern:
          type: string
          description: Exact address, or `*` wildcards, e.g. `*@bounce.qa.test`.
          examples:
            - "*@bounce.qa.test"
        outcome:
          $ref: "#/components/schemas/EmailOutcomeKind"
          description: "What happens to a matching email: `delivered`, `hard_bounce`, `soft_bounce`, `complaint`, `unsubscribe` or `reject` (refused during SMTP `RCPT` and the HTTP send)."
          examples:
            - hard_bounce
        smtp_code:
          type:
            - string
            - "null"
          description: SMTP reply for bounces and rejects, e.g. `550 5.1.1`.
          examples:
            - 550 5.1.1
        diagnostic:
          type:
            - string
            - "null"
          description: The diagnostic text sent with the SMTP code.
          examples:
            - user unknown
        note:
          type: string
          description: Why the rule exists, shown in the list.
          examples:
            - Bounce every QA signup
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - id
        - position
        - pattern
        - outcome
        - smtp_code
        - diagnostic
        - note
        - is_enabled
        - created_by
      description: "A custom outcome address: first enabled match wins."
    EmailOutcomeRuleInput:
      type: object
      properties:
        pattern:
          type: string
          description: Exact address, or `*` wildcards, e.g. `*@bounce.qa.test`.
          examples:
            - "*@bounce.qa.test"
        outcome:
          $ref: "#/components/schemas/EmailOutcomeKind"
          description: "What happens to a matching email: `delivered`, `hard_bounce`, `soft_bounce`, `complaint`, `unsubscribe` or `reject` (refused during SMTP `RCPT` and the HTTP send)."
          examples:
            - hard_bounce
        smtp_code:
          type:
            - string
            - "null"
          description: SMTP reply for bounces and rejects, e.g. `550 5.1.1`.
          examples:
            - 550 5.1.1
        diagnostic:
          type:
            - string
            - "null"
          description: The diagnostic text sent with the SMTP code.
          examples:
            - user unknown
        note:
          type: string
          description: Why the rule exists, shown in the list.
          examples:
            - Bounce every QA signup
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
      required:
        - pattern
        - outcome
        - smtp_code
        - diagnostic
        - note
        - is_enabled
      description: Body of POST and PATCH /api/v1/outcome-rules/email.
    EmailOutcomeRuleInputPatch:
      type: object
      properties:
        pattern:
          type: string
          description: Exact address, or `*` wildcards, e.g. `*@bounce.qa.test`.
          examples:
            - "*@bounce.qa.test"
        outcome:
          $ref: "#/components/schemas/EmailOutcomeKind"
          description: "What happens to a matching email: `delivered`, `hard_bounce`, `soft_bounce`, `complaint`, `unsubscribe` or `reject` (refused during SMTP `RCPT` and the HTTP send)."
          examples:
            - hard_bounce
        smtp_code:
          type:
            - string
            - "null"
          description: SMTP reply for bounces and rejects, e.g. `550 5.1.1`.
          examples:
            - 550 5.1.1
        diagnostic:
          type:
            - string
            - "null"
          description: The diagnostic text sent with the SMTP code.
          examples:
            - user unknown
        note:
          type: string
          description: Why the rule exists, shown in the list.
          examples:
            - Bounce every QA signup
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
    EmailOutcomeTestRequest:
      type: object
      properties:
        address:
          type: string
          description: The address to test against the outcome rules and magic addresses.
          examples:
            - bounce@example.test
      required:
        - address
      description: Body of POST /api/v1/outcome-rules/email/test.
    EmailProviderOperationKind:
      type: string
      enum:
        - send
        - send_batch
        - send_with_template
        - fetch
      description: The email requests SendMock knows how to run (a new kind needs code).
    EmailReleaseRequest:
      type: object
      properties:
        to:
          type: array
          items:
            type: string
          description: Who receives it on the real SMTP server; empty sends to the original recipients. Every address must match the release allowlist.
          examples:
            - - qa@yourcompany.com
      description: Body of `POST /emails/{emailId}/release`; empty sends to the original recipients.
    EmailReplyRequest:
      type: object
      properties:
        body:
          type: string
          description: The reply text, above the quoted original; empty or left out sends no text of its own.
          examples:
            - Thanks, that fixed it!
        from:
          type: string
          description: Who replies; defaults to the original recipient.
          examples:
            - user@example.test
        subject:
          type: string
          description: "Defaults to `Re: <original subject>`."
          examples:
            - "Re: Ticket #318 updated"
        reply_all:
          type: boolean
          description: Also sends to the other original recipients, in Cc.
          examples:
            - false
        include_original:
          type: boolean
          description: Quotes the original below an "On ... wrote:" line (default true).
          examples:
            - true
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      description: Body of POST /api/v1/emails/{emailId}/reply (simulate the recipient replying).
    EmailResponseKind:
      type: string
      enum:
        - reply
        - forward
      description: How the recipient answered an email your app sent.
    EmailResponseLink:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/EmailResponseKind"
        email_id:
          $ref: "#/components/schemas/Ulid"
        subject:
          type: string
        from:
          $ref: "#/components/schemas/EmailAddress"
        received_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - kind
        - email_id
        - subject
        - from
        - received_at
      description: Points from an original email to a reply or forward, or back.
    EmailSource:
      type: string
      description: "How an email reached SendMock: a transport (`smtp`, `sendmail`, `native_api`, `verify`, `simulated`) or the key of the email provider whose API it was sent through (`sendgrid`, or a custom provider's key; docs/plan/22)."
      examples:
        - sendgrid
    EmailSummary:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        received_at:
          $ref: "#/components/schemas/IsoTimestamp"
        from:
          $ref: "#/components/schemas/EmailAddress"
        to:
          type: array
          items:
            $ref: "#/components/schemas/EmailAddress"
        subject:
          type: string
        snippet:
          type: string
        size_bytes:
          type: number
        attachment_count:
          type: number
        is_read:
          type: boolean
        tags:
          type: array
          items:
            type: string
        source:
          $ref: "#/components/schemas/EmailSource"
        delivery_status:
          anyOf:
            - $ref: "#/components/schemas/EmailDeliveryStatus"
            - type: "null"
        open_count:
          type: number
        has_otp:
          type: boolean
        direction:
          $ref: "#/components/schemas/EmailDirection"
        response_kind:
          anyOf:
            - $ref: "#/components/schemas/EmailResponseKind"
            - type: "null"
          description: Set on inbound emails made by Reply or Forward, for the list icon.
        project:
          type: string
          description: "The project the email was sent to: `default` unless the sender named another."
          examples:
            - default
      required:
        - id
        - received_at
        - from
        - to
        - subject
        - snippet
        - size_bytes
        - attachment_count
        - is_read
        - tags
        - source
        - delivery_status
        - open_count
        - has_otp
        - direction
        - response_kind
        - project
      description: Fields shown in the mail list.
    EmailTemplateData:
      type: object
      properties:
        template_id:
          type: string
        template_data:
          type: object
          additionalProperties: {}
      required:
        - template_id
        - template_data
    EmailTimelineEntry:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/EmailTimelineKind"
        at:
          $ref: "#/components/schemas/IsoTimestamp"
        detail:
          type: string
      required:
        - kind
        - at
        - detail
    EmailTimelineKind:
      type: string
      enum:
        - received
        - opened
        - clicked
        - delivered
        - deferred
        - bounced
        - complained
        - unsubscribed
        - released
        - forwarded
        - replied
        - forwarded_by_recipient
        - webhook_sent
    EmailUpdate:
      type: object
      properties:
        is_read:
          type: boolean
          description: Marks the email as read (true) or unread (false).
          examples:
            - true
        tags:
          type: array
          items:
            type: string
          description: Replaces the email's tags; an empty list removes them all.
          examples:
            - - signup
              - qa
    EndpointBodyField:
      type: object
      properties:
        name:
          type: string
          description: The field name; dots make nested keys (`user.email`).
          examples:
            - user.email
        value_type:
          $ref: "#/components/schemas/BodyFieldType"
          description: "How the rendered value is encoded: `text`, `number`, `boolean`, `json`, or `file` (a URL fetched when the request is sent, for `multipart` only)."
          examples:
            - text
        value:
          type: string
          description: The value, a template that can use the event and variables.
          examples:
            - "{{ data.to[0].address }}"
      required:
        - name
        - value_type
        - value
      description: One Fields-mode row; the value is a template, encoded as its type.
    EndpointBodyMode:
      type: string
      enum:
        - template
        - fields
        - raw
        - none
      description: How an endpoint builds its body.
    EndpointMetrics:
      type: object
      properties:
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
        endpoint_name:
          type: string
        delivery_count:
          type: number
        success_rate:
          type:
            - number
            - "null"
          description: 0 to 1; null when nothing finished yet.
        p50_latency_ms:
          type:
            - number
            - "null"
        p95_latency_ms:
          type:
            - number
            - "null"
        retry_count:
          type: number
        top_failure_codes:
          type: array
          items:
            $ref: "#/components/schemas/FailureCodeCount"
      required:
        - endpoint_id
        - endpoint_name
        - delivery_count
        - success_rate
        - p50_latency_ms
        - p95_latency_ms
        - retry_count
        - top_failure_codes
      description: Webhook health of one endpoint over the last 24 hours.
    EndpointPreviewRequest:
      type: object
      properties:
        endpoint:
          $ref: "#/components/schemas/WebhookEndpointInput"
          description: The endpoint settings to render, saved or not; left out, the saved endpoint `endpoint_id` names is rendered as stored.
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
          description: A saved endpoint's own variables are used too; alone, its stored settings are rendered.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        email_id:
          $ref: "#/components/schemas/Ulid"
          description: Render against this email; without an email, SMS or request ID the sample event is used.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        sms_id:
          $ref: "#/components/schemas/Ulid"
          description: Render against this SMS.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        http_request_id:
          $ref: "#/components/schemas/Ulid"
          description: Render against this captured HTTP request.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        variables:
          type: object
          additionalProperties:
            type: string
          description: Send-time values by variable name (no `vars.`); they win for this render.
          examples:
            - app_token: test-token
      description: Body of POST /api/v1/webhooks/endpoints/preview.
    EndpointPreviewResult:
      type: object
      properties:
        rendered_against:
          type: string
        event_type:
          $ref: "#/components/schemas/AppEventType"
        method:
          $ref: "#/components/schemas/HttpMethod"
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
        problems:
          type: array
          items:
            $ref: "#/components/schemas/RenderProblem"
      required:
        - rendered_against
        - event_type
        - method
        - url
        - headers
        - body
        - problems
    ExtractedData:
      type: object
      properties:
        otp:
          type: array
          items:
            type: string
        links:
          type: array
          items:
            type: string
      required:
        - otp
        - links
    FailureCodeCount:
      type: object
      properties:
        failure_code:
          type: string
          description: HTTP status as text (`"500"`), `"render_failed"` or `"no_response"`.
        failure_count:
          type: number
      required:
        - failure_code
        - failure_count
    ForcedVerificationState:
      type: string
      enum:
        - approved
        - canceled
        - expired
        - max_attempts
    ForwardRule:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Invoices to finance QA
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The webhook rule filter, over email fields; null matches every email.
        to:
          type: array
          items:
            type: string
          description: Real addresses; each must be on the relay allowlist.
          examples:
            - - finance-qa@yourcompany.com
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
        position:
          type: number
      required:
        - id
        - name
        - filter
        - to
        - is_enabled
        - position
      description: Releases arriving emails that match its filter to real addresses.
    ForwardRuleInput:
      type: object
      properties:
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Invoices to finance QA
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The webhook rule filter, over email fields; null matches every email.
        to:
          type: array
          items:
            type: string
          description: Real addresses; each must be on the relay allowlist.
          examples:
            - - finance-qa@yourcompany.com
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
      required:
        - name
        - filter
        - to
        - is_enabled
      description: Body of POST and PATCH /api/v1/forward-rules.
    ForwardRuleInputPatch:
      type: object
      properties:
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Invoices to finance QA
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The webhook rule filter, over email fields; null matches every email.
        to:
          type: array
          items:
            type: string
          description: Real addresses; each must be on the relay allowlist.
          examples:
            - - finance-qa@yourcompany.com
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
    GatewayCredential:
      type: object
      properties:
        name:
          type: string
          description: The credential's name, readable in templates as `merchant.<name>`.
          examples:
            - webhook_secret
        value:
          type: string
          description: The value; a secret comes back masked.
          examples:
            - whsec_test_123
        is_secret:
          type: boolean
          description: Masks the value in the UI, API answers and logs.
          examples:
            - true
      required:
        - name
        - value
        - is_secret
      description: A merchant credential; a secret's value comes back masked (`••••` and the last 4).
    GatewayCredentialReveal:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
      description: GET /api/v1/payments/gateways/{gatewayKey}/credentials/{credentialName}.
    GatewayHeaderTemplate:
      type: object
      properties:
        name:
          type: string
          description: The header name.
          examples:
            - stripe-signature
        template:
          type: string
          description: The value, a template; signature helpers sign the body.
          examples:
            - "{{ stripe_signature(merchant.webhook_secret) }}"
      required:
        - name
        - template
    GatewayRedirectField:
      type: object
      properties:
        name:
          type: string
          description: The parameter name sent to your app.
          examples:
            - session_id
        template:
          type: string
          description: The value, a template over the payment.
          examples:
            - "{{ payment.reference }}"
        send_on:
          type: string
          enum:
            - always
            - success
          description: PayPal sends `PayerID` only after a successful approval.
          examples:
            - always
      required:
        - name
        - template
        - send_on
      description: A field sent back to the app on redirect, from a template.
    GatewayTemplateProblem:
      type: object
      properties:
        part:
          type: string
        message:
          type: string
        severity:
          type: string
          enum:
            - error
            - warning
      required:
        - part
        - message
        - severity
      description: One template problem, named by the part it is in, e.g. `Redirect field status`.
    HealthStatus:
      type: object
      properties:
        status:
          type: string
          const: ok
      required:
        - status
      description: Answer of `GET /health`.
    HtmlCheckReport:
      type: object
      properties:
        overall_support_percent:
          type: number
        clients:
          type: array
          items:
            $ref: "#/components/schemas/HtmlClientSupport"
        warnings:
          type: array
          items:
            $ref: "#/components/schemas/HtmlCheckWarning"
      required:
        - overall_support_percent
        - clients
        - warnings
    HtmlCheckWarning:
      type: object
      properties:
        feature:
          type: string
        support_percent:
          type: number
        line:
          type:
            - number
            - "null"
        note:
          type: string
      required:
        - feature
        - support_percent
        - line
        - note
    HtmlClientSupport:
      type: object
      properties:
        client:
          type: string
        support_percent:
          type: number
      required:
        - client
        - support_percent
      description: Results of the email quality checks (docs/plan/03-email.md#quality-checks).
    HttpBin:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
        preset:
          anyOf:
            - $ref: "#/components/schemas/HttpBinPreset"
            - type: "null"
        request_count:
          type: number
        last_request_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        default_response:
          $ref: "#/components/schemas/HttpMockResponse"
          description: Sent when no rule matches; `200 {"ok":true}` unless a preset sets another.
      required:
        - id
        - name
        - preset
        - request_count
        - last_request_at
        - default_response
    HttpBinInput:
      type: object
      properties:
        name:
          type: string
          description: The bin's name; your app calls `/catch/<name>/...`.
          examples:
            - slack
        preset:
          anyOf:
            - $ref: "#/components/schemas/HttpBinPreset"
            - type: "null"
          description: A ready-made bin that answers like the real service (`slack`, `discord`, `teams`, `google_chat`, `telegram`, `fcm`, `expo`, `onesignal`, `generic`); null for a plain bin.
          examples:
            - slack
      required:
        - name
        - preset
      description: Body of POST /api/v1/http/bins.
    HttpBinPreset:
      type: string
      enum:
        - slack
        - discord
        - teams
        - google_chat
        - telegram
        - fcm
        - expo
        - onesignal
        - generic
      description: Ready-made bins whose replies mimic the real service.
    HttpBinUpdate:
      type: object
      properties:
        default_response:
          $ref: "#/components/schemas/HttpMockResponse"
          description: The reply sent when no rule matches.
      required:
        - default_response
      description: Body of `PATCH /http/bins/{binId}`.
    HttpForwardRequest:
      type: object
      properties:
        url:
          type: string
          description: Where the captured request is sent again, e.g. your local handler.
          examples:
            - http://localhost:3000/webhooks/slack
      required:
        - url
      description: Body of POST /api/v1/http/requests/{requestId}/forward.
    HttpForwardResult:
      type: object
      properties:
        status_code:
          type: number
        duration_ms:
          type: number
        body:
          type: string
      required:
        - status_code
        - duration_ms
        - body
    HttpMethod:
      type: string
      enum:
        - GET
        - POST
        - PUT
        - PATCH
        - DELETE
    HttpMockResponse:
      type: object
      properties:
        status_code:
          type: number
          description: The HTTP status of the reply.
          examples:
            - 200
        headers:
          type: object
          additionalProperties:
            type: string
          description: Reply headers, by name; values are templates.
          examples:
            - Content-Type: application/json
        body:
          type: string
          description: The reply body, a template over the captured request.
          examples:
            - '{"ok": true}'
      required:
        - status_code
        - headers
        - body
      description: A reply SendMock sends; headers and body are templates.
    HttpResponseRule:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
          description: Empty for a new rule in a PUT; the API assigns it.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Rate limit the push API
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
        method:
          anyOf:
            - $ref: "#/components/schemas/HttpMethod"
            - type: "null"
          description: Null matches any method.
          examples:
            - POST
        path_glob:
          type: string
          description: Relative to the bin, e.g. `/v1/*`; empty matches any path.
          examples:
            - /v1/*
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: Header and body conditions, as in webhook rules.
        response:
          $ref: "#/components/schemas/HttpMockResponse"
          description: The reply sent when the rule matches.
        delay_min_ms:
          type: number
          description: A fixed delay when both are equal, else a random one in the range.
          examples:
            - 0
        delay_max_ms:
          type: number
          description: The longest delay before replying, in milliseconds; equal to `delay_min_ms` for a fixed delay.
          examples:
            - 500
        failure_rate_percent:
          type: number
          description: The share of matching requests answered with `failure_status_code` instead, 0 to 100.
          examples:
            - 10
        failure_status_code:
          type: number
          description: The status sent for a simulated failure.
          examples:
            - 503
      required:
        - id
        - name
        - is_enabled
        - method
        - path_glob
        - filter
        - response
        - delay_min_ms
        - delay_max_ms
        - failure_rate_percent
        - failure_status_code
      description: One mock response rule; rules are checked in order and the first match answers.
    HttpRulePreviewRequest:
      type: object
      properties:
        rule:
          $ref: "#/components/schemas/HttpResponseRule"
          description: The rule to try, saved or not.
        request_id:
          $ref: "#/components/schemas/Ulid"
          description: The captured request to try it on.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      required:
        - rule
        - request_id
      description: Body of POST /api/v1/http/bins/{binId}/responses/preview.
    HttpRulePreviewResult:
      type: object
      properties:
        is_match:
          type: boolean
        mismatch_reason:
          type:
            - string
            - "null"
          description: Why the rule does not match, e.g. "Method is GET, not POST".
        response:
          $ref: "#/components/schemas/HttpMockResponse"
        problems:
          type: array
          items:
            type: string
      required:
        - is_match
        - mismatch_reason
        - response
        - problems
    InboundRoute:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        priority:
          type: number
          description: Lower runs first.
          examples:
            - 10
        description:
          type: string
          description: A name for the route, shown in the list.
          examples:
            - Ticket replies to the helpdesk
        filter:
          $ref: "#/components/schemas/InboundRouteFilter"
          description: Which incoming emails the route takes.
        expression:
          type: string
          description: The filter in Mailgun syntax, e.g. `match_recipient("support@.*")`.
        actions:
          type: array
          items:
            $ref: "#/components/schemas/InboundRouteAction"
          description: What the route does with a matching email, in order.
        action_expressions:
          type: array
          items:
            type: string
          description: Each action in Mailgun syntax, e.g. `forward("http://...")`.
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - priority
        - description
        - filter
        - expression
        - actions
        - action_expressions
        - created_at
      description: A Mailgun-style inbound route.
    InboundRouteAction:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              const: forward_url
              description: POSTs the parsed email to a URL in Mailgun's format.
            url:
              type: string
              description: Your app's inbound mail webhook.
              examples:
                - http://localhost:8000/webhooks/mail
          required:
            - kind
            - url
        - type: object
          properties:
            kind:
              type: string
              const: forward_email
              description: Forwards to a real address, only through the release allowlist.
            address:
              type: string
              description: The real address.
              examples:
                - dev@yourcompany.com
          required:
            - kind
            - address
        - type: object
          properties:
            kind:
              type: string
              const: store
              description: Keeps the message and can POST a notification with its `message-url`.
            notify_url:
              type:
                - string
                - "null"
              description: Where the notification goes; null stores without notifying.
              examples:
                - http://localhost:8000/webhooks/stored
          required:
            - kind
            - notify_url
        - type: object
          properties:
            kind:
              type: string
              const: stop
              description: Skips the routes with a higher priority number.
          required:
            - kind
      description: What a route does with a matching email, in order.
    InboundRouteFilter:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              const: match_recipient
              description: A regular expression on each recipient.
            pattern:
              type: string
              description: The regular expression; named groups can be used in actions as `\g<name>`.
              examples:
                - reply\+(?P<token>.+)@reply.app.test
          required:
            - kind
            - pattern
        - type: object
          properties:
            kind:
              type: string
              const: match_header
              description: A regular expression on a header.
            header_name:
              type: string
              description: The header to match, e.g. `subject`.
              examples:
                - subject
            pattern:
              type: string
              description: The regular expression for the header's value.
              examples:
                - .*support
          required:
            - kind
            - header_name
            - pattern
        - type: object
          properties:
            kind:
              type: string
              const: catch_all
              description: Every incoming email.
          required:
            - kind
      description: Which incoming emails a route takes (Mailgun's filters).
    InboundRouteInput:
      type: object
      properties:
        priority:
          type: number
          description: Lower runs first.
          examples:
            - 10
        description:
          type: string
          description: A name for the route, shown in the list.
          examples:
            - Ticket replies to the helpdesk
        filter:
          $ref: "#/components/schemas/InboundRouteFilter"
          description: Which incoming emails the route takes.
        actions:
          type: array
          items:
            $ref: "#/components/schemas/InboundRouteAction"
          description: What the route does with a matching email, in order.
      required:
        - priority
        - description
        - filter
        - actions
      description: Body of POST /api/v1/inbound-routes and PATCH /api/v1/inbound-routes/{routeId}.
    InboundRouteMatch:
      type: object
      properties:
        email_id:
          $ref: "#/components/schemas/Ulid"
        from:
          type: string
        matched_value:
          type: string
          description: The recipient or header value that matched.
        subject:
          type: string
        captured_groups:
          type: object
          additionalProperties:
            type: string
          description: Named groups, usable in actions as `\g<name>`.
      required:
        - email_id
        - from
        - matched_value
        - subject
        - captured_groups
    InboundRouteMatchRequest:
      type: object
      properties:
        to:
          type: array
          items:
            type: string
          description: The recipients the incoming email would have.
          examples:
            - - support@inbound.app.test
        cc:
          type: array
          items:
            type: string
          description: Copied recipients; routes read them like `to`.
          examples:
            - - lee@example.test
        headers:
          type: object
          additionalProperties:
            type: string
          description: Headers by name.
          examples:
            - subject: "Re: Your receipt"
              from: sam@example.test
      required:
        - to
      description: "Body of POST /api/v1/inbound-routes/match: the email about to arrive."
    InboundRouteMatchResult:
      type: object
      properties:
        routes:
          type: array
          items:
            $ref: "#/components/schemas/MatchedInboundRoute"
          description: The routes that would run, in run order, ending at one that calls `stop()`.
        webhook_rules:
          type: array
          items:
            $ref: "#/components/schemas/MatchedWebhookRule"
          description: The webhook rules on `email.inbound` that would send, in rule order.
      required:
        - routes
        - webhook_rules
      description: Where an incoming email would go; nothing is stored or sent.
    InboundRouteTestRequest:
      type: object
      properties:
        filter:
          $ref: "#/components/schemas/InboundRouteFilter"
          description: The filter to try on the 50 most recent incoming emails.
      required:
        - filter
      description: "Body of POST /api/v1/inbound-routes/test: a filter to try on recent incoming emails."
    InboundRouteTestResult:
      type: object
      properties:
        checked_count:
          type: number
          description: How many recent incoming emails were checked (at most 50).
        matches:
          type: array
          items:
            $ref: "#/components/schemas/InboundRouteMatch"
      required:
        - checked_count
        - matches
    InboundSmsRequest:
      type: object
      properties:
        from:
          type: string
          description: "Who texts your app: the user's number."
          examples:
            - "+8801700000000"
        to:
          type: string
          description: Your app's number that receives it, usually a virtual number.
          examples:
            - "+15550001111"
        body:
          type: string
          description: The message text.
          examples:
            - STOP
        channel:
          $ref: "#/components/schemas/SmsChannel"
          description: "`sms` (default) or `whatsapp`."
          examples:
            - sms
        template_id:
          type: string
          description: The payload template for the inbound webhook, instead of the number's (e.g. `twilio.inbound_sms`).
          examples:
            - twilio.inbound_sms
        media:
          type: array
          items:
            $ref: "#/components/schemas/InlineSmsMedia"
          description: Files sent with the message, as MMS or WhatsApp media.
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      required:
        - body
        - from
        - to
      description: Body of POST /api/v1/sms/inbound (simulate an incoming message).
    InboundWebhookMethod:
      type: string
      enum:
        - POST
        - GET
    InlineSmsMedia:
      type: object
      properties:
        filename:
          type: string
          description: The file name, e.g. `photo.jpg`.
          examples:
            - photo.jpg
        content:
          type: string
          description: The file bytes, base64 encoded.
          examples:
            - /9j/4AAQSkZJRgABAQ==
        content_type:
          type: string
          description: Guessed from the file extension when missing.
          examples:
            - image/jpeg
      required:
        - filename
        - content
      description: An inline file in `media` of a native or simulated inbound send.
    InstallMethod:
      type: string
      enum:
        - homebrew
        - scoop
        - docker
        - install_script
        - npm
        - unknown
      description: How SendMock was installed, baked in by each package; it picks the upgrade command.
    IntegrationChannel:
      type: string
      enum:
        - email
        - sms
        - http
    IntegrationSnippet:
      type: object
      properties:
        stack:
          type: string
        channel:
          $ref: "#/components/schemas/IntegrationChannel"
        host:
          type: string
          description: "The host the app reaches SendMock on: `127.0.0.1`, `host.docker.internal` or `sendmock`."
        language:
          type: string
        code:
          type: string
      required:
        - stack
        - channel
        - host
        - language
        - code
      description: "Answer of GET /api/v1/integrations/{stack}: copy-ready settings, as Settings > Connection shows."
    IsoTimestamp:
      type: string
      description: RFC 3339 UTC timestamp, e.g. "2026-10-24T16:00:00Z".
    LinkCheckResult:
      type: object
      properties:
        url:
          type: string
        kind:
          type: string
          enum:
            - link
            - image
        status_code:
          type:
            - number
            - "null"
        redirect_url:
          type:
            - string
            - "null"
        duration_ms:
          type:
            - number
            - "null"
        error_message:
          type:
            - string
            - "null"
      required:
        - url
        - kind
        - status_code
        - redirect_url
        - duration_ms
        - error_message
    LinksLookup:
      type: object
      properties:
        to:
          type: string
        email_id:
          $ref: "#/components/schemas/Ulid"
        links:
          type: array
          items:
            type: string
        received_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - to
        - email_id
        - links
        - received_at
      description: "Answer of GET /api/v1/links: the links of the latest email to a recipient."
    ListUnsubscribeReport:
      type: object
      properties:
        has_header:
          type: boolean
        values:
          type: array
          items:
            type: string
        supports_one_click:
          type: boolean
        warnings:
          type: array
          items:
            type: string
      required:
        - has_header
        - values
        - supports_one_click
        - warnings
    ManualSendRequest:
      type: object
      properties:
        email_id:
          $ref: "#/components/schemas/Ulid"
          description: Send this email as the event.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        sms_id:
          $ref: "#/components/schemas/Ulid"
          description: Send this SMS as the event.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        http_request_id:
          $ref: "#/components/schemas/Ulid"
          description: A captured HTTP request, sent as an `http.captured` event.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        template_id:
          type: string
          description: A template used for this send instead of the endpoint's request.
          examples:
            - slack.incoming_webhook
        request:
          $ref: "#/components/schemas/WebhookEndpointInput"
          description: A hand-written request replacing the endpoint's, from the composer.
        variables:
          type: object
          additionalProperties:
            type: string
          description: Send-time values by variable name (no `vars.`), for this send only.
          examples:
            - app_token: test-token
        body:
          type: string
          description: An edited body, sent as written.
          examples:
            - '{"text": "hello"}'
      description: Body of POST /api/v1/webhooks/endpoints/{endpointId}/send; neither id means the sample.
    MatchedInboundRoute:
      type: object
      properties:
        route_id:
          $ref: "#/components/schemas/Ulid"
        priority:
          type: number
          description: Lower runs first.
          examples:
            - 10
        description:
          type: string
          description: The route's name.
          examples:
            - Ticket replies to the helpdesk
        expression:
          type: string
          description: The filter in Mailgun syntax, e.g. `match_recipient("support@.*")`.
        matched_value:
          type: string
          description: The recipient or header value that matched.
        actions:
          type: array
          items:
            $ref: "#/components/schemas/InboundRouteAction"
          description: What the route would do, in order.
        action_expressions:
          type: array
          items:
            type: string
          description: Each action in Mailgun syntax, e.g. `forward("http://...")`.
        calls_stop:
          type: boolean
          description: The route calls `stop()`, so no later route runs.
      required:
        - route_id
        - priority
        - description
        - expression
        - matched_value
        - actions
        - action_expressions
        - calls_stop
      description: A route that would run, with its actions as they would run (named groups filled in).
    MatchedWebhookRequest:
      type: object
      properties:
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
        endpoint_name:
          type: string
          description: The endpoint's name.
          examples:
            - Local app
        event_type:
          $ref: "#/components/schemas/AppEventType"
          description: The event the request is for.
          examples:
            - email.bounced
        method:
          $ref: "#/components/schemas/HttpMethod"
          examples:
            - POST
        url:
          type: string
          examples:
            - http://localhost:8000/webhooks/sendmock
        headers:
          type: object
          additionalProperties:
            type: string
          description: Secret values are masked.
        body:
          type: string
          description: Values made at send time (ids, timestamps, `fake.*`) are made again when it is sent unless the body is edited.
          examples:
            - '{"type":"email.bounced"}'
        problems:
          type: array
          items:
            $ref: "#/components/schemas/RenderProblem"
          description: Errors stop a delivery as `render_failed`; warnings render empty.
      required:
        - endpoint_id
        - endpoint_name
        - event_type
        - method
        - url
        - headers
        - body
        - problems
      description: The request one endpoint would send for the event, rendered with its template as a delivery would be.
    MatchedWebhookRule:
      type: object
      properties:
        rule_id:
          $ref: "#/components/schemas/Ulid"
        rule_name:
          type: string
          description: The rule's name.
          examples:
            - Replies to my app
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
        endpoint_name:
          type: string
          description: The endpoint's name.
          examples:
            - Local app
        endpoint_url:
          type: string
          description: Where the rule sends.
          examples:
            - http://localhost:8000/webhooks/sendmock
      required:
        - rule_id
        - rule_name
        - endpoint_id
        - endpoint_name
        - endpoint_url
      description: An enabled webhook rule on the event whose filter passes, with its endpoint.
    MessageProviderArea:
      type: string
      enum:
        - email
        - sms
      description: Whether a provider sends email or SMS.
    MessageProviderCreateRequest:
      type: object
      properties:
        name:
          type: string
          description: The new provider's name.
          examples:
            - SSL Wireless
        key:
          type: string
          description: Its key in `/providers/<key>/...` paths and on messages; lowercase, fixed after creation.
          examples:
            - sslwireless
        start_from:
          type:
            - string
            - "null"
          description: A provider of the same area to copy, or null to start blank.
          examples:
            - twilio
      required:
        - name
        - key
        - start_from
      description: Body of POST /api/v1/emails/providers and /api/v1/sms/providers.
    MessageProviderDefinition:
      type: object
      properties:
        key:
          type: string
          description: The `/providers/<key>/...` path and the `provider` value stored on each message; lowercase, fixed after creation.
          examples:
            - sendgrid
        name:
          type: string
          description: The provider's name, shown on messages and in pickers.
          examples:
            - SendGrid
        area:
          $ref: "#/components/schemas/MessageProviderArea"
          description: Whether it sends email or SMS.
          examples:
            - email
        accent:
          type: string
          description: "`#rrggbb`, used on its badge."
          examples:
            - "#1a82e2"
        is_enabled:
          type: boolean
          description: Off providers answer nothing; their paths get SendMock's native 404.
          examples:
            - true
        host:
          type:
            - string
            - "null"
          description: The provider's API host, used on the provider port to tell apart providers that share a path; null when not needed.
          examples:
            - api.sendgrid.com
        credentials:
          type: array
          items:
            $ref: "#/components/schemas/ProviderCredential"
          description: The credentials your app is configured with.
        check_credentials:
          type: boolean
          description: "Off by default: any credentials are accepted. On: wrong ones get the provider's `unauthorized` answer."
          examples:
            - false
        operations:
          type: array
          items:
            $ref: "#/components/schemas/ProviderOperation"
          description: The requests it answers.
        field_mapping:
          type: array
          items:
            $ref: "#/components/schemas/ProviderFieldMapping"
          description: Where each part of a sent message is read from; anything else is kept as metadata.
        validation_rules:
          type: array
          items:
            $ref: "#/components/schemas/ProviderValidationRule"
          description: The checks run on each send, in order.
        success_response:
          $ref: "#/components/schemas/ProviderResponseTemplate"
          description: The answer to a request that passes every check.
        error_responses:
          type: array
          items:
            $ref: "#/components/schemas/ProviderErrorResponse"
          description: The answer for each kind of error.
        message_id_template:
          type: string
          description: The provider's id for each message, a template.
          examples:
            - <{{ uuid() }}@sendmock.local>
        callback_template_key:
          type:
            - string
            - "null"
          description: The webhook template its status callbacks and inbound messages are sent with; null sends none.
          examples:
            - sendgrid-event
        status_names:
          type: object
          additionalProperties:
            type: string
          description: The provider's name for each SendMock status.
          examples:
            - delivered: delivered
              bounced: bounce
              complained: spamreport
        outcome_error_codes:
          type: object
          additionalProperties:
            type: string
          description: "SMS only: the provider's error code for each delivery outcome, so test numbers fail with its own codes."
          examples:
            - invalid_number: "21211"
              unreachable: "30003"
        is_builtin:
          type: boolean
          description: Shipped with SendMock; it can be reset, removed and restored, not deleted.
        is_modified:
          type: boolean
          description: A built-in that differs from its shipped default.
        is_removed:
          type: boolean
          description: A built-in taken out of routing, pickers and snippets; Restore brings it back.
        message_count_24h:
          type: number
          description: Messages it caught in the last 24 hours.
      required:
        - key
        - name
        - area
        - accent
        - is_enabled
        - host
        - credentials
        - check_credentials
        - operations
        - field_mapping
        - validation_rules
        - success_response
        - error_responses
        - message_id_template
        - callback_template_key
        - status_names
        - outcome_error_codes
        - is_builtin
        - is_modified
        - is_removed
        - message_count_24h
      description: "An email or SMS provider SendMock answers like the real one: a built-in or one you added, editable like a payment gateway."
    MessageProviderInput:
      type: object
      properties:
        key:
          type: string
          description: The `/providers/<key>/...` path and the `provider` value stored on each message; lowercase, fixed after creation.
          examples:
            - sendgrid
        name:
          type: string
          description: The provider's name, shown on messages and in pickers.
          examples:
            - SendGrid
        accent:
          type: string
          description: "`#rrggbb`, used on its badge."
          examples:
            - "#1a82e2"
        is_enabled:
          type: boolean
          description: Off providers answer nothing; their paths get SendMock's native 404.
          examples:
            - true
        host:
          type:
            - string
            - "null"
          description: The provider's API host, used on the provider port to tell apart providers that share a path; null when not needed.
          examples:
            - api.sendgrid.com
        credentials:
          type: array
          items:
            $ref: "#/components/schemas/ProviderCredential"
          description: The credentials your app is configured with.
        check_credentials:
          type: boolean
          description: "Off by default: any credentials are accepted. On: wrong ones get the provider's `unauthorized` answer."
          examples:
            - false
        operations:
          type: array
          items:
            $ref: "#/components/schemas/ProviderOperation"
          description: The requests it answers.
        field_mapping:
          type: array
          items:
            $ref: "#/components/schemas/ProviderFieldMapping"
          description: Where each part of a sent message is read from; anything else is kept as metadata.
        validation_rules:
          type: array
          items:
            $ref: "#/components/schemas/ProviderValidationRule"
          description: The checks run on each send, in order.
        success_response:
          $ref: "#/components/schemas/ProviderResponseTemplate"
          description: The answer to a request that passes every check.
        error_responses:
          type: array
          items:
            $ref: "#/components/schemas/ProviderErrorResponse"
          description: The answer for each kind of error.
        message_id_template:
          type: string
          description: The provider's id for each message, a template.
          examples:
            - <{{ uuid() }}@sendmock.local>
        callback_template_key:
          type:
            - string
            - "null"
          description: The webhook template its status callbacks and inbound messages are sent with; null sends none.
          examples:
            - sendgrid-event
        status_names:
          type: object
          additionalProperties:
            type: string
          description: The provider's name for each SendMock status.
          examples:
            - delivered: delivered
              bounced: bounce
              complained: spamreport
        outcome_error_codes:
          type: object
          additionalProperties:
            type: string
          description: "SMS only: the provider's error code for each delivery outcome, so test numbers fail with its own codes."
          examples:
            - invalid_number: "21211"
              unreachable: "30003"
      required:
        - key
        - name
        - accent
        - is_enabled
        - host
        - credentials
        - check_credentials
        - operations
        - field_mapping
        - validation_rules
        - success_response
        - error_responses
        - message_id_template
        - callback_template_key
        - status_names
        - outcome_error_codes
      description: Body of PATCH .../providers/{providerKey}; the key and area are fixed.
    MessageProviderPreview:
      type: object
      properties:
        operation_kind:
          anyOf:
            - $ref: "#/components/schemas/ProviderOperationKind"
            - type: "null"
          description: The operation the request matched, or null when none matched.
        stored_message:
          anyOf:
            - type: object
              properties:
                from:
                  type: string
                to:
                  type: array
                  items:
                    type: string
                subject:
                  type:
                    - string
                    - "null"
                body:
                  type: string
                metadata:
                  type: object
                  additionalProperties:
                    type: string
              required:
                - from
                - to
                - subject
                - body
                - metadata
            - type: "null"
          description: The message SendMock would store; null when the request is refused.
        response:
          type: object
          properties:
            status:
              type: number
            headers:
              type: object
              additionalProperties:
                type: string
            body:
              type: string
          required:
            - status
            - headers
            - body
        problems:
          type: array
          items:
            $ref: "#/components/schemas/ProviderDefinitionProblem"
        reference:
          $ref: "#/components/schemas/TemplateReference"
          description: What templates can read, for `{{` suggestions.
      required:
        - operation_kind
        - stored_message
        - response
        - problems
        - reference
      description: "What a sample request becomes: the message SendMock would store and the answer it would give."
    MessageProviderPreviewRequest:
      type: object
      properties:
        provider:
          $ref: "#/components/schemas/MessageProviderInput"
          description: The provider settings to run, saved or not.
        sample_request:
          $ref: "#/components/schemas/ProviderSampleRequest"
          description: The request to run; the provider's example send when left out.
      required:
        - provider
      description: Body of POST .../providers/{providerKey}/preview.
    MessageRuleMove:
      type: object
      properties:
        direction:
          type: string
          enum:
            - up
            - down
          description: "`up` moves the rule one place earlier in the order, `down` one place later."
          examples:
            - up
      required:
        - direction
      description: Body of POST /api/v1/tag-rules/{ruleId}/move and /forward-rules/{ruleId}/move.
    MessagingService:
      type: object
      properties:
        sid:
          type: string
          description: The service SID, `MG...`.
          examples:
            - MG00000000000000000000000000000001
        friendly_name:
          type: string
          description: A name for the service.
          examples:
            - Notifications
        number_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: The virtual numbers in the sender pool, by ID.
          examples:
            - - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        inbound_mode:
          $ref: "#/components/schemas/MessagingServiceInboundMode"
          description: "What happens to inbound messages: `webhook` (call `inbound_url`), `defer_to_sender` (each number's own webhook) or `drop`."
          examples:
            - webhook
        inbound_url:
          type:
            - string
            - "null"
          description: Used when `inbound_mode` is `webhook`.
          examples:
            - http://localhost:3000/sms/inbound
        inbound_fallback_url:
          type:
            - string
            - "null"
          description: Called when `inbound_url` fails.
          examples:
            - http://localhost:3000/sms/inbound-fallback
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - sid
        - friendly_name
        - number_ids
        - inbound_mode
        - inbound_url
        - inbound_fallback_url
        - created_by
    MessagingServiceInboundMode:
      type: string
      enum:
        - webhook
        - defer_to_sender
        - drop
      description: What a Messaging Service does with inbound messages to its numbers.
    MessagingServiceInput:
      type: object
      properties:
        friendly_name:
          type: string
          description: A name for the service.
          examples:
            - Notifications
        number_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: The virtual numbers in the sender pool, by ID.
          examples:
            - - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        inbound_mode:
          $ref: "#/components/schemas/MessagingServiceInboundMode"
          description: "What happens to inbound messages: `webhook` (call `inbound_url`), `defer_to_sender` (each number's own webhook) or `drop`."
          examples:
            - webhook
        inbound_url:
          type:
            - string
            - "null"
          description: Used when `inbound_mode` is `webhook`.
          examples:
            - http://localhost:3000/sms/inbound
        inbound_fallback_url:
          type:
            - string
            - "null"
          description: Called when `inbound_url` fails.
          examples:
            - http://localhost:3000/sms/inbound-fallback
      required:
        - friendly_name
        - number_ids
        - inbound_mode
        - inbound_url
        - inbound_fallback_url
      description: Body of POST and PATCH /api/v1/messaging-services.
    MimePart:
      type: object
      properties:
        part_id:
          type: string
        content_type:
          type: string
        transfer_encoding:
          type:
            - string
            - "null"
        charset:
          type:
            - string
            - "null"
        size_bytes:
          type: number
        filename:
          type:
            - string
            - "null"
        content_id:
          type:
            - string
            - "null"
        children:
          type: array
          items:
            $ref: "#/components/schemas/MimePart"
      required:
        - part_id
        - content_type
        - transfer_encoding
        - charset
        - size_bytes
        - filename
        - content_id
        - children
    NameValueTemplate:
      type: object
      properties:
        name:
          type: string
          description: The query parameter or header name.
          examples:
            - X-Source
        value:
          type: string
          description: The value, a template that can use the event and variables.
          examples:
            - sendmock-{{ event.type }}
      required:
        - name
        - value
      description: "A query param or header: a name and a template value."
    NativeSendAttachment:
      type: object
      properties:
        filename:
          type: string
          description: The file name the recipient sees.
          examples:
            - invoice-1042.pdf
        content:
          type: string
          description: The file bytes, base64 encoded.
          examples:
            - JVBERi0xLjQKJcfsj6IK
        content_type:
          type: string
          description: Guessed from the file extension when missing.
          examples:
            - application/pdf
        content_id:
          type: string
          description: Makes the attachment inline, shown in the HTML with `cid:<content_id>`.
          examples:
            - logo
      required:
        - filename
        - content
      description: One file in `attachments` of POST /api/v1/send.
    NativeSendRequest:
      type: object
      properties:
        from:
          type: string
          description: The sender, as an address or `Name <address>`.
          examples:
            - Shop <no-reply@shop.test>
        to:
          type: array
          items:
            type: string
          description: The recipients.
          examples:
            - - user@example.test
        cc:
          type: array
          items:
            type: string
          description: Copy recipients.
          examples:
            - - manager@example.test
        bcc:
          type: array
          items:
            type: string
          description: Hidden copy recipients; stored with the email but not in its headers.
          examples:
            - - audit@example.test
        subject:
          type: string
          description: The subject line.
          examples:
            - "Your order #1042 has shipped"
        text:
          type: string
          description: The plain-text body. Send `text`, `html` or both.
          examples:
            - Hi Sam, your order is on its way.
        html:
          type: string
          description: The HTML body. Send `text`, `html` or both.
          examples:
            - <p>Hi Sam, your order is <b>on its way</b>.</p>
        headers:
          type: object
          additionalProperties:
            type: string
          description: Extra headers, by name.
          examples:
            - X-Order-Id: "1042"
        tags:
          type: array
          items:
            type: string
          description: Tags to file the email under in Mail.
          examples:
            - - orders
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/NativeSendAttachment"
          description: Files to attach.
      required:
        - from
        - to
        - subject
      description: Body of POST /api/v1/send (native HTTP send API).
    NativeSendResult:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
      required:
        - id
      description: "Answer of `POST /send`: the stored email's id."
    NativeSmsRequest:
      type: object
      properties:
        from:
          type: string
          description: "The sender: an E.164 number or an alphanumeric sender ID."
          examples:
            - "+15550001111"
        to:
          type: string
          description: The recipient, an E.164 number; `whatsapp:+...` sends over WhatsApp.
          examples:
            - "+8801700000000"
        body:
          type: string
          description: The message text. Its length and characters decide the segments and the encoding (GSM-7 or UCS-2).
          examples:
            - Your code is 482913
        status_callback:
          type: string
          description: Your app's URL that receives each status change (queued, sent, delivered, failed).
          examples:
            - http://localhost:3000/sms/status
        metadata:
          type: object
          additionalProperties: {}
          description: Any JSON you want stored with the message and echoed in its events.
          examples:
            - user_id: 42
        media_urls:
          type: array
          items:
            type: string
          description: Public links SendMock downloads, like Twilio's `MediaUrl`.
          examples:
            - - https://example.test/receipt.png
        media:
          type: array
          items:
            $ref: "#/components/schemas/InlineSmsMedia"
          description: Files sent inline as MMS media, base64 encoded.
      required:
        - from
        - to
        - body
      description: Body of POST /api/v1/sms (native send).
    NumberChannel:
      type: string
      enum:
        - sms
        - whatsapp
    NumberTestOutcome:
      type: string
      enum:
        - succeed
        - decline
        - wrong_pin
      description: "`wrong_pin` needs a PIN step in the flow."
    OpenEventRequest:
      type: object
      properties:
        source:
          $ref: "#/components/schemas/OpenSource"
          description: "Who opened it: `ui` (the SendMock UI), `manual` (a person marking it) or `api` (a script). Defaults to `api`."
          examples:
            - api
        user_agent:
          type: string
          description: The browser or client that opened it, kept in the open history. The UI sends its own.
          examples:
            - Mozilla/5.0 (Macintosh; Intel Mac OS X 14_5)
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      description: Body of `POST /emails/{emailId}/open` and `POST /sms/{smsId}/open`.
    OpenRecord:
      type: object
      properties:
        opened_at:
          $ref: "#/components/schemas/IsoTimestamp"
        source:
          $ref: "#/components/schemas/OpenSource"
        user_agent:
          type:
            - string
            - "null"
      required:
        - opened_at
        - source
        - user_agent
      description: One open of an email or SMS, oldest first in `GET /emails/{emailId}/opens` and `GET /sms/{smsId}/opens`.
    OpenSource:
      type: string
      enum:
        - ui
        - manual
        - api
    OtpLookup:
      type: object
      properties:
        to:
          type: string
        channel:
          type: string
          enum:
            - email
            - sms
            - verify
        code:
          type: string
        source_id:
          type: string
          description: The email or SMS id, or the verification SID, that carried it.
        received_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - to
        - channel
        - code
        - source_id
        - received_at
      description: "Answer of GET /api/v1/otp: the latest code sent to a recipient."
    OutcomeRuleMove:
      type: object
      properties:
        direction:
          type: string
          enum:
            - up
            - down
          description: "`up` moves the rule one place earlier in the order, `down` one place later."
          examples:
            - up
      required:
        - direction
      description: Body of POST /api/v1/outcome-rules/{kind}/{ruleId}/move.
    OutcomeTestResult:
      type: object
      properties:
        source:
          type: string
          enum:
            - custom
            - magic
            - profile
        rule_id:
          type:
            - string
            - "null"
        rule_position:
          type:
            - number
            - "null"
          description: One-based position of the matching custom rule.
        summary:
          type: string
          description: 'What the testers show, e.g. "Custom rule 2: Hard bounce, 550 5.1.1".'
      required:
        - source
        - rule_id
        - rule_position
        - summary
      description: "Which source decides an outcome: a custom rule, a magic address or number, or the profile."
    PageOf_ApiRequestLogEntry:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/ApiRequestLogEntry"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_CapturedHttpRequest:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/CapturedHttpRequest"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_EmailSummary:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/EmailSummary"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_PaymentSummary:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/PaymentSummary"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_PushNotification:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/PushNotification"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_SmsMessage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/SmsMessage"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_SmtpSession:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/SmtpSession"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_Verification:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/Verification"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PageOf_WebhookDelivery:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/WebhookDelivery"
        next_cursor:
          type:
            - string
            - "null"
        total_count:
          type: number
      required:
        - items
        - next_cursor
        - total_count
    PaymentCaptureMethod:
      type: string
      enum:
        - automatic
        - manual
      description: "`manual` holds the money as `authorized` until it is captured or voided."
    PaymentCheckoutCreateRequest:
      type: object
      properties:
        provider:
          type: string
          description: The gateway key, e.g. `stripe` or `sslcommerz`.
          examples:
            - stripe
        amount_minor:
          type: number
          description: The amount in the currency's minor unit (cents, paisa); 1999 is 19.99.
          examples:
            - 1999
        currency:
          type: string
          description: Settings > Payments' default currency when left out.
          examples:
            - USD
        customer_email:
          type: string
          description: The customer's email, shown on the checkout page.
          examples:
            - user@example.test
        line_items:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              quantity:
                type: number
              unit_amount_minor:
                type: number
            required:
              - name
              - quantity
              - unit_amount_minor
          description: What is being bought, shown on the checkout page.
          examples:
            - - name: T-shirt
                quantity: 1
                unit_amount_minor: 1999
        capture_method:
          $ref: "#/components/schemas/PaymentCaptureMethod"
          description: "`manual` authorizes the payment and waits for a capture or void; `automatic` when left out."
          examples:
            - manual
      required:
        - provider
        - amount_minor
      description: "Body of POST /api/v1/payments/checkout: a hosted test checkout."
    PaymentCreateRequest:
      type: object
      properties:
        provider:
          type: string
          description: The gateway key, e.g. `stripe` or `sslcommerz`.
          examples:
            - stripe
        amount_minor:
          type: number
          description: The amount in the currency's minor unit (cents, paisa; JPY has none); 1999 is 19.99.
          examples:
            - 1999
        currency:
          type: string
          description: Three letters, stored in capitals; Settings > Payments' default currency when left out.
          examples:
            - USD
        card_number:
          type: string
          description: A test card of the card method; its outcome in the test card table decides the payment. A number the table does not list is refused and kept nowhere.
          examples:
            - "4242424242424242"
        customer_email:
          type: string
          description: The customer's email.
          examples:
            - user@example.test
        line_items:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              quantity:
                type: number
              unit_amount_minor:
                type: number
            required:
              - name
              - quantity
              - unit_amount_minor
          description: What is being bought.
          examples:
            - - name: T-shirt
                quantity: 1
                unit_amount_minor: 1999
        capture_method:
          $ref: "#/components/schemas/PaymentCaptureMethod"
          description: "`manual` authorizes the payment and waits for a capture or void; `automatic` when left out."
          examples:
            - automatic
      required:
        - provider
        - amount_minor
        - card_number
      description: "Body of POST /api/v1/payments: a payment the app's server pays with a test card."
    PaymentDetail:
      type: object
      properties:
        provider_ids:
          type: object
          additionalProperties:
            type: string
        customer_phone:
          type:
            - string
            - "null"
        method:
          anyOf:
            - $ref: "#/components/schemas/PaymentMethod"
            - type: "null"
        line_items:
          type: array
          items:
            $ref: "#/components/schemas/PaymentLineItem"
        metadata:
          type: object
          additionalProperties:
            type: string
        success_url:
          type:
            - string
            - "null"
        fail_url:
          type:
            - string
            - "null"
        cancel_url:
          type:
            - string
            - "null"
        checkout_url:
          type:
            - string
            - "null"
          description: Hosted checkout URL while the session can still be paid.
        redirect:
          anyOf:
            - $ref: "#/components/schemas/PaymentRedirect"
            - type: "null"
        captured_minor:
          type: number
        capture_method:
          $ref: "#/components/schemas/PaymentCaptureMethod"
        method_key:
          type:
            - string
            - "null"
          description: The payment method used, once paid.
        dispute:
          anyOf:
            - $ref: "#/components/schemas/PaymentDispute"
            - type: "null"
        timeline:
          type: array
          items:
            $ref: "#/components/schemas/PaymentTimelineEvent"
        notifications:
          type: array
          items:
            $ref: "#/components/schemas/PaymentNotification"
        id:
          $ref: "#/components/schemas/Ulid"
        provider:
          $ref: "#/components/schemas/PaymentProvider"
        provider_name:
          type: string
          description: The gateway's name, e.g. "SSLCommerz".
        provider_reference:
          type: string
          description: "The provider's main id: session, intent, order or transaction."
        amount_minor:
          type: number
        currency:
          type: string
          description: ISO 4217, e.g. USD, BDT, JPY.
        status:
          $ref: "#/components/schemas/PaymentStatus"
        customer_email:
          type:
            - string
            - "null"
        customer_name:
          type:
            - string
            - "null"
        failure_code:
          anyOf:
            - $ref: "#/components/schemas/DeclineReason"
            - type: string
              const: expired
            - type: "null"
        refunded_minor:
          type: number
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - amount_minor
        - cancel_url
        - capture_method
        - captured_minor
        - checkout_url
        - created_at
        - currency
        - customer_email
        - customer_name
        - customer_phone
        - dispute
        - fail_url
        - failure_code
        - id
        - line_items
        - metadata
        - method
        - method_key
        - notifications
        - provider
        - provider_ids
        - provider_name
        - provider_reference
        - redirect
        - refunded_minor
        - status
        - success_url
        - timeline
      description: GET /api/v1/payments/{paymentId}.
    PaymentDispute:
      type: object
      properties:
        status:
          type: string
          enum:
            - needs_response
            - under_review
            - won
            - lost
        reason:
          type: string
        evidence:
          type:
            - string
            - "null"
          description: What the merchant answered with; null until the dispute is answered.
      required:
        - status
        - reason
        - evidence
    PaymentEventType:
      type: string
      enum:
        - payment.created
        - payment.authorized
        - payment.succeeded
        - payment.failed
        - payment.canceled
        - payment.refunded
        - payment.partially_refunded
        - payment.dispute_opened
        - payment.dispute_updated
        - payment.dispute_closed
        - checkout.completed
        - checkout.expired
      description: A native event a payment notification can carry.
    PaymentFlowDefinition:
      type: object
      properties:
        key:
          type: string
          description: The flow's key; fixed after creation.
          examples:
            - wallet_otp
        name:
          type: string
          description: The flow's name.
          examples:
            - Wallet with OTP
        picker_tab:
          type: string
          description: The checkout picker tab its methods show under, e.g. "Mobile banking".
          examples:
            - Mobile banking
        steps:
          type: array
          items:
            $ref: "#/components/schemas/PaymentFlowStep"
          description: The steps in order.
        is_builtin:
          type: boolean
        is_modified:
          type: boolean
          description: A built-in that differs from its shipped default.
        method_count:
          type: number
          description: Methods using it; a custom flow in use cannot be deleted.
      required:
        - key
        - name
        - picker_tab
        - steps
        - is_builtin
        - is_modified
        - method_count
      description: How a customer pays, step by step.
    PaymentFlowInput:
      type: object
      properties:
        key:
          type: string
          description: The flow's key; fixed after creation.
          examples:
            - wallet_otp
        name:
          type: string
          description: The flow's name.
          examples:
            - Wallet with OTP
        picker_tab:
          type: string
          description: The checkout picker tab its methods show under, e.g. "Mobile banking".
          examples:
            - Mobile banking
        steps:
          type: array
          items:
            $ref: "#/components/schemas/PaymentFlowStep"
          description: The steps in order.
      required:
        - key
        - name
        - picker_tab
        - steps
      description: Body of POST and PATCH /api/v1/payments/flows; the key is fixed after creation.
    PaymentFlowStep:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/PaymentStepType"
          description: The step type, e.g. `account_number`, `otp`, `pin` or `card_form`.
          examples:
            - otp
        title:
          type: string
          description: Shown above the step; may be empty.
          examples:
            - Enter the code sent to your phone
        field_label:
          type: string
          description: The input's label; empty for steps without a field.
          examples:
            - Verification code
        hint:
          type: string
          description: Small text under the input; `{method}` and `{amount}` are replaced.
          examples:
            - We sent a 6 digit code to your {method} number.
        button_label:
          type: string
          description: The button's text.
          examples:
            - Verify
      required:
        - type
        - title
        - field_label
        - hint
        - button_label
      description: One step of a flow with its own labels. `{method}` and `{amount}` in a label are replaced with the method's name and the amount to pay.
    PaymentFlowStepAddRequest:
      type: object
      properties:
        step:
          $ref: "#/components/schemas/PaymentFlowStep"
          description: The step to add.
        position:
          type: number
          description: Zero-based; the end of the flow when left out.
          examples:
            - 1
      required:
        - step
      description: "Body of POST /api/v1/payments/flows/{flowKey}/steps: one step, appended unless a position is given."
    PaymentFlowStepUpdateRequest:
      type: object
      properties:
        position:
          type: number
          description: Moves the step to this zero-based position.
          examples:
            - 0
        title:
          type: string
          description: Shown above the step; may be empty.
          examples:
            - Enter the code sent to your phone
        field_label:
          type: string
          description: The input's label; empty for steps without a field.
          examples:
            - Verification code
        hint:
          type: string
          description: Small text under the input; `{method}` and `{amount}` are replaced.
          examples:
            - We sent a 6 digit code to your {method} number.
        button_label:
          type: string
          description: The button's text.
          examples:
            - Verify
      description: Body of PATCH /api/v1/payments/flows/{flowKey}/steps/{stepIndex}.
    PaymentFlowVariable:
      type: object
      properties:
        token:
          type: string
          description: As written in a label, e.g. `{method}`.
        description:
          type: string
          description: What it becomes on the checkout page.
        example:
          type: string
      required:
        - token
        - description
        - example
      description: "GET /api/v1/payments/flow-variables: a variable step labels can use."
    PaymentGatewayCreateRequest:
      type: object
      properties:
        name:
          type: string
          description: The new gateway's name.
          examples:
            - Upay
        key:
          type: string
          description: Its key in the API and in `/providers/<key>/...` paths; lowercase, fixed after creation.
          examples:
            - upay
        start_from:
          type:
            - string
            - "null"
          description: A gateway to copy (methods, redirect and notification), or null for blank.
          examples:
            - bkash
      required:
        - name
        - key
        - start_from
      description: Body of POST /api/v1/payments/gateways.
    PaymentGatewayDefinition:
      type: object
      properties:
        key:
          type: string
          description: The `provider` value in the API and in `/providers/<key>/...` paths.
          examples:
            - upay
        name:
          type: string
          description: The gateway's name, shown on checkout pages.
          examples:
            - Upay
        accent:
          type: string
          description: "`#rrggbb`, used on its checkout pages."
          examples:
            - "#e2136e"
        is_enabled:
          type: boolean
          description: Off gateways reject new checkouts.
          examples:
            - true
        method_keys:
          type: array
          items:
            type: string
          description: The methods its checkout offers, in order.
          examples:
            - - upay_wallet
              - card
        credentials:
          type: array
          items:
            $ref: "#/components/schemas/GatewayCredential"
          description: The merchant credentials your app is configured with.
        notification_endpoint_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The webhook endpoint its IPN or webhook deliveries go to.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        redirect_method:
          type: string
          enum:
            - GET
            - POST
          description: "How the browser returns to your app: `GET` (query string) or `POST` (form)."
          examples:
            - POST
        redirect_fields:
          type: array
          items:
            $ref: "#/components/schemas/GatewayRedirectField"
          description: The parameters sent to your app on redirect.
        notification_content_type:
          type: string
          enum:
            - json
            - form
          description: "How the IPN or webhook body is sent: `json` or `form`."
          examples:
            - json
        event_names:
          type: object
          properties:
            payment.created:
              type: string
            payment.authorized:
              type: string
            payment.succeeded:
              type: string
            payment.failed:
              type: string
            payment.canceled:
              type: string
            payment.refunded:
              type: string
            payment.partially_refunded:
              type: string
            payment.dispute_opened:
              type: string
            payment.dispute_updated:
              type: string
            payment.dispute_closed:
              type: string
            checkout.completed:
              type: string
            checkout.expired:
              type: string
          required:
            - payment.created
            - payment.authorized
            - payment.succeeded
            - payment.failed
            - payment.canceled
            - payment.refunded
            - payment.partially_refunded
            - payment.dispute_opened
            - payment.dispute_updated
            - payment.dispute_closed
            - checkout.completed
            - checkout.expired
          description: The gateway's name for each native event; blank sends nothing.
          examples:
            - payment.succeeded: PAYMENT_SUCCESS
              payment.failed: PAYMENT_FAILED
              payment.refunded: ""
              checkout.completed: ""
              checkout.expired: ""
        notification_body:
          type: string
          description: The notification body, a template over the payment and the event.
          examples:
            - '{"status": "{{ event.name }}", "txn_id": "{{ payment.reference }}"}'
        notification_headers:
          type: array
          items:
            $ref: "#/components/schemas/GatewayHeaderTemplate"
          description: Headers sent with each notification.
        is_builtin:
          type: boolean
        is_modified:
          type: boolean
          description: A built-in that differs from its shipped default.
        payment_count:
          type: number
          description: Payments made through it; a custom gateway in use cannot be deleted.
      required:
        - key
        - name
        - accent
        - is_enabled
        - method_keys
        - credentials
        - notification_endpoint_id
        - redirect_method
        - redirect_fields
        - notification_content_type
        - event_names
        - notification_body
        - notification_headers
        - is_builtin
        - is_modified
        - payment_count
      description: "An emulated provider: its checkout, credentials, redirect and notification."
    PaymentGatewayInput:
      type: object
      properties:
        key:
          type: string
          description: The `provider` value in the API and in `/providers/<key>/...` paths.
          examples:
            - upay
        name:
          type: string
          description: The gateway's name, shown on checkout pages.
          examples:
            - Upay
        accent:
          type: string
          description: "`#rrggbb`, used on its checkout pages."
          examples:
            - "#e2136e"
        is_enabled:
          type: boolean
          description: Off gateways reject new checkouts.
          examples:
            - true
        method_keys:
          type: array
          items:
            type: string
          description: The methods its checkout offers, in order.
          examples:
            - - upay_wallet
              - card
        credentials:
          type: array
          items:
            $ref: "#/components/schemas/GatewayCredential"
          description: The merchant credentials your app is configured with.
        notification_endpoint_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The webhook endpoint its IPN or webhook deliveries go to.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        redirect_method:
          type: string
          enum:
            - GET
            - POST
          description: "How the browser returns to your app: `GET` (query string) or `POST` (form)."
          examples:
            - POST
        redirect_fields:
          type: array
          items:
            $ref: "#/components/schemas/GatewayRedirectField"
          description: The parameters sent to your app on redirect.
        notification_content_type:
          type: string
          enum:
            - json
            - form
          description: "How the IPN or webhook body is sent: `json` or `form`."
          examples:
            - json
        event_names:
          type: object
          properties:
            payment.created:
              type: string
            payment.authorized:
              type: string
            payment.succeeded:
              type: string
            payment.failed:
              type: string
            payment.canceled:
              type: string
            payment.refunded:
              type: string
            payment.partially_refunded:
              type: string
            payment.dispute_opened:
              type: string
            payment.dispute_updated:
              type: string
            payment.dispute_closed:
              type: string
            checkout.completed:
              type: string
            checkout.expired:
              type: string
          required:
            - payment.created
            - payment.authorized
            - payment.succeeded
            - payment.failed
            - payment.canceled
            - payment.refunded
            - payment.partially_refunded
            - payment.dispute_opened
            - payment.dispute_updated
            - payment.dispute_closed
            - checkout.completed
            - checkout.expired
          description: The gateway's name for each native event; blank sends nothing.
          examples:
            - payment.succeeded: PAYMENT_SUCCESS
              payment.failed: PAYMENT_FAILED
              payment.refunded: ""
              checkout.completed: ""
              checkout.expired: ""
        notification_body:
          type: string
          description: The notification body, a template over the payment and the event.
          examples:
            - '{"status": "{{ event.name }}", "txn_id": "{{ payment.reference }}"}'
        notification_headers:
          type: array
          items:
            $ref: "#/components/schemas/GatewayHeaderTemplate"
          description: Headers sent with each notification.
      required:
        - key
        - name
        - accent
        - is_enabled
        - method_keys
        - credentials
        - notification_endpoint_id
        - redirect_method
        - redirect_fields
        - notification_content_type
        - event_names
        - notification_body
        - notification_headers
      description: Body of PATCH /api/v1/payments/gateways/{gatewayKey}; the key is fixed.
    PaymentGatewayPreview:
      type: object
      properties:
        payment_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        redirect:
          type: object
          properties:
            method:
              type: string
              enum:
                - GET
                - POST
            url:
              type: string
            fields:
              type: object
              additionalProperties:
                type: string
          required:
            - method
            - url
            - fields
        notification:
          anyOf:
            - type: object
              properties:
                event_name:
                  type: string
                headers:
                  type: object
                  additionalProperties:
                    type: string
                body:
                  type: string
              required:
                - event_name
                - headers
                - body
            - type: "null"
          description: Null when the gateway sends nothing for the event.
        problems:
          type: array
          items:
            $ref: "#/components/schemas/GatewayTemplateProblem"
        reference:
          $ref: "#/components/schemas/TemplateReference"
          description: What templates can read, for `{{` suggestions.
      required:
        - payment_id
        - redirect
        - notification
        - problems
        - reference
    PaymentGatewayPreviewRequest:
      type: object
      properties:
        gateway:
          $ref: "#/components/schemas/PaymentGatewayInput"
          description: The gateway settings to render, saved or not.
        payment_id:
          $ref: "#/components/schemas/Ulid"
          description: The payment to render against; the newest one when left out.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        event_type:
          $ref: "#/components/schemas/PaymentEventType"
          description: The native event to render the notification for.
          examples:
            - payment.succeeded
        redirect_outcome:
          type: string
          enum:
            - success
            - fail
            - cancel
          description: "The redirect to render: `success`, `fail` or `cancel`."
          examples:
            - success
      required:
        - gateway
        - event_type
        - redirect_outcome
      description: Body of POST /api/v1/payments/gateways/{gatewayKey}/preview.
    PaymentLineItem:
      type: object
      properties:
        name:
          type: string
        quantity:
          type: number
        unit_amount_minor:
          type: number
      required:
        - name
        - quantity
        - unit_amount_minor
    PaymentMethod:
      anyOf:
        - type: object
          properties:
            kind:
              type: string
              const: card
            brand:
              type: string
            last4:
              type: string
            exp_month:
              type: number
            exp_year:
              type: number
          required:
            - kind
            - brand
            - last4
            - exp_month
            - exp_year
        - type: object
          properties:
            kind:
              type: string
              const: wallet
            wallet_name:
              type: string
            masked_number:
              type: string
          required:
            - kind
            - wallet_name
            - masked_number
        - type: object
          properties:
            kind:
              type: string
              const: bank
            bank_name:
              type: string
          required:
            - kind
            - bank_name
      description: Never a full card number or CVC.
    PaymentMethodDefinition:
      type: object
      properties:
        key:
          type: string
          description: The method's key; fixed after creation.
          examples:
            - upay_wallet
        name:
          type: string
          description: The method's name on checkout pages.
          examples:
            - Upay wallet
        flow:
          type: string
          description: The key of the flow its checkout runs.
          examples:
            - wallet
        accent:
          type: string
          description: "`#rrggbb`, used on checkout pages."
          examples:
            - "#e2136e"
        is_enabled:
          type: boolean
          description: Off methods are hidden on checkout pages.
          examples:
            - true
        is_builtin:
          type: boolean
        is_modified:
          type: boolean
          description: A built-in that differs from its shipped default.
        test_cards:
          type: array
          items:
            $ref: "#/components/schemas/TestCardValue"
          description: Read by a card form step.
        test_numbers:
          type: array
          items:
            $ref: "#/components/schemas/TestNumberValue"
          description: Read by an account number or voucher code step.
        otp:
          type: string
          description: Read by an OTP step.
          examples:
            - "123456"
        pin:
          type: string
          description: Read by a PIN step.
          examples:
            - "12121"
        default_outcome:
          type: string
          enum:
            - succeed
            - decline
          description: The outcome when the flow has no deciding step.
          examples:
            - succeed
        test_account:
          type: string
          description: Read by a signed-in account step.
          examples:
            - sb-buyer@personal.example.com
        gateway_keys:
          type: array
          items:
            type: string
          description: Gateways whose checkout offers this method.
        payment_count:
          type: number
          description: Payments made with it; a custom method in use cannot be deleted.
      required:
        - key
        - name
        - flow
        - accent
        - is_enabled
        - is_builtin
        - is_modified
        - test_cards
        - test_numbers
        - otp
        - pin
        - default_outcome
        - test_account
        - gateway_keys
        - payment_count
      description: What a customer pays with on a checkout page, and its test values.
    PaymentMethodInput:
      type: object
      properties:
        key:
          type: string
          description: The method's key; fixed after creation.
          examples:
            - upay_wallet
        name:
          type: string
          description: The method's name on checkout pages.
          examples:
            - Upay wallet
        flow:
          type: string
          description: The key of the flow its checkout runs.
          examples:
            - wallet
        accent:
          type: string
          description: "`#rrggbb`, used on checkout pages."
          examples:
            - "#e2136e"
        is_enabled:
          type: boolean
          description: Off methods are hidden on checkout pages.
          examples:
            - true
        test_cards:
          type: array
          items:
            $ref: "#/components/schemas/TestCardValue"
          description: Read by a card form step.
        test_numbers:
          type: array
          items:
            $ref: "#/components/schemas/TestNumberValue"
          description: Read by an account number or voucher code step.
        otp:
          type: string
          description: Read by an OTP step.
          examples:
            - "123456"
        pin:
          type: string
          description: Read by a PIN step.
          examples:
            - "12121"
        default_outcome:
          type: string
          enum:
            - succeed
            - decline
          description: The outcome when the flow has no deciding step.
          examples:
            - succeed
        test_account:
          type: string
          description: Read by a signed-in account step.
          examples:
            - sb-buyer@personal.example.com
      required:
        - key
        - name
        - flow
        - accent
        - is_enabled
        - test_cards
        - test_numbers
        - otp
        - pin
        - default_outcome
        - test_account
      description: Body of POST and PATCH /api/v1/payments/methods; key and flow are fixed after creation.
    PaymentMethodValueKind:
      type: string
      enum:
        - test_cards
        - test_numbers
        - otp
        - pin
        - test_account
        - default_outcome
      description: A method value a step reads (17-payments, step catalogue).
    PaymentNotification:
      type: object
      properties:
        delivery_id:
          $ref: "#/components/schemas/Ulid"
        event_type:
          $ref: "#/components/schemas/AppEventType"
        provider_event_name:
          type: string
          description: The provider's own name, e.g. `checkout.session.completed` or `VALID`.
        status:
          $ref: "#/components/schemas/DeliveryStatus"
        status_code:
          type:
            - number
            - "null"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - delivery_id
        - event_type
        - provider_event_name
        - status
        - status_code
        - created_at
      description: One IPN or webhook sent for the payment, in the webhook delivery log.
    PaymentOutcomeProfile:
      type: string
      enum:
        - interactive
        - auto_success
        - auto_decline
        - random
      description: "What happens to a new hosted checkout: wait for the page, or settle at once."
    PaymentProvider:
      type: string
      description: "A gateway key: a built-in one (stripe, paypal, sslcommerz, bkash, native) or a custom one."
    PaymentRedirect:
      type: object
      properties:
        outcome:
          type: string
          enum:
            - success
            - fail
            - cancel
        url:
          type: string
        method:
          type: string
          enum:
            - GET
            - POST
        fields:
          type: object
          additionalProperties:
            type: string
          description: The parameters sent to the app, as the provider sends them.
        redirected_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - outcome
        - url
        - method
        - fields
        - redirected_at
    PaymentSimulateAction:
      type: string
      enum:
        - succeed
        - decline
        - refund
        - dispute
        - answer_dispute
        - resolve_dispute
        - expire
        - capture
        - void
    PaymentSimulateRequest:
      type: object
      properties:
        action:
          $ref: "#/components/schemas/PaymentSimulateAction"
          description: "What happens to the payment: `succeed`, `decline`, `refund`, `dispute`, `answer_dispute`, `resolve_dispute`, `expire`, `capture` or `void`."
          examples:
            - refund
        decline_reason:
          $ref: "#/components/schemas/DeclineReason"
          description: "For `decline`: why the bank declined."
          examples:
            - insufficient_funds
        refund_amount_minor:
          type: number
          description: "For `refund`: the amount in minor units; the full amount when left out."
          examples:
            - 500
        dispute_outcome:
          type: string
          enum:
            - won
            - lost
          description: "For `resolve_dispute`: `won` or `lost`."
          examples:
            - won
        dispute_evidence:
          type: string
          description: "For `answer_dispute`: the evidence sent to the bank."
          examples:
            - Signed delivery receipt attached.
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      required:
        - action
      description: Body of POST /api/v1/payments/{paymentId}/simulate.
    PaymentStatus:
      type: string
      enum:
        - requires_payment
        - requires_action
        - authorized
        - succeeded
        - failed
        - canceled
        - refunded
        - partially_refunded
        - disputed
    PaymentStepType:
      type: string
      enum:
        - card_form
        - account_number
        - voucher_code
        - otp
        - pin
        - signed_in_account
        - qr_code
        - reference_code
        - confirm
      description: The step types SendMock can show on a checkout page and check.
    PaymentStepTypeInfo:
      type: object
      properties:
        type:
          $ref: "#/components/schemas/PaymentStepType"
        name:
          type: string
        description:
          type: string
        is_deciding:
          type: boolean
          description: Decides the outcome from the method's test values; a flow has at most one.
        has_field:
          type: boolean
          description: Shows an input, so it needs a field label.
        method_values:
          type: array
          items:
            $ref: "#/components/schemas/PaymentMethodValueKind"
        default_labels:
          type: object
          properties:
            title:
              type: string
              description: Shown above the step; may be empty.
              examples:
                - Enter the code sent to your phone
            field_label:
              type: string
              description: The input's label; empty for steps without a field.
              examples:
                - Verification code
            hint:
              type: string
              description: Small text under the input; `{method}` and `{amount}` are replaced.
              examples:
                - We sent a 6 digit code to your {method} number.
            button_label:
              type: string
              description: The button's text.
              examples:
                - Verify
          required:
            - title
            - field_label
            - hint
            - button_label
      required:
        - type
        - name
        - description
        - is_deciding
        - has_field
        - method_values
        - default_labels
      description: "GET /api/v1/payments/step-types: one entry of the step catalogue."
    PaymentSubscription:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        provider:
          type: string
          description: The gateway's key.
        provider_name:
          type: string
        customer_email:
          type: string
        plan_name:
          type: string
        amount_minor:
          type: number
        currency:
          type: string
        interval:
          $ref: "#/components/schemas/SubscriptionInterval"
        status:
          $ref: "#/components/schemas/SubscriptionStatus"
        card_last4:
          type: string
          description: The last four digits of the test card that pays each renewal.
        trial_end:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        current_period_start:
          $ref: "#/components/schemas/IsoTimestamp"
        current_period_end:
          $ref: "#/components/schemas/IsoTimestamp"
        cancel_at_period_end:
          type: boolean
          description: True when it ends at the next advance instead of renewing.
        canceled_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        renewal_count:
          type: number
        payment_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: The payments charged for it, oldest first.
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        timeline:
          type: array
          items:
            $ref: "#/components/schemas/SubscriptionTimelineEvent"
      required:
        - id
        - provider
        - provider_name
        - customer_email
        - plan_name
        - amount_minor
        - currency
        - interval
        - status
        - card_last4
        - trial_end
        - current_period_start
        - current_period_end
        - cancel_at_period_end
        - canceled_at
        - renewal_count
        - payment_ids
        - created_at
        - timeline
      description: A subscription and its own clock, renewed when advanced.
    PaymentSubscriptionCancelRequest:
      type: object
      properties:
        at_period_end:
          type: boolean
          description: End at the next advance instead of now.
          examples:
            - false
      description: Body of POST /api/v1/payments/subscriptions/{subscriptionId}/cancel.
    PaymentSubscriptionCreateRequest:
      type: object
      properties:
        provider:
          type: string
          description: The gateway's key.
          examples:
            - stripe
        customer_email:
          type: string
          description: Who pays.
          examples:
            - sam@example.test
        plan_name:
          type: string
          description: The plan's name, shown on each renewal's payment.
          examples:
            - Pro monthly
        amount_minor:
          type: number
          description: The amount of each renewal in minor units.
          examples:
            - 1500
        currency:
          type: string
          description: ISO 4217 code; Settings > Payments' default currency when left out.
          examples:
            - USD
        interval:
          $ref: "#/components/schemas/SubscriptionInterval"
          description: "How often it renews: `day`, `week`, `month` or `year`."
          examples:
            - month
        trial_days:
          type: number
          description: Days before the first charge; none charges at once.
          examples:
            - 7
        card_number:
          type: string
          description: The test card that pays each renewal; `4242424242424242` when left out.
          examples:
            - "4000000000009995"
      required:
        - provider
        - customer_email
        - plan_name
        - amount_minor
        - interval
      description: Body of POST /api/v1/payments/subscriptions.
    PaymentSummary:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        provider:
          $ref: "#/components/schemas/PaymentProvider"
        provider_name:
          type: string
          description: The gateway's name, e.g. "SSLCommerz".
        provider_reference:
          type: string
          description: "The provider's main id: session, intent, order or transaction."
        amount_minor:
          type: number
        currency:
          type: string
          description: ISO 4217, e.g. USD, BDT, JPY.
        status:
          $ref: "#/components/schemas/PaymentStatus"
        customer_email:
          type:
            - string
            - "null"
        customer_name:
          type:
            - string
            - "null"
        failure_code:
          anyOf:
            - $ref: "#/components/schemas/DeclineReason"
            - type: string
              const: expired
            - type: "null"
        refunded_minor:
          type: number
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - provider
        - provider_name
        - provider_reference
        - amount_minor
        - currency
        - status
        - customer_email
        - customer_name
        - failure_code
        - refunded_minor
        - created_at
    PaymentTimelineEvent:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/PaymentTimelineKind"
        description:
          type: string
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - kind
        - description
        - created_at
    PaymentTimelineKind:
      type: string
      enum:
        - created
        - three_ds
        - authorized
        - captured
        - succeeded
        - failed
        - canceled
        - expired
        - refunded
        - dispute_opened
        - dispute_answered
        - dispute_closed
        - redirected
        - delayed
        - notification_sent
    Project:
      type: object
      properties:
        key:
          type: string
          description: What apps send as the SMTP username, the `X-SendMock-Project` header or the `/projects/<key>/` URL prefix. It never changes.
          examples:
            - shop
        name:
          type: string
          description: A name for the project, shown in the UI.
          examples:
            - Shop
        created_at:
          type: string
          examples:
            - 2026-11-07T10:00:00Z
        email_count:
          type: number
          examples:
            - 12
        sms_count:
          type: number
          examples:
            - 4
        verification_count:
          type: number
          examples:
            - 2
      required:
        - key
        - name
        - created_at
        - email_count
        - sms_count
        - verification_count
      description: "A name for captured traffic: the emails, SMS and verifications sent to it."
    ProjectInput:
      type: object
      properties:
        key:
          type: string
          description: What apps send as the SMTP username, the `X-SendMock-Project` header or the `/projects/<key>/` URL prefix. It never changes.
          examples:
            - shop
        name:
          type: string
          description: A name for the project, shown in the UI.
          examples:
            - Shop
      required:
        - key
        - name
      description: Body of POST /api/v1/projects.
    ProjectUpdate:
      type: object
      properties:
        name:
          type: string
          description: A name for the project, shown in the UI.
          examples:
            - Shop
      required:
        - name
      additionalProperties: false
      description: "Body of PATCH /api/v1/projects/{projectKey}: the new name."
    ProviderCredential:
      type: object
      properties:
        name:
          type: string
          description: The credential's name, readable in templates as `credentials.<name>`.
          examples:
            - api_key
        value:
          type: string
          description: The value; a secret comes back masked, and sending the masked value back keeps the stored one.
          examples:
            - SG.test_key_123
        is_secret:
          type: boolean
          description: Masks the value in the UI, API answers, logs and MCP output.
          examples:
            - true
      required:
        - name
        - value
        - is_secret
      description: A credential your app is configured with; a secret's value comes back masked (`••••` and the last 4).
    ProviderCredentialReveal:
      type: object
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
      description: GET .../providers/{providerKey}/credentials/{credentialName}.
    ProviderDefinitionProblem:
      type: object
      properties:
        part:
          type: string
        message:
          type: string
        severity:
          type: string
          enum:
            - error
            - warning
      required:
        - part
        - message
        - severity
      description: One template or definition problem, named by the part it is in, e.g. `Success response body`.
    ProviderErrorKind:
      type: string
      enum:
        - missing_field
        - invalid_value
        - unauthorized
        - not_found
        - rate_limited
      description: The kinds of error a provider answers with its own shape.
    ProviderErrorResponse:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/ProviderErrorKind"
          description: The kind of error this response answers.
          examples:
            - missing_field
        status:
          type: number
          description: The HTTP status code.
          examples:
            - 202
        headers:
          type: array
          items:
            $ref: "#/components/schemas/ProviderHeaderTemplate"
          description: Headers sent with the response.
        body:
          type: string
          description: The body, a template over the message, the request and the error.
          examples:
            - '{"id": "{{ message.provider_id }}"}'
      required:
        - body
        - headers
        - kind
        - status
      description: The answer for one kind of error.
    ProviderFieldMapping:
      type: object
      properties:
        part:
          $ref: "#/components/schemas/ProviderMessagePart"
          description: The part of the message.
          examples:
            - to
        source:
          type: string
          description: "The request path it is read from: a JSON path, a form field or a query parameter."
          examples:
            - personalizations[0].to[*].email
      required:
        - part
        - source
      description: Where one part of a sent message is read from in the request.
    ProviderHeaderTemplate:
      type: object
      properties:
        name:
          type: string
          description: The header name.
          examples:
            - X-Message-Id
        template:
          type: string
          description: The value, a template over the message and the request.
          examples:
            - "{{ message.provider_id }}"
      required:
        - name
        - template
      description: A response header, from a template.
    ProviderMessagePart:
      type: string
      enum:
        - from
        - to
        - cc
        - bcc
        - reply_to
        - subject
        - text
        - html
        - attachments
        - headers
        - tags
        - template_id
        - template_data
        - raw
        - body
        - media_urls
        - messaging_service
        - status_callback_url
      description: A part of a message a request can carry; email and SMS use their own parts.
    ProviderOperation:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/ProviderOperationKind"
          description: What the request does, from the kinds SendMock can run.
          examples:
            - send
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          description: The HTTP method.
          examples:
            - POST
        path:
          type: string
          description: The path at the provider's API, with `{name}` for variable parts.
          examples:
            - /v3/{domain}/messages
        request_format:
          type: string
          enum:
            - json
            - form
            - multipart
            - query
          description: "How the request body is sent: `json`, `form`, `multipart`, or `query` for none."
          examples:
            - multipart
      required:
        - kind
        - method
        - path
        - request_format
      description: One request the provider answers.
    ProviderOperationKind:
      anyOf:
        - $ref: "#/components/schemas/EmailProviderOperationKind"
        - $ref: "#/components/schemas/SmsProviderOperationKind"
    ProviderResponseTemplate:
      type: object
      properties:
        status:
          type: number
          description: The HTTP status code.
          examples:
            - 202
        headers:
          type: array
          items:
            $ref: "#/components/schemas/ProviderHeaderTemplate"
          description: Headers sent with the response.
        body:
          type: string
          description: The body, a template over the message, the request and the error.
          examples:
            - '{"id": "{{ message.provider_id }}"}'
      required:
        - status
        - headers
        - body
      description: "What the provider answers: a status, headers and a body template."
    ProviderSampleRequest:
      type: object
      properties:
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
          description: The HTTP method.
          examples:
            - POST
        path:
          type: string
          description: The path as your app would call it.
          examples:
            - /v3/mail/send
        headers:
          type: object
          additionalProperties:
            type: string
          description: The request headers.
          examples:
            - content-type: application/json
              authorization: Bearer SG.test_key_123
        body:
          type: string
          description: The raw request body.
          examples:
            - '{"personalizations": [{"to": [{"email": "ana@example.test"}]}], "from": {"email": "app@example.test"}, "subject": "Welcome", "content": [{"type": "text/plain", "value": "Hi"}]}'
      required:
        - method
        - path
        - headers
        - body
      description: A request to run through a provider in the preview.
    ProviderValidationRule:
      type: object
      properties:
        part:
          $ref: "#/components/schemas/ProviderMessagePart"
          description: The part of the message checked.
          examples:
            - to
        check:
          type: string
          enum:
            - required
            - email_address
            - e164_number
            - max_length
          description: "The check: present, an email address, an E.164 number, or at most `max_length` characters."
          examples:
            - required
        max_length:
          type:
            - number
            - "null"
          description: The longest value allowed, for `max_length`; null otherwise.
          examples:
            - null
        error_kind:
          $ref: "#/components/schemas/ProviderErrorKind"
          description: The error answered when the check fails.
          examples:
            - missing_field
      required:
        - part
        - check
        - max_length
        - error_kind
      description: A check on a request, and the error it answers when the check fails.
    PushNotification:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        provider:
          $ref: "#/components/schemas/PushProvider"
          examples:
            - fcm
        provider_message_id:
          type: string
          description: The id the provider's answer named, such as FCM's message name.
          examples:
            - projects/shop-app/messages/0:1762500000000000%a1b2c3d4e5f60718
        device_token:
          type: string
          description: The FCM registration token, Expo push token or OneSignal subscription it went to; a topic or condition send shows as `topic:<name>` or `condition:<expression>`.
          examples:
            - dQw4w9WgXcQ:APA91bE1
        platform:
          type:
            - string
            - "null"
          enum:
            - android
            - ios
            - web
            - null
          description: "`android`, `ios` or `web` when the message targets one."
        title:
          type:
            - string
            - "null"
          examples:
            - Your order shipped
        body:
          type:
            - string
            - "null"
          examples:
            - Track it in the app.
        image_url:
          type:
            - string
            - "null"
        data:
          type: object
          additionalProperties: {}
          description: The data payload, key to value.
        status:
          $ref: "#/components/schemas/PushStatus"
        error_reason:
          type:
            - string
            - "null"
        request:
          description: The request body as the app sent it.
        response_status:
          type: number
          examples:
            - 200
        response:
          description: What SendMock answered, in the provider's shape.
        project:
          type: string
          examples:
            - default
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - provider
        - provider_message_id
        - device_token
        - platform
        - title
        - body
        - image_url
        - data
        - status
        - error_reason
        - request
        - response_status
        - response
        - project
        - created_at
      description: A push notification as the provider's API received it, with what SendMock answered.
    PushProvider:
      type: string
      enum:
        - fcm
        - expo
        - onesignal
    PushStatus:
      type: string
      enum:
        - sent
        - failed
    RecentFailedDelivery:
      type: object
      properties:
        delivery_id:
          $ref: "#/components/schemas/Ulid"
        endpoint_name:
          type: string
        event_type:
          $ref: "#/components/schemas/AppEventType"
        status_code:
          type:
            - number
            - "null"
        error_message:
          type:
            - string
            - "null"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - delivery_id
        - endpoint_name
        - event_type
        - status_code
        - error_message
        - created_at
    RecordedHttpRequest:
      type: object
      properties:
        method:
          $ref: "#/components/schemas/HttpMethod"
        url:
          type: string
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
      required:
        - method
        - url
        - headers
        - body
    RecordedHttpResponse:
      type: object
      properties:
        status_code:
          type: number
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
        is_body_truncated:
          type: boolean
      required:
        - status_code
        - headers
        - body
        - is_body_truncated
    ReleaseChannel:
      type: string
      enum:
        - stable
        - beta
        - edge
        - dev
      description: The release line a build comes from; it decides which updates are offered.
    RenderMode:
      type: string
      enum:
        - strict
        - lenient
    RenderProblem:
      type: object
      properties:
        message:
          type: string
        severity:
          type: string
          enum:
            - error
            - warning
        source:
          type: string
          description: '"url", "query.0", "header.0", "field.0" or "body".'
        line:
          type:
            - number
            - "null"
        column:
          type:
            - number
            - "null"
      required:
        - message
        - severity
        - source
        - line
        - column
      description: A render problem and where it comes from, e.g. "body" at line 3.
    RetryPolicy:
      type: object
      properties:
        max_attempts:
          type: number
          description: Attempts in total, the first one included.
          examples:
            - 5
        backoff_seconds:
          type: array
          items:
            type: number
          description: Seconds to wait before each retry, in order; the last value repeats.
          examples:
            - - 1
              - 5
              - 30
              - 120
              - 600
        retry_on_client_errors:
          type: boolean
          description: Also retry on 4xx answers; 5xx, timeouts and connection errors are always retried.
          examples:
            - false
      required:
        - max_attempts
        - backoff_seconds
        - retry_on_client_errors
    RevealedEndpointSecret:
      type: object
      properties:
        secret:
          type: string
      required:
        - secret
      description: GET /api/v1/webhooks/endpoints/{endpointId}/secret.
    RotateSecretRequest:
      type: object
      properties:
        overlap_hours:
          type: number
          description: How many hours the old secret keeps signing next to the new one (default 24).
          examples:
            - 24
      required:
        - overlap_hours
      description: Body of POST /api/v1/webhooks/endpoints/{endpointId}/rotate-secret.
    RuleCondition:
      type: object
      properties:
        field:
          type: string
          description: "The message field: for email `from`, `to`, `cc`, `subject`, `body`, `header:<name>`, `has_attachment`, `tag`; for SMS `from`, `to`, `body`, `status`, `api`; for push `token`, `title`, `body`, `provider`, `status`; for opens `open_count`, `first_open`, `source`."
          examples:
            - subject
        operator:
          $ref: "#/components/schemas/RuleFilterOperator"
          description: "`equals`, `contains`, `starts_with` and `matches` (glob) ignore case; `regex` is case-sensitive; `exists` is true when the field has a value."
          examples:
            - contains
        value:
          type: string
          description: The value to compare with; ignored by `exists`.
          examples:
            - Ticket
      required:
        - field
        - operator
        - value
    RuleFilter:
      anyOf:
        - type: object
          properties:
            all:
              type: array
              items:
                $ref: "#/components/schemas/RuleFilter"
              description: Matches when every filter in the list matches.
          required:
            - all
        - type: object
          properties:
            any:
              type: array
              items:
                $ref: "#/components/schemas/RuleFilter"
              description: Matches when at least one filter in the list matches.
          required:
            - any
        - type: object
          properties:
            not:
              $ref: "#/components/schemas/RuleFilter"
              description: Matches when the filter inside does not.
          required:
            - not
        - $ref: "#/components/schemas/RuleCondition"
    RuleFilterOperator:
      type: string
      enum:
        - equals
        - contains
        - starts_with
        - matches
        - regex
        - exists
    RulePreviewItem:
      type: object
      properties:
        message_kind:
          type: string
          enum:
            - email
            - sms
        message_id:
          $ref: "#/components/schemas/Ulid"
        title:
          type: string
          description: Subject, or the SMS body.
        detail:
          type: string
          description: Sender address, or "+1555... to +1415...".
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        is_match:
          type: boolean
      required:
        - message_kind
        - message_id
        - title
        - detail
        - created_at
        - is_match
    RulePreviewRequest:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types to test, as in the rule.
          examples:
            - - email.received
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The filter to test against recent messages; null matches all.
      required:
        - events
        - filter
      description: Body of POST /api/v1/webhooks/rules/preview.
    RulePreviewResult:
      type: object
      properties:
        checked_count:
          type: number
        match_count:
          type: number
        items:
          type: array
          items:
            $ref: "#/components/schemas/RulePreviewItem"
          description: Newest first.
      required:
        - checked_count
        - match_count
        - items
    SampleKind:
      type: string
      enum:
        - email
        - sms
        - verification
        - http
      description: What `POST /api/v1/samples/{kind}` can create.
    SampleOptions:
      type: object
      properties:
        to:
          type: string
          description: The recipient of the sample email.
          examples:
            - user@example.test
        subject:
          type: string
          description: The subject of the sample email.
          examples:
            - Hello from SendMock
        html:
          type: string
          description: The HTML body of the sample email.
          examples:
            - <p>It works!</p>
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      description: Optional body of POST /api/v1/samples/email (`sendmock email send-test`).
    SaveAsTemplateRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the new custom template.
          examples:
            - Order webhook
      required:
        - name
      description: Body of POST /api/v1/webhooks/saved/{savedId}/template.
    SavedDelivery:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
        endpoint_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        event_type:
          anyOf:
            - $ref: "#/components/schemas/AppEventType"
            - type: "null"
          description: The event of the delivery it was saved from; null for a composer request.
        template_id:
          type: string
        request:
          $ref: "#/components/schemas/RecordedHttpRequest"
        saved_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - name
        - endpoint_id
        - event_type
        - template_id
        - request
        - saved_at
    SavedDeliveryInput:
      type: object
      properties:
        name:
          type: string
          description: A name for the saved delivery.
          examples:
            - Failed order webhook
        delivery_id:
          $ref: "#/components/schemas/Ulid"
          description: The delivery to save.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      required:
        - name
        - delivery_id
      description: Body of POST /api/v1/webhooks/saved.
    SavedDeliveryRename:
      type: object
      properties:
        name:
          type: string
          description: The new name.
          examples:
            - Order webhook, missing SKU
      required:
        - name
      description: Body of PATCH /api/v1/webhooks/saved/{savedId}.
    SavedDeliverySendRequest:
      type: object
      properties:
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
          description: The endpoint to send it to.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        rerender:
          type: boolean
          description: Renders again with the endpoint's template and variables; false sends the saved request as it was.
          examples:
            - false
      required:
        - endpoint_id
        - rerender
      description: Body of POST /api/v1/webhooks/saved/{savedId}/send.
    ScenarioProblem:
      type: object
      properties:
        step:
          type:
            - number
            - "null"
          description: One-based step number, or null for the whole file.
        message:
          type: string
      required:
        - step
        - message
    ScenarioReport:
      type: object
      properties:
        name:
          type: string
        is_passed:
          type: boolean
        started_at:
          $ref: "#/components/schemas/IsoTimestamp"
        duration_ms:
          type: number
        steps:
          type: array
          items:
            $ref: "#/components/schemas/ScenarioStepResult"
      required:
        - name
        - is_passed
        - started_at
        - duration_ms
        - steps
      description: "Answer of POST /api/v1/scenarios/run: a step-by-step report."
    ScenarioRequest:
      type: object
      properties:
        scenario:
          type: string
          description: The scenario file's text, in TOML.
          examples:
            - |-
              name = "otp-login"

              [[steps]]
              run = "sample.send"
              with = { kind = "sms" }
      required:
        - scenario
      description: "Body of POST /api/v1/scenarios/validate and /run: a scenario file's TOML text."
    ScenarioStepResult:
      type: object
      properties:
        step:
          type: number
          description: One-based.
        run:
          type: string
          description: The operation, e.g. `webhook.endpoint.create`, or `http`, `assert`, `sleep`.
        status:
          $ref: "#/components/schemas/ScenarioStepStatus"
        input:
          type: object
          additionalProperties: {}
        output: {}
        error:
          type:
            - string
            - "null"
        saved_as:
          type:
            - string
            - "null"
          description: The name the step's output was saved under for later steps.
        duration_ms:
          type: number
      required:
        - step
        - run
        - status
        - input
        - output
        - error
        - saved_as
        - duration_ms
    ScenarioStepStatus:
      type: string
      enum:
        - passed
        - failed
        - skipped
    ScenarioValidation:
      type: object
      properties:
        is_valid:
          type: boolean
        name:
          type:
            - string
            - "null"
        step_count:
          type: number
        problems:
          type: array
          items:
            $ref: "#/components/schemas/ScenarioProblem"
      required:
        - is_valid
        - name
        - step_count
        - problems
    SeedChangedItem:
      type: object
      properties:
        item_kind:
          type: string
          description: What kind of item, e.g. "Virtual number" or "Webhook endpoint".
        item_name:
          type: string
        change:
          type: string
          enum:
            - added
            - edited
      required:
        - item_kind
        - item_name
        - change
    SeedFileRequest:
      type: object
      properties:
        seed_toml:
          type: string
          description: The seed file's text (`sendmock.seed.toml`).
          examples:
            - |-
              [[numbers]]
              number = "+15550001111"
              label = "Support line"
      required:
        - seed_toml
      description: Body of POST /api/v1/seed/validate and /seed/apply.
    SeedStatus:
      type: object
      properties:
        source_path:
          type:
            - string
            - "null"
        applied_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        changed_items:
          type: array
          items:
            $ref: "#/components/schemas/SeedChangedItem"
          description: Configuration added or edited since the seed was applied.
      required:
        - source_path
        - applied_at
        - changed_items
      description: GET /api/v1/seed/status.
    SeedValidation:
      type: object
      properties:
        is_valid:
          type: boolean
        errors:
          type: array
          items:
            $ref: "#/components/schemas/SeedValidationError"
        summary:
          type: array
          items:
            type: object
            properties:
              item_kind:
                type: string
              item_count:
                type: number
            required:
              - item_kind
              - item_count
          description: How many items of each kind the file would create or update.
      required:
        - is_valid
        - errors
        - summary
      description: Result of POST /api/v1/seed/validate (and of apply when invalid).
    SeedValidationError:
      type: object
      properties:
        line:
          type: number
        message:
          type: string
      required:
        - line
        - message
    SimulatedEmailOutcome:
      type: object
      properties:
        event:
          $ref: "#/components/schemas/EmailDeliveryStatus"
          description: The delivery event to simulate; it is added to the timeline and fires its webhook.
          examples:
            - bounced
        bounce_type:
          type: string
          enum:
            - hard
            - soft
          description: "For `bounced` only: a hard bounce (the address does not exist) or a soft one (try again later)."
          examples:
            - hard
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      required:
        - event
    SmsApi:
      type: string
      description: "The API a message was sent through: `native`, or the key of the SMS provider (`twilio`, or a custom provider's key; docs/plan/22)."
      examples:
        - twilio
    SmsCallbackAttempt:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        reported_status:
          $ref: "#/components/schemas/SmsStatus"
        attempt:
          type: number
        request:
          $ref: "#/components/schemas/RecordedHttpRequest"
        response:
          anyOf:
            - $ref: "#/components/schemas/RecordedHttpResponse"
            - type: "null"
        duration_ms:
          type:
            - number
            - "null"
        error_message:
          type:
            - string
            - "null"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - reported_status
        - attempt
        - request
        - response
        - duration_ms
        - error_message
        - created_at
      description: One call to the message's status callback URL, in the provider's format.
    SmsChannel:
      type: string
      enum:
        - sms
        - whatsapp
    SmsDirection:
      type: string
      enum:
        - outbound
        - inbound
    SmsEncoding:
      type: string
      enum:
        - GSM-7
        - UCS-2
    SmsMedia:
      type: object
      properties:
        media_index:
          type: number
        content_type:
          type: string
        size_bytes:
          type:
            - number
            - "null"
        filename:
          type:
            - string
            - "null"
        source_url:
          type:
            - string
            - "null"
          description: Where the app said to fetch it (`MediaUrl`), null for inline files.
        url:
          type: string
          description: "SendMock's copy: `/api/v1/sms/{smsId}/media/{mediaIndex}`."
      required:
        - media_index
        - content_type
        - size_bytes
        - filename
        - source_url
        - url
      description: One MMS or WhatsApp media file stored with a message.
    SmsMessage:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        provider_id:
          type: string
        direction:
          $ref: "#/components/schemas/SmsDirection"
        channel:
          $ref: "#/components/schemas/SmsChannel"
        api:
          $ref: "#/components/schemas/SmsApi"
        from_number:
          type: string
        to_number:
          type: string
        body:
          type: string
        encoding:
          $ref: "#/components/schemas/SmsEncoding"
        segments:
          type: number
        media:
          type: array
          items:
            $ref: "#/components/schemas/SmsMedia"
        status:
          $ref: "#/components/schemas/SmsStatus"
        error_code:
          type:
            - string
            - "null"
        status_callback_url:
          type:
            - string
            - "null"
        messaging_service_sid:
          type:
            - string
            - "null"
        account:
          type:
            - string
            - "null"
        extracted:
          $ref: "#/components/schemas/ExtractedData"
        opened_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        open_count:
          type: number
        reply_webhook:
          anyOf:
            - $ref: "#/components/schemas/SmsReplyWebhookResult"
            - type: "null"
          description: "Inbound only: what the number's reply webhook answered; null when it has none."
        in_reply_to_sms_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: "A TwiML reply: the inbound message it answers."
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        updated_at:
          $ref: "#/components/schemas/IsoTimestamp"
        project:
          type: string
          description: "The project the message was sent to: `default` unless the sender named another."
          examples:
            - default
      required:
        - id
        - provider_id
        - direction
        - channel
        - api
        - from_number
        - to_number
        - body
        - encoding
        - segments
        - media
        - status
        - error_code
        - status_callback_url
        - messaging_service_sid
        - account
        - extracted
        - opened_at
        - open_count
        - reply_webhook
        - in_reply_to_sms_id
        - created_at
        - updated_at
        - project
    SmsMessageDetail:
      type: object
      properties:
        status_history:
          type: array
          items:
            $ref: "#/components/schemas/SmsStatusChange"
        request_body:
          anyOf:
            - type: object
              additionalProperties: {}
            - type: "null"
        api_request_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        callback_attempts:
          type: array
          items:
            $ref: "#/components/schemas/SmsCallbackAttempt"
        reply_webhook_attempts:
          type: array
          items:
            $ref: "#/components/schemas/SmsReplyWebhookAttempt"
          description: Inbound only, oldest first; every Resend adds attempts.
        id:
          $ref: "#/components/schemas/Ulid"
        provider_id:
          type: string
        direction:
          $ref: "#/components/schemas/SmsDirection"
        channel:
          $ref: "#/components/schemas/SmsChannel"
        api:
          $ref: "#/components/schemas/SmsApi"
        from_number:
          type: string
        to_number:
          type: string
        body:
          type: string
        encoding:
          $ref: "#/components/schemas/SmsEncoding"
        segments:
          type: number
        media:
          type: array
          items:
            $ref: "#/components/schemas/SmsMedia"
        status:
          $ref: "#/components/schemas/SmsStatus"
        error_code:
          type:
            - string
            - "null"
        status_callback_url:
          type:
            - string
            - "null"
        messaging_service_sid:
          type:
            - string
            - "null"
        account:
          type:
            - string
            - "null"
        extracted:
          $ref: "#/components/schemas/ExtractedData"
        opened_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        open_count:
          type: number
        reply_webhook:
          anyOf:
            - $ref: "#/components/schemas/SmsReplyWebhookResult"
            - type: "null"
          description: "Inbound only: what the number's reply webhook answered; null when it has none."
        in_reply_to_sms_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: "A TwiML reply: the inbound message it answers."
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        updated_at:
          $ref: "#/components/schemas/IsoTimestamp"
        project:
          type: string
          description: "The project the message was sent to: `default` unless the sender named another."
          examples:
            - default
      required:
        - account
        - api
        - api_request_id
        - body
        - callback_attempts
        - channel
        - created_at
        - direction
        - encoding
        - error_code
        - extracted
        - from_number
        - id
        - in_reply_to_sms_id
        - media
        - messaging_service_sid
        - open_count
        - opened_at
        - project
        - provider_id
        - reply_webhook
        - reply_webhook_attempts
        - request_body
        - segments
        - status
        - status_callback_url
        - status_history
        - to_number
        - updated_at
    SmsOutcomeKind:
      type: string
      enum:
        - reject
        - undelivered
        - failed
        - delayed_delivery
        - read
      description: What a custom outcome number does to a matching message.
    SmsOutcomeRule:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        position:
          type: number
          description: 1-based order; lower numbers are checked first.
        match_field:
          type: string
          enum:
            - to
            - from
          description: Match the pattern against the recipient (`to`) or the sender (`from`).
          examples:
            - to
        pattern:
          type: string
          description: Exact E.164 number, or `*` for any digits, e.g. `+1555777*`.
          examples:
            - +1555777*
        outcome:
          $ref: "#/components/schemas/SmsOutcomeKind"
          description: "What happens to a matching message: `reject` (the send fails), `undelivered`, `failed`, `delayed_delivery` or `read`."
          examples:
            - undelivered
        error_code:
          type:
            - string
            - "null"
          description: Required for `reject`, `undelivered` and `failed`.
          examples:
            - "30003"
        delay_seconds:
          type:
            - number
            - "null"
          description: Required for `delayed_delivery`.
          examples:
            - 30
        note:
          type: string
          description: Why the rule exists, shown in the list.
          examples:
            - Unreachable handset for the retry test
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - id
        - position
        - match_field
        - pattern
        - outcome
        - error_code
        - delay_seconds
        - note
        - is_enabled
        - created_by
      description: "A custom outcome number: first enabled match wins."
    SmsOutcomeRuleInput:
      type: object
      properties:
        match_field:
          type: string
          enum:
            - to
            - from
          description: Match the pattern against the recipient (`to`) or the sender (`from`).
          examples:
            - to
        pattern:
          type: string
          description: Exact E.164 number, or `*` for any digits, e.g. `+1555777*`.
          examples:
            - +1555777*
        outcome:
          $ref: "#/components/schemas/SmsOutcomeKind"
          description: "What happens to a matching message: `reject` (the send fails), `undelivered`, `failed`, `delayed_delivery` or `read`."
          examples:
            - undelivered
        error_code:
          type:
            - string
            - "null"
          description: Required for `reject`, `undelivered` and `failed`.
          examples:
            - "30003"
        delay_seconds:
          type:
            - number
            - "null"
          description: Required for `delayed_delivery`.
          examples:
            - 30
        note:
          type: string
          description: Why the rule exists, shown in the list.
          examples:
            - Unreachable handset for the retry test
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
      required:
        - match_field
        - pattern
        - outcome
        - error_code
        - delay_seconds
        - note
        - is_enabled
      description: Body of POST and PATCH /api/v1/outcome-rules/sms.
    SmsOutcomeRuleInputPatch:
      type: object
      properties:
        match_field:
          type: string
          enum:
            - to
            - from
          description: Match the pattern against the recipient (`to`) or the sender (`from`).
          examples:
            - to
        pattern:
          type: string
          description: Exact E.164 number, or `*` for any digits, e.g. `+1555777*`.
          examples:
            - +1555777*
        outcome:
          $ref: "#/components/schemas/SmsOutcomeKind"
          description: "What happens to a matching message: `reject` (the send fails), `undelivered`, `failed`, `delayed_delivery` or `read`."
          examples:
            - undelivered
        error_code:
          type:
            - string
            - "null"
          description: Required for `reject`, `undelivered` and `failed`.
          examples:
            - "30003"
        delay_seconds:
          type:
            - number
            - "null"
          description: Required for `delayed_delivery`.
          examples:
            - 30
        note:
          type: string
          description: Why the rule exists, shown in the list.
          examples:
            - Unreachable handset for the retry test
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
    SmsOutcomeTestRequest:
      type: object
      properties:
        number:
          type: string
          description: The number to test against the outcome rules and Twilio's magic numbers.
          examples:
            - "+15005550001"
        match_field:
          type: string
          enum:
            - to
            - from
          description: Whether the number is the message's recipient (`to`) or sender (`from`).
          examples:
            - to
      required:
        - number
        - match_field
      description: Body of POST /api/v1/outcome-rules/sms/test.
    SmsProviderOperationKind:
      type: string
      enum:
        - send
        - fetch
        - list
        - cancel
        - start_verification
        - check_verification
      description: The SMS requests SendMock knows how to run (a new kind needs code).
    SmsReplyWebhookAttempt:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        is_fallback:
          type: boolean
        request:
          $ref: "#/components/schemas/RecordedHttpRequest"
        response:
          anyOf:
            - $ref: "#/components/schemas/RecordedHttpResponse"
            - type: "null"
        duration_ms:
          type:
            - number
            - "null"
        error_code:
          type:
            - string
            - "null"
        error_message:
          type:
            - string
            - "null"
        twiml:
          type: array
          items:
            $ref: "#/components/schemas/TwimlVerb"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - is_fallback
        - request
        - response
        - duration_ms
        - error_code
        - error_message
        - twiml
        - created_at
      description: One call to a reply webhook URL, primary or fallback.
    SmsReplyWebhookResult:
      type: object
      properties:
        target:
          type: string
          enum:
            - messaging_service
            - number
          description: A Messaging Service set to "Send a webhook", or the number's own URL.
        outcome:
          type: string
          enum:
            - succeeded
            - failed
        status_code:
          type:
            - number
            - "null"
          description: Of the last attempt.
        error_code:
          type:
            - string
            - "null"
          description: Twilio's code for the primary URL's failure, e.g. "11205".
        used_fallback:
          type: boolean
          description: The primary failed and the fallback URL answered.
        reply_count:
          type: number
          description: Messages created from the TwiML.
      required:
        - target
        - outcome
        - status_code
        - error_code
        - used_fallback
        - reply_count
      description: The outcome of an inbound message's reply webhook, for the bubble.
    SmsSimulationProfile:
      type: string
      enum:
        - instant
        - realistic
        - manual
    SmsStatus:
      type: string
      enum:
        - queued
        - sent
        - delivered
        - undelivered
        - failed
        - received
    SmsStatusChange:
      type: object
      properties:
        status:
          $ref: "#/components/schemas/SmsStatus"
        at:
          $ref: "#/components/schemas/IsoTimestamp"
        error_code:
          type:
            - string
            - "null"
      required:
        - status
        - at
        - error_code
    SmsStatusUpdate:
      type: object
      properties:
        status:
          $ref: "#/components/schemas/SmsStatus"
          description: The new status; fires the status callback and the matching event.
          examples:
            - delivered
        error_code:
          type:
            - string
            - "null"
          description: A Twilio error code for `failed` or `undelivered`, e.g. `30003` (unreachable).
          examples:
            - "30003"
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: Send this action's webhooks to exactly these endpoints (IDs from `GET /api/v1/webhooks/endpoints`) instead of the ones the rules pick; an empty list sends none. Leave it out to let the rules decide.
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/WebhookRequestEdit"
          description: "Payloads edited for this action, by endpoint: each body is sent as written instead of the rendered one and signed over those bytes. Leave it out to send the rendered payloads."
      required:
        - status
      description: "Body of `POST /sms/{smsId}/status`: a manual status change."
    SmsThread:
      type: object
      properties:
        thread_id:
          type: string
        app_number:
          type: string
        contact_number:
          type: string
        channel:
          $ref: "#/components/schemas/SmsChannel"
        last_message:
          $ref: "#/components/schemas/SmsMessage"
        message_count:
          type: number
        unread_count:
          type: number
      required:
        - thread_id
        - app_number
        - contact_number
        - channel
        - last_message
        - message_count
        - unread_count
      description: A conversation between two numbers.
    SmtpSession:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        remote_address:
          type: string
        helo_name:
          type: string
        tls_version:
          type:
            - string
            - "null"
        auth_mechanism:
          type:
            - string
            - "null"
        auth_user:
          type:
            - string
            - "null"
        result:
          $ref: "#/components/schemas/SmtpSessionResult"
        failure_reason:
          type:
            - string
            - "null"
        email_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
        transcript:
          type: string
          description: "One line per command or reply, prefixed `C: ` (client) or `S: ` (server)."
        started_at:
          $ref: "#/components/schemas/IsoTimestamp"
        ended_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - remote_address
        - helo_name
        - tls_version
        - auth_mechanism
        - auth_user
        - result
        - failure_reason
        - email_ids
        - transcript
        - started_at
        - ended_at
    SmtpSessionResult:
      type: string
      enum:
        - delivered
        - rejected
        - aborted
    SpamCheckReport:
      type: object
      properties:
        is_available:
          type: boolean
          description: False when no SpamAssassin server is configured.
        score:
          type:
            - number
            - "null"
        threshold:
          type: number
        rules:
          type: array
          items:
            $ref: "#/components/schemas/SpamCheckRule"
      required:
        - is_available
        - score
        - threshold
        - rules
    SpamCheckRule:
      type: object
      properties:
        name:
          type: string
        score:
          type: number
        description:
          type: string
      required:
        - name
        - score
        - description
    SubscriptionInterval:
      type: string
      enum:
        - day
        - week
        - month
        - year
      description: How often a subscription renews.
    SubscriptionStatus:
      type: string
      enum:
        - trialing
        - active
        - past_due
        - canceled
    SubscriptionTimelineEvent:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/SubscriptionTimelineKind"
        description:
          type: string
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - kind
        - description
        - created_at
    SubscriptionTimelineKind:
      type: string
      enum:
        - created
        - renewed
        - payment_failed
        - cancel_scheduled
        - canceled
    TagRule:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Tag password resets
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The webhook rule filter, over email fields; null matches every email.
        tag:
          type: string
          description: The tag added to each matching email.
          examples:
            - password-reset
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
        position:
          type: number
          description: One-based; rules run in this order.
      required:
        - id
        - name
        - filter
        - tag
        - is_enabled
        - position
      description: Adds a tag to arriving emails that match its filter.
    TagRuleInput:
      type: object
      properties:
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Tag password resets
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The webhook rule filter, over email fields; null matches every email.
        tag:
          type: string
          description: The tag added to each matching email.
          examples:
            - password-reset
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
      required:
        - name
        - filter
        - tag
        - is_enabled
      description: Body of POST and PATCH /api/v1/tag-rules.
    TagRuleInputPatch:
      type: object
      properties:
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Tag password resets
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: The webhook rule filter, over email fields; null matches every email.
        tag:
          type: string
          description: The tag added to each matching email.
          examples:
            - password-reset
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
    TemplateCategory:
      type: string
      enum:
        - email-provider
        - sms-provider
        - payment-provider
        - chat
        - automation
        - generic
        - custom
    TemplateCloneRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the copy.
          examples:
            - Slack alerts (team)
      required:
        - name
      description: Body of POST /api/v1/webhooks/templates/{templateId}/clone.
    TemplateCreateRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the new blank custom template.
          examples:
            - Order webhook
      required:
        - name
      description: Body of POST /api/v1/webhooks/templates (a new blank custom template).
    TemplateDraft:
      type: object
      properties:
        method:
          $ref: "#/components/schemas/HttpMethod"
          description: The HTTP method.
          examples:
            - POST
        content_type:
          type: string
          description: The body's content type.
          examples:
            - application/json
        header_templates:
          type: object
          additionalProperties:
            type: string
          description: 'Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}".'
          examples:
            - Authorization: Bearer {{ vars.app_token }}
        body_template:
          type: string
          description: The body, a template over the event, its data and the variables.
          examples:
            - '{"subject": "{{ data.subject }}"}'
      required:
        - method
        - content_type
        - header_templates
        - body_template
      description: The editable part of a template; body of PATCH /api/v1/webhooks/templates/{templateId}.
    TemplateImportRequest:
      type: object
      properties:
        file_text:
          type: string
          description: The template file's text, TOML or JSON as exported.
          examples:
            - |-
              id = "custom.order_webhook"
              name = "Order webhook"
        on_conflict:
          type: string
          enum:
            - replace
            - copy
          description: What to do when the id is taken; left out, the API answers 409.
          examples:
            - copy
      required:
        - file_text
      description: Body of POST /api/v1/webhooks/templates/import.
    TemplateMode:
      type: string
      enum:
        - linked
        - detached
    TemplateReference:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: "#/components/schemas/TemplateReferenceField"
        functions:
          type: array
          items:
            $ref: "#/components/schemas/TemplateReferenceHelper"
        filters:
          type: array
          items:
            $ref: "#/components/schemas/TemplateReferenceHelper"
      required:
        - fields
        - functions
        - filters
      description: GET /api/v1/webhooks/template-reference?events=...
    TemplateReferenceField:
      type: object
      properties:
        path:
          type: string
        name:
          type: string
          description: The last part of the path, shown in the tree.
        value_type:
          $ref: "#/components/schemas/TemplateValueType"
        description:
          type: string
        example:
          type:
            - string
            - "null"
          description: From the preview sample; secrets come masked.
        children:
          type: array
          items:
            $ref: "#/components/schemas/TemplateReferenceField"
      required:
        - path
        - name
        - value_type
        - description
        - example
        - children
      description: One value a template can read, e.g. `data.to[0].address`.
    TemplateReferenceHelper:
      type: object
      properties:
        name:
          type: string
        signature:
          type: string
        description:
          type: string
        example:
          type: string
      required:
        - name
        - signature
        - description
        - example
      description: A function or filter, with how to call it.
    TemplateRenderRequest:
      type: object
      properties:
        email_id:
          $ref: "#/components/schemas/Ulid"
          description: Render against this email; with no IDs the sample event is used.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        sms_id:
          $ref: "#/components/schemas/Ulid"
          description: Render against this SMS.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        http_request_id:
          $ref: "#/components/schemas/Ulid"
          description: A captured HTTP request, as the data of an `http.captured` event.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        payment_id:
          $ref: "#/components/schemas/Ulid"
          description: A payment, as the data of the event its latest state stands for.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        draft:
          $ref: "#/components/schemas/TemplateDraft"
          description: Unsaved edits to preview instead of the stored template.
      description: Body of POST /api/v1/webhooks/templates/{templateId}/render; empty for the sample.
    TemplateRenderResult:
      type: object
      properties:
        rendered_against:
          type: string
          description: What it was rendered against, e.g. "Built-in sample" or an email subject.
        headers:
          type: object
          additionalProperties:
            type: string
        body:
          type: string
        warnings:
          type: array
          items:
            type: string
          description: Undefined variables; they render empty.
        errors:
          type: array
          items:
            type: string
          description: "Problems that stop the template from being saved: unknown functions or filters, unbalanced braces."
        problems:
          type: array
          items:
            $ref: "#/components/schemas/RenderProblem"
          description: The same problems with where they are, for markers in the code editor.
      required:
        - rendered_against
        - headers
        - body
        - warnings
        - errors
        - problems
    TemplateRevision:
      type: object
      properties:
        revision:
          type: number
        saved_at:
          $ref: "#/components/schemas/IsoTimestamp"
        template:
          type: object
          properties:
            name:
              type: string
              description: The template's name.
              examples:
                - Order webhook
            description:
              type: string
              description: What the template sends and where.
              examples:
                - Posts each received email to the orders app.
            events:
              type: array
              items:
                $ref: "#/components/schemas/AppEventType"
              description: The event types the template is made for.
              examples:
                - - email.received
            required_variables:
              type: array
              items:
                type: string
              description: Variables an endpoint must define to use it.
              examples:
                - - app_token
            method:
              $ref: "#/components/schemas/HttpMethod"
              description: The HTTP method.
              examples:
                - POST
            content_type:
              type: string
              description: The body's content type.
              examples:
                - application/json
            header_templates:
              type: object
              additionalProperties:
                type: string
              description: 'Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}".'
              examples:
                - Authorization: Bearer {{ vars.app_token }}
            body_template:
              type: string
              description: The body, a template over the event, its data and the variables.
              examples:
                - '{"subject": "{{ data.subject }}"}'
          required:
            - body_template
            - content_type
            - description
            - events
            - header_templates
            - method
            - name
            - required_variables
      required:
        - revision
        - saved_at
        - template
      description: One saved version of a template.
    TemplateUpdate:
      type: object
      properties:
        name:
          type: string
          description: The template's name.
          examples:
            - Order webhook
        description:
          type: string
          description: What the template sends and where.
          examples:
            - Posts each received email to the orders app.
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types the template is made for.
          examples:
            - - email.received
        required_variables:
          type: array
          items:
            type: string
          description: Variables an endpoint must define to use it.
          examples:
            - - app_token
        method:
          $ref: "#/components/schemas/HttpMethod"
          description: The HTTP method.
          examples:
            - POST
        content_type:
          type: string
          description: The body's content type.
          examples:
            - application/json
        header_templates:
          type: object
          additionalProperties:
            type: string
          description: 'Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}".'
          examples:
            - Authorization: Bearer {{ vars.app_token }}
        body_template:
          type: string
          description: The body, a template over the event, its data and the variables.
          examples:
            - '{"subject": "{{ data.subject }}"}'
      required:
        - body_template
        - content_type
        - header_templates
        - method
      description: Body of PATCH /api/v1/webhooks/templates/{templateId}; metadata is ignored for built-ins.
    TemplateValueType:
      type: string
      enum:
        - string
        - number
        - boolean
        - timestamp
        - object
        - list
    TestCardValue:
      type: object
      properties:
        number:
          type: string
          description: The card number to type on the checkout page.
          examples:
            - "4242424242424242"
        outcome:
          $ref: "#/components/schemas/CardTestOutcome"
          description: "`succeed`, `decline`, `three_ds` (asks for 3-D Secure first) or `succeed_then_dispute`."
          examples:
            - succeed
        decline_reason:
          anyOf:
            - $ref: "#/components/schemas/DeclineReason"
            - type: "null"
          description: Set when the outcome is a decline.
          examples:
            - insufficient_funds
      required:
        - number
        - outcome
        - decline_reason
    TestNumberValue:
      type: object
      properties:
        number:
          type: string
          description: The account number or voucher code to type.
          examples:
            - "01770000001"
        outcome:
          $ref: "#/components/schemas/NumberTestOutcome"
          description: "`succeed`, `decline` or `wrong_pin` (needs a PIN step)."
          examples:
            - succeed
        decline_reason:
          anyOf:
            - $ref: "#/components/schemas/DeclineReason"
            - type: "null"
          description: Set when the outcome is a decline.
          examples:
            - insufficient_funds
      required:
        - number
        - outcome
        - decline_reason
      description: A test account number or voucher code with its outcome.
    TwimlMethod:
      type: string
      enum:
        - GET
        - POST
      description: How a TwiML `action` or `<Redirect>` URL is requested; `POST` by default.
    TwimlVerb:
      anyOf:
        - type: object
          properties:
            verb:
              type: string
              const: Message
            body:
              type: string
            to:
              type:
                - string
                - "null"
            from:
              type:
                - string
                - "null"
            status_callback:
              type:
                - string
                - "null"
            action:
              type:
                - string
                - "null"
              description: Requested once the reply is sent, with `method`.
            method:
              $ref: "#/components/schemas/TwimlMethod"
            media_urls:
              type: array
              items:
                type: string
          required:
            - verb
            - body
            - to
            - from
            - status_callback
            - action
            - method
            - media_urls
        - type: object
          properties:
            verb:
              type: string
              const: Redirect
            url:
              type: string
            method:
              $ref: "#/components/schemas/TwimlMethod"
          required:
            - verb
            - url
            - method
      description: A verb of the TwiML an app answered with.
    Ulid:
      type: string
      description: Sortable unique ID (ULID), e.g. "01JB6Z3K8Q2W5X7Y9A1B3C5D7E".
    UpdateCheckMode:
      type: string
      enum:
        - off
        - manual
        - daily
      description: When the update check runs; `off` is the default.
    UpdateCheckResult:
      type: object
      properties:
        current_version:
          type: string
        channel:
          $ref: "#/components/schemas/ReleaseChannel"
        install_method:
          $ref: "#/components/schemas/InstallMethod"
        is_channel_checked:
          type: boolean
          description: False for edge and dev builds, which are offered no updates.
        is_update_available:
          type: boolean
        available_release:
          anyOf:
            - $ref: "#/components/schemas/AvailableRelease"
            - type: "null"
          description: Null when up to date or when the channel is not checked.
        checked_at:
          $ref: "#/components/schemas/IsoTimestamp"
        is_from_cache:
          type: boolean
          description: True when the answer is the last check's, kept for 24 hours.
      required:
        - current_version
        - channel
        - install_method
        - is_channel_checked
        - is_update_available
        - available_release
        - checked_at
        - is_from_cache
      description: "GET /api/v1/updates: the result of the opt-in update check."
    VariableKind:
      type: string
      enum:
        - text
        - number
        - boolean
        - json
        - secret
        - dynamic
        - random
        - computed
        - prompt
    VariablePreviewRequest:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/VariableKind"
          description: The variable kind, as in a variable.
          examples:
            - random
        value:
          type: string
          description: The value, expression or generator to try.
          examples:
            - random_string(16)
      required:
        - kind
        - value
      description: Body of POST /api/v1/webhooks/variables/preview.
    VariablePreviewResult:
      type: object
      properties:
        resolved_value:
          type: string
        warnings:
          type: array
          items:
            type: string
        errors:
          type: array
          items:
            type: string
      required:
        - resolved_value
        - warnings
        - errors
    Verification:
      type: object
      properties:
        sid:
          type: string
        service_sid:
          type: string
        service_name:
          type: string
        to:
          type: string
        channel:
          $ref: "#/components/schemas/VerifyChannel"
        code:
          type: string
        status:
          $ref: "#/components/schemas/VerificationStatus"
        check_attempts:
          type: number
        send_attempts:
          type: number
        expires_at:
          $ref: "#/components/schemas/IsoTimestamp"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        linked_message_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The captured SMS or email that carried the code; null for `call`.
        linked_thread_id:
          type:
            - string
            - "null"
          description: Conversation of the linked SMS, for the "Open message" link.
        project:
          type: string
          description: "The project the verification was started in: `default` unless the sender named another."
          examples:
            - default
      required:
        - sid
        - service_sid
        - service_name
        - to
        - channel
        - code
        - status
        - check_attempts
        - send_attempts
        - expires_at
        - created_at
        - linked_message_id
        - linked_thread_id
        - project
    VerificationDetail:
      type: object
      properties:
        timeline:
          type: array
          items:
            $ref: "#/components/schemas/VerificationTimelineEntry"
        sid:
          type: string
        service_sid:
          type: string
        service_name:
          type: string
        to:
          type: string
        channel:
          $ref: "#/components/schemas/VerifyChannel"
        code:
          type: string
        status:
          $ref: "#/components/schemas/VerificationStatus"
        check_attempts:
          type: number
        send_attempts:
          type: number
        expires_at:
          $ref: "#/components/schemas/IsoTimestamp"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        linked_message_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The captured SMS or email that carried the code; null for `call`.
        linked_thread_id:
          type:
            - string
            - "null"
          description: Conversation of the linked SMS, for the "Open message" link.
        project:
          type: string
          description: "The project the verification was started in: `default` unless the sender named another."
          examples:
            - default
      required:
        - channel
        - check_attempts
        - code
        - created_at
        - expires_at
        - linked_message_id
        - linked_thread_id
        - project
        - send_attempts
        - service_name
        - service_sid
        - sid
        - status
        - timeline
        - to
    VerificationForceRequest:
      type: object
      properties:
        state:
          $ref: "#/components/schemas/ForcedVerificationState"
          description: "The state to force: `approved`, `canceled`, `expired` or `max_attempts` (too many wrong checks)."
          examples:
            - expired
      required:
        - state
      description: Body of `POST /verify/{verificationSid}/force`.
    VerificationStatus:
      type: string
      enum:
        - pending
        - approved
        - canceled
        - expired
        - max_attempts_reached
    VerificationTimelineEntry:
      type: object
      properties:
        kind:
          $ref: "#/components/schemas/VerificationTimelineKind"
        at:
          $ref: "#/components/schemas/IsoTimestamp"
        detail:
          type: string
      required:
        - kind
        - at
        - detail
    VerificationTimelineKind:
      type: string
      enum:
        - started
        - code_sent
        - check_failed
        - approved
        - canceled
        - expired
        - max_attempts_reached
    VerifyChannel:
      type: string
      enum:
        - sms
        - whatsapp
        - email
        - call
    VerifyService:
      type: object
      properties:
        sid:
          type: string
          description: The service SID, `VA...`.
          examples:
            - VA00000000000000000000000000000001
        friendly_name:
          type: string
          description: The name shown in the code message, e.g. "Your Shop verification code is ...".
          examples:
            - Shop
        code_length:
          type: number
          description: Digits in each code, 4 to 10.
          examples:
            - 6
        fixed_code:
          type:
            - string
            - "null"
          description: Always send this code instead of a random one, for deterministic tests; null for random.
          examples:
            - "123456"
        ttl_seconds:
          type: number
          description: How long a code stays valid, in seconds.
          examples:
            - 600
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - sid
        - friendly_name
        - code_length
        - fixed_code
        - ttl_seconds
        - created_by
    VerifyServiceInput:
      type: object
      properties:
        friendly_name:
          type: string
          description: The name shown in the code message, e.g. "Your Shop verification code is ...".
          examples:
            - Shop
        code_length:
          type: number
          description: Digits in each code, 4 to 10.
          examples:
            - 6
        fixed_code:
          type:
            - string
            - "null"
          description: Always send this code instead of a random one, for deterministic tests; null for random.
          examples:
            - "123456"
        ttl_seconds:
          type: number
          description: How long a code stays valid, in seconds.
          examples:
            - 600
      required:
        - friendly_name
        - code_length
        - fixed_code
        - ttl_seconds
      description: Body of POST and PATCH /api/v1/verify/services.
    VirtualNumber:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        number:
          type: string
          description: E.164, without a channel prefix; `channels` says whether WhatsApp works.
          examples:
            - "+15550001111"
        label:
          type: string
          description: A name for the number, e.g. the app or feature that uses it.
          examples:
            - Support line
        channels:
          type: array
          items:
            $ref: "#/components/schemas/NumberChannel"
          description: "Where the number works: `sms`, `whatsapp` or both."
          examples:
            - - sms
        inbound_url:
          type:
            - string
            - "null"
          description: Reply webhook (Twilio "A message comes in"); null means rules only.
          examples:
            - http://localhost:3000/sms/inbound
        inbound_method:
          $ref: "#/components/schemas/InboundWebhookMethod"
          description: The HTTP method of the reply webhook.
          examples:
            - POST
        inbound_fallback_url:
          type:
            - string
            - "null"
          description: Called when the reply webhook fails, with `ErrorCode` and `ErrorUrl` added, as Twilio does.
          examples:
            - http://localhost:3000/sms/inbound-fallback
        inbound_template_id:
          type:
            - string
            - "null"
          description: Payload template for the inbound webhook, e.g. `twilio.inbound_sms`.
          examples:
            - twilio.inbound_sms
        status_callback_url:
          type:
            - string
            - "null"
          description: Your app's URL for status changes of messages sent from this number.
          examples:
            - http://localhost:3000/sms/status
        messaging_service_sid:
          type:
            - string
            - "null"
          description: The Messaging Service this number belongs to, `MG...`; null for none.
          examples:
            - MG00000000000000000000000000000001
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - id
        - number
        - label
        - channels
        - inbound_url
        - inbound_method
        - inbound_fallback_url
        - inbound_template_id
        - status_callback_url
        - messaging_service_sid
        - created_by
    VirtualNumberInput:
      type: object
      properties:
        number:
          type: string
          description: E.164, without a channel prefix; `channels` says whether WhatsApp works.
          examples:
            - "+15550001111"
        label:
          type: string
          description: A name for the number, e.g. the app or feature that uses it.
          examples:
            - Support line
        channels:
          type: array
          items:
            $ref: "#/components/schemas/NumberChannel"
          description: "Where the number works: `sms`, `whatsapp` or both."
          examples:
            - - sms
        inbound_url:
          type:
            - string
            - "null"
          description: Reply webhook (Twilio "A message comes in"); null means rules only.
          examples:
            - http://localhost:3000/sms/inbound
        inbound_method:
          $ref: "#/components/schemas/InboundWebhookMethod"
          description: The HTTP method of the reply webhook.
          examples:
            - POST
        inbound_fallback_url:
          type:
            - string
            - "null"
          description: Called when the reply webhook fails, with `ErrorCode` and `ErrorUrl` added, as Twilio does.
          examples:
            - http://localhost:3000/sms/inbound-fallback
        inbound_template_id:
          type:
            - string
            - "null"
          description: Payload template for the inbound webhook, e.g. `twilio.inbound_sms`.
          examples:
            - twilio.inbound_sms
        status_callback_url:
          type:
            - string
            - "null"
          description: Your app's URL for status changes of messages sent from this number.
          examples:
            - http://localhost:3000/sms/status
        messaging_service_sid:
          type:
            - string
            - "null"
          description: The Messaging Service this number belongs to, `MG...`; null for none.
          examples:
            - MG00000000000000000000000000000001
      required:
        - number
        - label
        - channels
        - inbound_url
        - inbound_method
        - inbound_fallback_url
        - inbound_template_id
        - status_callback_url
        - messaging_service_sid
      description: Body of POST and PATCH /api/v1/numbers.
    WebhookDelivery:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
        endpoint_name:
          type: string
        rule_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        event_id:
          type: string
        event_type:
          $ref: "#/components/schemas/AppEventType"
        subject_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        trigger:
          $ref: "#/components/schemas/DeliveryTrigger"
        attempt:
          type: number
        status:
          $ref: "#/components/schemas/DeliveryStatus"
        url:
          type:
            - string
            - "null"
          description: Where the request goes, known from when it is queued; null only when the request could not be rendered.
          examples:
            - http://localhost:8000/webhooks/mail
        request:
          anyOf:
            - $ref: "#/components/schemas/RecordedHttpRequest"
            - type: "null"
          description: The request as sent, signature headers included; null until the attempt runs.
        response:
          anyOf:
            - $ref: "#/components/schemas/RecordedHttpResponse"
            - type: "null"
        duration_ms:
          type:
            - number
            - "null"
        error_message:
          type:
            - string
            - "null"
        next_attempt_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        is_edited:
          type: boolean
          description: Whether the action that sent it edited the body or headers instead of sending the rendered request.
      required:
        - id
        - endpoint_id
        - endpoint_name
        - rule_id
        - event_id
        - event_type
        - subject_id
        - trigger
        - attempt
        - status
        - url
        - request
        - response
        - duration_ms
        - error_message
        - next_attempt_at
        - created_at
        - is_edited
    WebhookDeliveryDetail:
      type: object
      properties:
        max_attempts:
          type: number
        attempts:
          type: array
          items:
            $ref: "#/components/schemas/DeliveryAttemptSummary"
          description: Every attempt of this event to this endpoint, oldest first.
        subject:
          anyOf:
            - $ref: "#/components/schemas/DeliverySubject"
            - type: "null"
        id:
          $ref: "#/components/schemas/Ulid"
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
        endpoint_name:
          type: string
        rule_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        event_id:
          type: string
        event_type:
          $ref: "#/components/schemas/AppEventType"
        subject_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        trigger:
          $ref: "#/components/schemas/DeliveryTrigger"
        attempt:
          type: number
        status:
          $ref: "#/components/schemas/DeliveryStatus"
        url:
          type:
            - string
            - "null"
          description: Where the request goes, known from when it is queued; null only when the request could not be rendered.
          examples:
            - http://localhost:8000/webhooks/mail
        request:
          anyOf:
            - $ref: "#/components/schemas/RecordedHttpRequest"
            - type: "null"
          description: The request as sent, signature headers included; null until the attempt runs.
        response:
          anyOf:
            - $ref: "#/components/schemas/RecordedHttpResponse"
            - type: "null"
        duration_ms:
          type:
            - number
            - "null"
        error_message:
          type:
            - string
            - "null"
        next_attempt_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
        is_edited:
          type: boolean
          description: Whether the action that sent it edited the body or headers instead of sending the rendered request.
      required:
        - attempt
        - attempts
        - created_at
        - duration_ms
        - endpoint_id
        - endpoint_name
        - error_message
        - event_id
        - event_type
        - id
        - is_edited
        - max_attempts
        - next_attempt_at
        - request
        - response
        - rule_id
        - status
        - subject
        - subject_id
        - trigger
        - url
      description: GET /api/v1/webhooks/deliveries/{deliveryId}.
    WebhookEndpoint:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
          description: A name for the endpoint, shown in lists and deliveries.
          examples:
            - Orders app
        url:
          type: string
          description: Where deliveries are sent; can use templates.
          examples:
            - http://localhost:3000/webhooks/sendmock
        method:
          $ref: "#/components/schemas/HttpMethod"
          description: The HTTP method of each delivery.
          examples:
            - POST
        headers:
          type: object
          additionalProperties:
            type: string
          description: Extra headers layered on top of the template's.
          examples:
            - Authorization: Bearer {{ vars.app_token }}
        extra_fields:
          type: object
          additionalProperties:
            type: string
          description: Extra body fields layered on top of the template's.
          examples:
            - environment: local
        template_id:
          type: string
          description: The payload template, e.g. `native` (Standard Webhooks JSON) or `slack.incoming_webhook`.
          examples:
            - native
        template_mode:
          $ref: "#/components/schemas/TemplateMode"
          description: "`linked` follows template updates, `detached` keeps its own copy."
          examples:
            - linked
        masked_secret:
          type: string
          description: Always masked by the API, e.g. "whsec_••••3f9a".
        previous_secret_expires_at:
          anyOf:
            - $ref: "#/components/schemas/IsoTimestamp"
            - type: "null"
          description: Until when the secret before the last rotation still signs; null when none.
        timeout_ms:
          type: number
          description: How long to wait for your app's answer, in milliseconds.
          examples:
            - 10000
        retry_policy:
          $ref: "#/components/schemas/RetryPolicy"
          description: When and how often failed deliveries are retried.
        is_enabled:
          type: boolean
          description: Off endpoints receive no deliveries.
          examples:
            - true
        query_params:
          type: array
          items:
            $ref: "#/components/schemas/NameValueTemplate"
          description: Query parameters added to the URL.
        body_mode:
          $ref: "#/components/schemas/EndpointBodyMode"
          description: "How the body is built: `template` (the payload template), `fields` (name and value rows), `raw` (one text template) or `none`."
          examples:
            - template
        body_fields:
          type: array
          items:
            $ref: "#/components/schemas/EndpointBodyField"
          description: The rows of `fields` mode.
        fields_encoding:
          type: string
          enum:
            - json
            - form
            - multipart
          description: "How `fields` mode is sent: `json`, `form` (`x-www-form-urlencoded`) or `multipart` (`multipart/form-data`, where `file` fields are fetched from their URL when sent)."
          examples:
            - json
        raw_content_type:
          type: string
          description: The content type of `raw` mode.
          examples:
            - application/json
        raw_body:
          type: string
          description: The body template of `raw` mode.
          examples:
            - '{"text": "New email: {{ data.subject }}"}'
        render_mode:
          $ref: "#/components/schemas/RenderMode"
          description: "`strict` stops a delivery on an undefined variable, `lenient` renders it empty with a warning."
          examples:
            - strict
        success_rate:
          type:
            - number
            - "null"
          description: Success rate over the last 24 hours; null without finished deliveries.
        delivery_count_24h:
          type: number
        success_history:
          type: array
          items:
            type:
              - number
              - "null"
          description: 24 hourly success rates, oldest first; null for hours without deliveries.
        created_by:
          $ref: "#/components/schemas/CreatedBy"
        created_at:
          $ref: "#/components/schemas/IsoTimestamp"
      required:
        - id
        - name
        - url
        - method
        - headers
        - extra_fields
        - template_id
        - template_mode
        - masked_secret
        - previous_secret_expires_at
        - timeout_ms
        - retry_policy
        - is_enabled
        - query_params
        - body_mode
        - body_fields
        - fields_encoding
        - raw_content_type
        - raw_body
        - render_mode
        - success_rate
        - delivery_count_24h
        - success_history
        - created_by
        - created_at
    WebhookEndpointInput:
      type: object
      properties:
        name:
          type: string
          description: A name for the endpoint, shown in lists and deliveries.
          examples:
            - Orders app
        url:
          type: string
          description: Where deliveries are sent; can use templates.
          examples:
            - http://localhost:3000/webhooks/sendmock
        method:
          $ref: "#/components/schemas/HttpMethod"
          description: The HTTP method of each delivery.
          examples:
            - POST
        headers:
          type: object
          additionalProperties:
            type: string
          description: Extra headers layered on top of the template's.
          examples:
            - Authorization: Bearer {{ vars.app_token }}
        extra_fields:
          type: object
          additionalProperties:
            type: string
          description: Extra body fields layered on top of the template's.
          examples:
            - environment: local
        template_id:
          type: string
          description: The payload template, e.g. `native` (Standard Webhooks JSON) or `slack.incoming_webhook`.
          examples:
            - native
        template_mode:
          $ref: "#/components/schemas/TemplateMode"
          description: "`linked` follows template updates, `detached` keeps its own copy."
          examples:
            - linked
        timeout_ms:
          type: number
          description: How long to wait for your app's answer, in milliseconds.
          examples:
            - 10000
        retry_policy:
          $ref: "#/components/schemas/RetryPolicy"
          description: When and how often failed deliveries are retried.
        is_enabled:
          type: boolean
          description: Off endpoints receive no deliveries.
          examples:
            - true
        query_params:
          type: array
          items:
            $ref: "#/components/schemas/NameValueTemplate"
          description: Query parameters added to the URL.
        body_mode:
          $ref: "#/components/schemas/EndpointBodyMode"
          description: "How the body is built: `template` (the payload template), `fields` (name and value rows), `raw` (one text template) or `none`."
          examples:
            - template
        body_fields:
          type: array
          items:
            $ref: "#/components/schemas/EndpointBodyField"
          description: The rows of `fields` mode.
        fields_encoding:
          type: string
          enum:
            - json
            - form
            - multipart
          description: "How `fields` mode is sent: `json`, `form` (`x-www-form-urlencoded`) or `multipart` (`multipart/form-data`, where `file` fields are fetched from their URL when sent)."
          examples:
            - json
        raw_content_type:
          type: string
          description: The content type of `raw` mode.
          examples:
            - application/json
        raw_body:
          type: string
          description: The body template of `raw` mode.
          examples:
            - '{"text": "New email: {{ data.subject }}"}'
        render_mode:
          $ref: "#/components/schemas/RenderMode"
          description: "`strict` stops a delivery on an undefined variable, `lenient` renders it empty with a warning."
          examples:
            - strict
      required:
        - name
        - url
        - method
        - headers
        - extra_fields
        - template_id
        - template_mode
        - timeout_ms
        - retry_policy
        - is_enabled
        - query_params
        - body_mode
        - body_fields
        - fields_encoding
        - raw_content_type
        - raw_body
        - render_mode
      description: Body of POST and PATCH /api/v1/webhooks/endpoints.
    WebhookEndpointInputPatch:
      type: object
      properties:
        name:
          type: string
          description: A name for the endpoint, shown in lists and deliveries.
          examples:
            - Orders app
        url:
          type: string
          description: Where deliveries are sent; can use templates.
          examples:
            - http://localhost:3000/webhooks/sendmock
        method:
          $ref: "#/components/schemas/HttpMethod"
          description: The HTTP method of each delivery.
          examples:
            - POST
        headers:
          type: object
          additionalProperties:
            type: string
          description: Extra headers layered on top of the template's.
          examples:
            - Authorization: Bearer {{ vars.app_token }}
        extra_fields:
          type: object
          additionalProperties:
            type: string
          description: Extra body fields layered on top of the template's.
          examples:
            - environment: local
        template_id:
          type: string
          description: The payload template, e.g. `native` (Standard Webhooks JSON) or `slack.incoming_webhook`.
          examples:
            - native
        template_mode:
          $ref: "#/components/schemas/TemplateMode"
          description: "`linked` follows template updates, `detached` keeps its own copy."
          examples:
            - linked
        timeout_ms:
          type: number
          description: How long to wait for your app's answer, in milliseconds.
          examples:
            - 10000
        retry_policy:
          $ref: "#/components/schemas/RetryPolicy"
          description: When and how often failed deliveries are retried.
        is_enabled:
          type: boolean
          description: Off endpoints receive no deliveries.
          examples:
            - true
        query_params:
          type: array
          items:
            $ref: "#/components/schemas/NameValueTemplate"
          description: Query parameters added to the URL.
        body_mode:
          $ref: "#/components/schemas/EndpointBodyMode"
          description: "How the body is built: `template` (the payload template), `fields` (name and value rows), `raw` (one text template) or `none`."
          examples:
            - template
        body_fields:
          type: array
          items:
            $ref: "#/components/schemas/EndpointBodyField"
          description: The rows of `fields` mode.
        fields_encoding:
          type: string
          enum:
            - json
            - form
            - multipart
          description: "How `fields` mode is sent: `json`, `form` (`x-www-form-urlencoded`) or `multipart` (`multipart/form-data`, where `file` fields are fetched from their URL when sent)."
          examples:
            - json
        raw_content_type:
          type: string
          description: The content type of `raw` mode.
          examples:
            - application/json
        raw_body:
          type: string
          description: The body template of `raw` mode.
          examples:
            - '{"text": "New email: {{ data.subject }}"}'
        render_mode:
          $ref: "#/components/schemas/RenderMode"
          description: "`strict` stops a delivery on an undefined variable, `lenient` renders it empty with a warning."
          examples:
            - strict
    WebhookMetrics:
      type: object
      properties:
        range:
          $ref: "#/components/schemas/WebhookMetricsRange"
        endpoint_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
        delivery_count:
          type: number
        success_rate:
          type:
            - number
            - "null"
        p50_latency_ms:
          type:
            - number
            - "null"
        p95_latency_ms:
          type:
            - number
            - "null"
        retry_count:
          type: number
        render_failed_count:
          type: number
        buckets:
          type: array
          items:
            $ref: "#/components/schemas/DeliveryOutcomeBucket"
          description: Oldest first, ending with the current hour or day.
        endpoint_metrics:
          type: array
          items:
            $ref: "#/components/schemas/EndpointMetrics"
        top_failure_codes:
          type: array
          items:
            $ref: "#/components/schemas/FailureCodeCount"
        recent_failures:
          type: array
          items:
            $ref: "#/components/schemas/RecentFailedDelivery"
      required:
        - range
        - endpoint_id
        - delivery_count
        - success_rate
        - p50_latency_ms
        - p95_latency_ms
        - retry_count
        - render_failed_count
        - buckets
        - endpoint_metrics
        - top_failure_codes
        - recent_failures
      description: "GET /api/v1/webhooks/metrics: delivery health for a range."
    WebhookMetricsRange:
      type: string
      enum:
        - 24h
        - 7d
    WebhookRequestEdit:
      type: object
      properties:
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
          description: The endpoint the edited request goes to; when `webhook_endpoint_ids` is given, it must be one of them.
          examples:
            - 01JB7T9Q2RENDPOINT00000000
        event_type:
          type: string
          description: The event the edit is for, as `POST /api/v1/webhooks/rules/match` named it; left out, every event this action sends to the endpoint.
          examples:
            - email.bounced
        body:
          type: string
          description: The body, sent exactly as written and signed over these bytes with the endpoint's secret.
          examples:
            - '{"type":"email.bounced","data":{"reason":"edited"}}'
        headers:
          type: object
          additionalProperties:
            type: string
          description: Headers to set or change, by name; the others are sent as rendered. Signature headers are made by the sender.
          examples:
            - x-tenant: acme
      required:
        - endpoint_id
        - body
      description: A request edited before an action sends it.
    WebhookRule:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Bounces to Slack
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
          description: The endpoint each matching event is delivered to.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types the rule listens to.
          examples:
            - - email.bounced
              - email.complained
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: Which messages match, combining conditions with `all`, `any` and `not`; null matches every event.
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
        order:
          type: number
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - id
        - name
        - endpoint_id
        - events
        - filter
        - is_enabled
        - order
        - created_by
    WebhookRuleInput:
      type: object
      properties:
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Bounces to Slack
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
          description: The endpoint each matching event is delivered to.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types the rule listens to.
          examples:
            - - email.bounced
              - email.complained
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: Which messages match, combining conditions with `all`, `any` and `not`; null matches every event.
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
      required:
        - name
        - endpoint_id
        - events
        - filter
        - is_enabled
      description: Body of POST and PATCH /api/v1/webhooks/rules.
    WebhookRuleInputPatch:
      type: object
      properties:
        name:
          type: string
          description: A name for the rule, shown in the list.
          examples:
            - Bounces to Slack
        endpoint_id:
          $ref: "#/components/schemas/Ulid"
          description: The endpoint each matching event is delivered to.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types the rule listens to.
          examples:
            - - email.bounced
              - email.complained
        filter:
          anyOf:
            - $ref: "#/components/schemas/RuleFilter"
            - type: "null"
          description: Which messages match, combining conditions with `all`, `any` and `not`; null matches every event.
        is_enabled:
          type: boolean
          description: Off rules are kept but skipped.
          examples:
            - true
    WebhookRuleMatchRequest:
      type: object
      properties:
        event_type:
          $ref: "#/components/schemas/AppEventType"
          description: The event the action fires.
          examples:
            - email.bounced
        subject_id:
          $ref: "#/components/schemas/Ulid"
          description: The email, SMS, payment or push notification the event is about; its stored fields are what the rule filters read.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        data:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Filter fields by name, for a message not stored yet or the values the event changes; they win over the stored message's.
          examples:
            - to:
                - support@app.test
              header:x-tenant:
                - acme
        include_requests:
          type: boolean
          description: Also render the request each matching endpoint would send for the event, with secrets masked.
          examples:
            - true
        webhook_endpoint_ids:
          type: array
          items:
            $ref: "#/components/schemas/Ulid"
          description: With `include_requests`, render these endpoints' requests too, as chosen for the action instead of the rules (IDs from `GET /api/v1/webhooks/endpoints`).
          examples:
            - - 01JB7T9Q2RENDPOINT00000000
      required:
        - event_type
      description: "Body of POST /api/v1/webhooks/rules/match: the event an action is about to fire."
    WebhookRuleMatchResult:
      type: object
      properties:
        webhook_rules:
          type: array
          items:
            $ref: "#/components/schemas/MatchedWebhookRule"
          description: The rules that would send, in rule order.
        webhook_requests:
          type: array
          items:
            $ref: "#/components/schemas/MatchedWebhookRequest"
          description: "With `include_requests`: the request each matching or chosen endpoint would send."
      required:
        - webhook_rules
      description: The webhooks an event would trigger; nothing is stored or sent.
    WebhookRuleMove:
      type: object
      properties:
        direction:
          type: string
          enum:
            - up
            - down
          description: "`up` moves the rule one place earlier in the order, `down` one place later."
          examples:
            - up
      required:
        - direction
      description: Body of POST /api/v1/webhooks/rules/{ruleId}/move.
    WebhookTemplateDetail:
      type: object
      properties:
        doc_url:
          type:
            - string
            - "null"
        verified_on:
          type:
            - string
            - "null"
          description: '"2026-09-30": when a provider template was last checked against the docs.'
        used_by_endpoint_count:
          type: number
        method:
          $ref: "#/components/schemas/HttpMethod"
          description: The HTTP method.
          examples:
            - POST
        content_type:
          type: string
          description: The body's content type.
          examples:
            - application/json
        header_templates:
          type: object
          additionalProperties:
            type: string
          description: 'Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}".'
          examples:
            - Authorization: Bearer {{ vars.app_token }}
        body_template:
          type: string
          description: The body, a template over the event, its data and the variables.
          examples:
            - '{"subject": "{{ data.subject }}"}'
        id:
          type: string
        name:
          type: string
          description: The template's name.
          examples:
            - Order webhook
        service:
          type: string
        category:
          $ref: "#/components/schemas/TemplateCategory"
        source:
          type: string
          enum:
            - builtin
            - custom
            - file
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types the template is made for.
          examples:
            - - email.received
        description:
          type: string
          description: What the template sends and where.
          examples:
            - Posts each received email to the orders app.
        required_variables:
          type: array
          items:
            type: string
          description: Variables an endpoint must define to use it.
          examples:
            - - app_token
        revision:
          type: number
        is_modified:
          type: boolean
          description: A built-in template the user edited; Reset to default restores it.
      required:
        - body_template
        - category
        - content_type
        - description
        - doc_url
        - events
        - header_templates
        - id
        - is_modified
        - method
        - name
        - required_variables
        - revision
        - service
        - source
        - used_by_endpoint_count
        - verified_on
      description: GET /api/v1/webhooks/templates/{templateId}.
    WebhookTemplateSummary:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: The template's name.
          examples:
            - Order webhook
        service:
          type: string
        category:
          $ref: "#/components/schemas/TemplateCategory"
        source:
          type: string
          enum:
            - builtin
            - custom
            - file
        events:
          type: array
          items:
            $ref: "#/components/schemas/AppEventType"
          description: The event types the template is made for.
          examples:
            - - email.received
        description:
          type: string
          description: What the template sends and where.
          examples:
            - Posts each received email to the orders app.
        required_variables:
          type: array
          items:
            type: string
          description: Variables an endpoint must define to use it.
          examples:
            - - app_token
        revision:
          type: number
        is_modified:
          type: boolean
          description: A built-in template the user edited; Reset to default restores it.
      required:
        - id
        - name
        - service
        - category
        - source
        - events
        - description
        - required_variables
        - revision
        - is_modified
    WebhookVariable:
      type: object
      properties:
        id:
          $ref: "#/components/schemas/Ulid"
        name:
          type: string
          description: The name templates read it by, as `{{ vars.<name> }}`.
          examples:
            - tenant_id
        kind:
          $ref: "#/components/schemas/VariableKind"
          description: "`text`, `number`, `boolean`, `json` and `secret` are fixed values; `dynamic` is read from the event, `random` is generated, `computed` combines other variables and `prompt` is asked for on manual sends."
          examples:
            - text
        scope:
          type: string
          enum:
            - global
            - endpoint
          description: "`global` for every endpoint, or `endpoint` for one; endpoint values win."
          examples:
            - global
        endpoint_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The endpoint of an `endpoint` variable; null for global ones.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        value:
          type: string
          description: Static value, expression, generator or default; secrets are masked.
          examples:
            - acme
        random_mode:
          type:
            - string
            - "null"
          enum:
            - per_send
            - fixed
            - null
          description: "For `random`: `per_send` generates a new value each time, `fixed` keeps one value until Regenerate; null for other kinds."
          examples:
            - per_send
        fixed_value:
          type:
            - string
            - "null"
          description: The generated value of a Fixed random variable; Regenerate replaces it.
        description:
          type: string
          description: What the variable is for.
          examples:
            - Tenant every webhook is sent for
        created_by:
          $ref: "#/components/schemas/CreatedBy"
      required:
        - id
        - name
        - kind
        - scope
        - endpoint_id
        - value
        - random_mode
        - fixed_value
        - description
        - created_by
    WebhookVariableInput:
      type: object
      properties:
        name:
          type: string
          description: The name templates read it by, as `{{ vars.<name> }}`.
          examples:
            - tenant_id
        kind:
          $ref: "#/components/schemas/VariableKind"
          description: "`text`, `number`, `boolean`, `json` and `secret` are fixed values; `dynamic` is read from the event, `random` is generated, `computed` combines other variables and `prompt` is asked for on manual sends."
          examples:
            - text
        scope:
          type: string
          enum:
            - global
            - endpoint
          description: "`global` for every endpoint, or `endpoint` for one; endpoint values win."
          examples:
            - global
        endpoint_id:
          anyOf:
            - $ref: "#/components/schemas/Ulid"
            - type: "null"
          description: The endpoint of an `endpoint` variable; null for global ones.
          examples:
            - 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        value:
          type: string
          description: Static value, expression, generator or default; secrets are masked.
          examples:
            - acme
        random_mode:
          type:
            - string
            - "null"
          enum:
            - per_send
            - fixed
            - null
          description: "For `random`: `per_send` generates a new value each time, `fixed` keeps one value until Regenerate; null for other kinds."
          examples:
            - per_send
        description:
          type: string
          description: What the variable is for.
          examples:
            - Tenant every webhook is sent for
      required:
        - name
        - kind
        - scope
        - endpoint_id
        - value
        - random_mode
        - description
      description: Body of POST and PATCH /api/v1/webhooks/variables.
    WhatsappWebhookVerification:
      type: object
      properties:
        url:
          type: string
          description: The URL called, with the check's query.
        challenge:
          type: string
          description: The `hub.challenge` sent, which the app must answer as its whole body.
          examples:
            - "1158201444"
        is_verified:
          type: boolean
          description: True when the app answered `200` with exactly the challenge, as Meta requires.
        status_code:
          type:
            - number
            - "null"
          examples:
            - 200
        answer:
          type:
            - string
            - "null"
          description: The app's answer body.
        error:
          type:
            - string
            - "null"
          description: Why there was no answer, such as a refused connection.
      required:
        - url
        - challenge
        - is_verified
        - status_code
        - answer
        - error
      description: What the app answered Meta's callback URL check.
    WhatsappWebhookVerificationRequest:
      type: object
      properties:
        url:
          type: string
          description: The URL to check; the WhatsApp Cloud provider's `webhook_url` when left out.
          examples:
            - http://127.0.0.1:3000/whatsapp/webhook
      description: Body of POST /api/v1/sms/whatsapp-cloud/verify-webhook.
  responses:
    BadRequest:
      description: The request is invalid.
      content: &a1
        application/json:
          schema:
            $ref: "#/components/schemas/ApiErrorBody"
    NotFound:
      description: The item does not exist.
      content: *a1
    Timeout:
      description: Nothing matched before the timeout.
      content: *a1
    Conflict:
      description: The item's state does not allow it.
      content: *a1
    Unprocessable:
      description: The content does not parse or render.
      content: *a1
    BadGateway:
      description: An outside service, such as GitHub, could not be reached.
      content: *a1
    Error:
      description: Any other error.
      content: *a1
