{
  "openapi": "3.1.0",
  "info": {
    "title": "Motorical Public API: Public API (analytics, logs, config, webhooks, exports, domains, Motor Blocks)",
    "version": "1.12.0",
    "description": "Public API (analytics, logs, config, webhooks, exports, domains, Motor Blocks). Part of the full specification at https://docs.motorical.com/openapi.json (same version, same operationIds). Transactional email HTTP API and analytics for Motorical Sending SMTP — same job class as SendGrid/Postmark-style send APIs. One Motor Block per project: an isolated sending stream with its own domain, auth, keys, SMTP credentials, rates, logs, webhooks, and automation. Developer sandbox: unpaid agent onboarding uses a Motorical-owned `.sandbox` domain (instant, no DNS) or a sandbox Motor Block on your own fully verified domain (on a Free account, created automatically once DKIM and SPF pass when automatic provisioning is enabled; otherwise call the provision route), with outbound locked to an allowlist until convert + Motorical Plan. Onboarding auth: register → verify-code (returns a single-use setupToken) → set-password {email, password, setupToken} → dashboard JWT (~15m) + refreshToken (7d). Agents store refreshToken and POST /api/auth/refresh with JSON body (cookies optional). After domain ownership verify, call POST /api/public/v1/domains/{id}/check-dns (or re-call verify) to flip dkim_configured/spf_configured before /v1/send. Domains are account-wide, not Motor-Block-scoped (a Motor Block is created from a verified domain, not the reverse) — GET/POST /api/public/v1/domains* need no motorBlockId. Public API covers email sending, analytics, logs, configuration, domain management, domain health, webhooks, and exports. SMTP submission is an out-of-band protocol on mail.motorical.com:2587 (STARTTLS) or :2465 (implicit TLS) using password, OAuth 2.0 access token as SMTP password (or XOAUTH2), or mTLS + password — see https://docs.motorical.com/smtp-integration/authentication-methods. Do not use OAuth access tokens or Bearer tokens on POST /v1/send (Motor Block ApiKey mk_live_ only)."
  },
  "servers": [
    {
      "url": "https://api.motorical.com",
      "description": "Motorical production API. The only host that serves the HTTP Send API (/v1/*); also serves the Public API (/api/public/v1/*) and the dashboard/auth API (/api/*). Use this host for every API call except the Communications API (/comm-api/*): those operations name https://motorical.com as their own server, and api.motorical.com answers 404 for /comm-api."
    },
    {
      "url": "https://motorical.com",
      "description": "Dashboard host — OAuth AS endpoints. Also answers /api/* and /api/public/v1/*, but POST /v1/send is NOT served here (nginx answers 405)."
    }
  ],
  "tags": [
    {
      "name": "Motor Blocks",
      "description": "Isolated sending streams (Motor Blocks) — domains, keys, SMTP, rates, logs"
    },
    {
      "name": "Domains",
      "description": "Add/verify customer domains; check-dns flips send-readiness (DKIM/SPF) for /v1/send"
    },
    {
      "name": "Analytics",
      "description": "Metrics, deliverability, reputation, anomalies"
    },
    {
      "name": "Logs",
      "description": "Log search and message lookups"
    },
    {
      "name": "Config",
      "description": "Configuration & domain health"
    },
    {
      "name": "Webhooks",
      "description": "Webhook endpoints and delivery monitoring"
    },
    {
      "name": "Exports",
      "description": "Export jobs and previews"
    },
    {
      "name": "Status",
      "description": "Platform status: the same live data as https://motorical.com/status, for monitors and agents"
    },
    {
      "name": "Account Motor Blocks",
      "description": "Account-scoped production Motor Block lifecycle for OAuth-delegated agents (MCP scope manage:motor-blocks): list, create, rename, change type, assign domain, deactivate, reactivate, permanently delete. Hosted responses never contain a credential."
    }
  ],
  "paths": {
    "/api/public/token/account-key": {
      "post": {
        "tags": [
          "Motor Blocks"
        ],
        "summary": "Mint a Public Analytics API token with an Account API Key",
        "description": "Use an Account API Key (`ak_live_...`) to create a short-lived bearer token for `/api/public/v1` endpoints. The key can be supplied as `Authorization: ApiKey ak_live_...` or `X-Api-Key: ak_live_...`.",
        "security": [
          {
            "accountApiKeyAuth": []
          },
          {
            "xApiKeyAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "motorBlockId"
                ],
                "properties": {
                  "motorBlockId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ttlSeconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 900,
                    "default": 300
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token minted"
          },
          "401": {
            "description": "Account API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "mintPublicTokenFromAccountKey"
      }
    },
    "/api/public/token": {
      "post": {
        "tags": [
          "Motor Blocks"
        ],
        "summary": "Mint a Public Analytics API token with a dashboard JWT",
        "description": "Dashboard and trusted-session flow for creating a short-lived bearer token for `/api/public/v1` endpoints. Server-to-server integrations should prefer `/api/public/token/account-key`.",
        "security": [
          {
            "dashboardBearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "motorBlockId"
                ],
                "properties": {
                  "motorBlockId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ttlSeconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 900,
                    "default": 300
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Token minted"
          },
          "401": {
            "description": "Dashboard JWT missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "mintPublicToken"
      }
    },
    "/api/domains": {
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Add a customer domain",
        "description": "Returns verification DNS instructions. For cname_managed DKIM, publish the CNAME in verification.records.dkim / dnsRecords (not a TXT p= key).",
        "security": [
          {
            "dashboardBearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "verificationMethod": {
                    "type": "string",
                    "enum": [
                      "dns",
                      "email"
                    ],
                    "default": "dns"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Domain added with verification instructions"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "addDomainDashboard"
      }
    },
    "/api/domains/{id}/verify": {
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Verify ownership and refresh DKIM/SPF send-readiness",
        "description": "First call verifies ownership TXT. Re-calling after verified=true live-checks DKIM/SPF/DMARC and sets dkim_configured/spf_configured (required for /v1/send). Response includes sendReady + summary.",
        "security": [
          {
            "dashboardBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "dns",
                      "email"
                    ],
                    "default": "dns"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified and/or email-auth refreshed"
          },
          "400": {
            "description": "DNS ownership not found yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "verifyDomainDashboard"
      }
    },
    "/api/domains/{id}/check-dns": {
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Check DKIM/SPF/DMARC and persist send-readiness flags",
        "description": "Same email-auth refresh as re-verify. Use when /v1/send returns DOMAIN_DNS_INCOMPLETE despite dig showing correct records. Requires dashboard JWT (not Public API bearer / domain-health token). For a Public API bearer or MCP OAuth/Delegation grant, use POST /api/public/v1/domains/{id}/check-dns instead — same handler, no motorBlockId.",
        "security": [
          {
            "dashboardBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recordType": {
                    "type": "string",
                    "enum": [
                      "dkim",
                      "spf",
                      "dmarc",
                      "mx"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Flags updated; sendReady true when DKIM+SPF pass"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "checkDomainDnsDashboard"
      }
    },
    "/api/public/v1/account/motor-blocks": {
      "get": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "List the account's production Motor Blocks (OAuth/Public API bearer)",
        "description": "Account-scoped inventory of `transactional` and `general_purpose` Motor Blocks covered by the CURRENT authorization grant (read live from the backend, never from a token claim), including inactive blocks. Developer-sandbox and companion blocks are excluded. Each row carries `activeAuthMethod` (read-only) and `credentialsAvailable: false` with a `credentialsLocation` dashboard link — no credential is ever returned.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Blocks covered by the grant; empty array when it covers none"
          },
          "403": {
            "description": "missing_scope (requires config.read / MCP manage:motor-blocks)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "listManagedMotorBlocks"
      },
      "post": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Create a production Motor Block (OAuth/Public API bearer)",
        "description": "Creates a `transactional` or `general_purpose` Motor Block on a verified, non-sandbox domain the account owns, subject to the plan's Motor Block limit. Requires an `Idempotency-Key` header (UUID v4): a replay with the same key and input returns the same block, one database row, and never a credential. The new block is appended to the calling grant in the same transaction, so it is usable by explicit `motorBlockId` immediately, WITHOUT a token refresh or re-authorization (`authorizationUpdated`). Hosted responses never contain a password, API-key secret or certificate — `credentialsAvailable: false` and `credentialsLocation` point to the dashboard. `nextAction` suggests a `dryRun` send from the new block.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "UUID v4. Reused with different input -> 409 idempotency_conflict."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "domainId"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "domainId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "A verified, non-sandbox domain owned by the account"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "transactional",
                      "general_purpose"
                    ],
                    "default": "general_purpose"
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created (or an idempotent replay of the same creation)"
          },
          "400": {
            "description": "invalid_idempotency_key | domain_id_required | unsupported_motor_block_type | sandbox_domain_not_allowed | invalid_motor_block_description",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "subscription_required | motor_block_limit_reached (see upgradeUrl)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "domain_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "domain_not_verified | motor_block_name_conflict | idempotency_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "createMotorBlock"
      }
    },
    "/api/public/v1/account/motor-blocks/{id}/name": {
      "patch": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Rename a Motor Block (display name only)",
        "description": "Changes the display name. Rename NEVER changes the SMTP username or any credential; an SMTP username changes only at the sandbox-to-production conversion boundary.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Renamed"
          },
          "400": {
            "description": "motor_block_id_conflict | motor_block_type_not_manageable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "motor_block_not_authorized (not covered by the grant)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "motor_block_name_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "renameMotorBlock"
      }
    },
    "/api/public/v1/account/motor-blocks/{id}/type": {
      "patch": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Switch a Motor Block between transactional and general_purpose",
        "description": "Requires `confirm: true` (else 400 confirmation_required). Only `transactional` and `general_purpose` are accepted; marketing, portal and sandbox blocks fail closed. Auth method is read-only and never changed by this route.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "confirm"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "transactional",
                      "general_purpose"
                    ]
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Type changed"
          },
          "400": {
            "description": "confirmation_required | unsupported_motor_block_type | motor_block_type_not_manageable | motor_block_id_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "motor_block_not_authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "changeMotorBlockType"
      }
    },
    "/api/public/v1/account/motor-blocks/{id}/assign-domain": {
      "post": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Assign a verified domain to a Motor Block",
        "description": "Requires `confirm: true`. The target must be a verified, non-sandbox domain owned by the account.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domainId",
                  "confirm"
                ],
                "properties": {
                  "domainId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain assigned"
          },
          "400": {
            "description": "confirmation_required | domain_id_required | sandbox_domain_not_allowed | motor_block_id_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "motor_block_not_authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "domain_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "domain_not_verified",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "assignMotorBlockDomain"
      }
    },
    "/api/public/v1/account/motor-blocks/{id}/deactivate": {
      "post": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Deactivate (pause) a Motor Block — reversible",
        "description": "Requires `confirm: true`. Sends from the block are refused until it is reactivated. This is NOT deletion: nothing is removed. The response includes `nextAction` pointing at reactivate. A block must be inactive before it can be permanently deleted.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm"
                ],
                "properties": {
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deactivated"
          },
          "400": {
            "description": "confirmation_required | motor_block_id_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "motor_block_not_authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "motor_block_delete_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "deactivateMotorBlock"
      }
    },
    "/api/public/v1/account/motor-blocks/{id}/reactivate": {
      "post": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Reactivate a deactivated Motor Block",
        "description": "No confirmation needed (restores service). Refused with 409 motor_block_domain_required if the block has no verified production domain, or motor_block_delete_in_progress if deletion was already queued.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reactivated"
          },
          "400": {
            "description": "motor_block_id_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "motor_block_not_authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "motor_block_domain_required | motor_block_delete_in_progress",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "reactivateMotorBlock"
      }
    },
    "/api/public/v1/account/motor-blocks/{id}": {
      "delete": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Permanently delete a Motor Block — asynchronous and irrecoverable",
        "description": "Requires `confirm: true` AND an explicit boolean `deleteHistory` (true also deletes the block's message logs and events; false is refused with 409 motor_block_history_present if any exist). The block must already be deactivated. Deletion is queued: the response is 202 with a `jobId`; poll GET /account/motor-block-deletions/{jobId}. Only `transactional` and `general_purpose` blocks can be deleted here (409 motor_block_type_not_supported otherwise). Deletion never affects other blocks sharing the same domain.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm",
                  "deleteHistory"
                ],
                "properties": {
                  "confirm": {
                    "type": "boolean",
                    "enum": [
                      true
                    ]
                  },
                  "deleteHistory": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Deletion queued; poll the status route with jobId"
          },
          "400": {
            "description": "confirmation_required | delete_history_required | motor_block_id_conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "motor_block_not_authorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "motor_block_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "409": {
            "description": "motor_block_must_be_inactive | motor_block_history_present | motor_block_delete_in_progress | motor_block_type_not_supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "deleteMotorBlock"
      }
    },
    "/api/public/v1/account/motor-block-deletions/{jobId}": {
      "get": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Poll a permanent-deletion job",
        "description": "Status remains queryable by the authenticated account after the block row is gone. Scoped to the job owner.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Job status"
          },
          "404": {
            "description": "motor_block_deletion_not_found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getMotorBlockDeletionStatus"
      }
    },
    "/api/public/v1/account/authorization/motor-blocks/{id}": {
      "get": {
        "tags": [
          "Account Motor Blocks"
        ],
        "summary": "Live grant-coverage check for one Motor Block (infrastructure)",
        "description": "Used by the hosted MCP server to obtain a live authorization decision before serving task or resource state for an explicitly named block. Returns `authorized: true` only when the CURRENT grant covers the block and the caller owns it; otherwise 403. It is not a customer workflow and no tool is exposed for it.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Covered and owned"
          },
          "403": {
            "description": "motor_block_not_authorized | motor_block_not_found | motor_block_not_owned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "checkMotorBlockAuthorization"
      }
    },
    "/api/public/v1/motor-blocks": {
      "get": {
        "tags": [
          "Motor Blocks"
        ],
        "summary": "List motor blocks bound to the token",
        "description": "Returns the Motor Block(s) associated with the current public API token.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MotorBlocksListResponse"
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "name": "Example 16",
                      "type": "transactional",
                      "active": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "listMotorBlocks"
      }
    },
    "/api/public/v1/domains": {
      "get": {
        "tags": [
          "Domains"
        ],
        "summary": "List domains on the account",
        "description": "Account-wide — domains belong to the account (domains.user_id), not to a Motor Block, and no motorBlockId is required or read. A Motor Block is created FROM a verified domain (motor_blocks.domain_id), never the reverse, so this is the entry point for a new account before any Motor Block exists. Symmetric with, and reuses the same handler as, the dashboard's domain list.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK — id, domain, verified, verified_at, dkim_configured/spf_configured/dmarc_configured/mx_configured, email_auth_status, dkim_managed_type, dkim_selector, created_at per domain",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "domain": "example.com",
                      "verified": true,
                      "verified_at": "2026-11-22T13:04:11.682Z",
                      "sandbox": false,
                      "dkim_configured": false,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "partial",
                      "dkim_managed_type": "cname_managed",
                      "dkim_selector": "motorical1",
                      "created_at": "2026-11-22T13:04:11.683Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "domain": "example2.com",
                      "verified": true,
                      "verified_at": "2025-05-31T19:46:02.423Z",
                      "sandbox": false,
                      "dkim_configured": true,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "complete",
                      "dkim_managed_type": "cname_managed",
                      "dkim_selector": "motorical1",
                      "created_at": "2025-05-31T19:44:22.912Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000003",
                      "domain": "example3.com",
                      "verified": true,
                      "verified_at": "2026-06-27T13:09:18.765Z",
                      "sandbox": false,
                      "dkim_configured": true,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "complete",
                      "dkim_managed_type": "cname_managed",
                      "dkim_selector": "motorical1",
                      "created_at": "2026-06-27T13:03:48.313Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000004",
                      "domain": "example4.com",
                      "verified": true,
                      "verified_at": "2026-10-22T22:12:04.293Z",
                      "sandbox": false,
                      "dkim_configured": true,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "complete",
                      "dkim_managed_type": "cname_managed",
                      "dkim_selector": "motorical1",
                      "created_at": "2026-10-22T22:03:48.126Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "domain": "example5.com",
                      "verified": true,
                      "verified_at": "2025-05-29T17:40:58.494Z",
                      "sandbox": false,
                      "dkim_configured": true,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "complete",
                      "dkim_managed_type": "cname_managed",
                      "dkim_selector": "motorical1",
                      "created_at": "2025-05-29T17:04:33.807Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000006",
                      "domain": "example6.com",
                      "verified": true,
                      "verified_at": "2025-10-15T17:09:00.860Z",
                      "sandbox": false,
                      "dkim_configured": true,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "complete",
                      "dkim_managed_type": "cname_managed",
                      "dkim_selector": "motorical1",
                      "created_at": "2025-10-15T17:08:07.224Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000007",
                      "domain": "example7.com",
                      "verified": true,
                      "verified_at": "2026-11-11T14:52:04.189Z",
                      "sandbox": false,
                      "dkim_configured": false,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "partial",
                      "dkim_managed_type": "txt_direct",
                      "dkim_selector": "motorical1",
                      "created_at": "2026-11-11T14:52:04.189Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000008",
                      "domain": "example8.com",
                      "verified": true,
                      "verified_at": "2026-07-11T08:40:10.508Z",
                      "sandbox": false,
                      "dkim_configured": true,
                      "spf_configured": true,
                      "dmarc_configured": true,
                      "mx_configured": false,
                      "email_auth_status": "complete",
                      "dkim_managed_type": "txt_direct",
                      "dkim_selector": "motorical1",
                      "created_at": "2026-07-11T08:40:10.398Z"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "verified": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "verified_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "sandbox": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "dkim_configured": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "spf_configured": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "dmarc_configured": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "mx_configured": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "email_auth_status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dkim_managed_type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dkim_selector": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "listDomains"
      },
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Add a customer domain (account-wide, OAuth/MCP-capable)",
        "description": "Same handler as POST /api/domains — identical validation, DKIM/Cloudflare setup, and verification-instruction generation — reached over a Public API bearer or MCP OAuth/Delegation grant instead of a dashboard session. Account-wide: no motorBlockId. Returns verification DNS instructions; for cname_managed DKIM publish the CNAME in verification.records.dkim / dnsRecords (not a TXT p= key).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "verificationMethod": {
                    "type": "string",
                    "enum": [
                      "dns",
                      "email"
                    ],
                    "default": "dns"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Domain added with verification instructions"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "free_domain_limit: a Free account already has its one domain (when Free enforcement is on). The body carries `limit`, `count` and a `nextAction` (use the domain already added, or subscribe; human required).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "addDomain"
      }
    },
    "/api/public/v1/domains/{id}/verify": {
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Verify ownership and refresh DKIM/SPF send-readiness (account-wide, OAuth/MCP-capable)",
        "description": "Same handler as POST /api/domains/{id}/verify, reached over a Public API bearer or MCP OAuth/Delegation grant instead of a dashboard session. Account-wide: no motorBlockId. First call verifies ownership TXT. Re-calling after verified=true live-checks DKIM/SPF/DMARC and sets dkim_configured/spf_configured (required for /v1/send). Response includes sendReady + summary.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "enum": [
                      "dns",
                      "email"
                    ],
                    "default": "dns"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified and/or email-auth refreshed"
          },
          "400": {
            "description": "DNS ownership not found yet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "verifyDomain"
      }
    },
    "/api/public/v1/domains/{id}/check-dns": {
      "post": {
        "tags": [
          "Domains"
        ],
        "summary": "Check DKIM/SPF/DMARC and persist send-readiness flags (account-wide, OAuth/MCP-capable)",
        "description": "Same handler as POST /api/domains/{id}/check-dns, reached over a Public API bearer or MCP OAuth/Delegation grant instead of a dashboard session. Account-wide: no motorBlockId. Use when /v1/send returns DOMAIN_DNS_INCOMPLETE despite dig showing correct records.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recordType": {
                    "type": "string",
                    "enum": [
                      "dkim",
                      "spf",
                      "dmarc",
                      "mx"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Flags updated; sendReady true when DKIM+SPF pass"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "checkDomainDns"
      }
    },
    "/api/public/v1/motor-blocks/{id}/overview": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Motor Block overview",
        "description": "One-call overview including totals, rates, reputation, rate limits, anomalies, and top domains.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OverviewResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "generatedAt": "2026-11-27T23:04:09.616Z",
                    "timeWindow": {
                      "from": "2026-08-29T23:04:09.616Z",
                      "to": "2026-11-27T23:04:09.616Z"
                    },
                    "totals": {
                      "total": 0,
                      "processed": 0,
                      "delivered": 0,
                      "bounced": 0,
                      "deferred": 0,
                      "failed": 0,
                      "complained": 0,
                      "queued": 0,
                      "accepted": 0,
                      "finalized": 0,
                      "pending": 0
                    },
                    "rates": {
                      "deliveryRate": 0,
                      "bounceRate": 0,
                      "complaintRate": 0,
                      "basis": "Rates are percentages of finalized recipients: accepted (delivered + processed + complained) + bounced + failed. Queued and deferred recipients are pending and left out. \"processed\" means the receiving server accepted the message."
                    },
                    "reputation": {
                      "score": 100,
                      "windowDays": 90,
                      "totals": {
                        "total": 0,
                        "delivered": 0,
                        "bounced": 0,
                        "complained": 0,
                        "failed": 0,
                        "bouncedCounted": 0,
                        "bouncedExcluded": 0
                      },
                      "rates": {
                        "bounceRate": 0,
                        "complaintRate": 0,
                        "failRate": 0
                      },
                      "kind": "delivery_reputation_score",
                      "label": "Delivery reputation score",
                      "basis": "Computed on request from this Motor Block's delivery outcomes over the last 90 days (the retention window of your token). Bounces caused by the recipient's mailbox being full, by the network, or by Motorical's own sending IP range are not counted; the raw bounced figure is still shown.",
                      "formula": "Starts at 100, minus 50 points per 1% bounced, 20 points per 0.1% complained and 10 points per 1% failed (pro rata), limited to 0 to 100.",
                      "notTheSameAs": "The dashboard Health score uses a different formula over the timeframe selected in the dashboard, and the automatic sending policy (throttling and review) uses its own internal daily score, so the numbers differ by design. Domain health (SPF, DKIM, DMARC) is a set-up status, not a score.",
                      "lowVolume": true,
                      "note": "Fewer than 50 sends in this window: bounces are not scored yet, only complaints and failures."
                    },
                    "rateLimits": {
                      "burst": {
                        "used": 0,
                        "limit": 2400,
                        "remaining": 2400,
                        "percentage": 0,
                        "resetIn": 60
                      },
                      "hourly": {
                        "used": 0,
                        "limit": 1900,
                        "remaining": 1900,
                        "percentage": 0,
                        "resetIn": 3351
                      },
                      "daily": {
                        "used": 0,
                        "limit": 20000,
                        "remaining": 20000,
                        "percentage": 0,
                        "resetIn": 3411
                      },
                      "throttled": false,
                      "throttleReason": null
                    },
                    "latestAnomalies": [],
                    "topDomains": []
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getOverview"
      }
    },
    "/api/public/v1/motor-blocks/{id}/daily-summary": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Daily summary",
        "description": "Daily rollups for a recent window (sent, delivered, bounced, complained, plus rates).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "zeroFill",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "true returns one row per day of the window: days with no sends have zero counts and null rates (no sends, so no rate), and the response carries zeroFilled: true. Default false: only days with sends appear."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "windowDays": 90,
                    "rateBasis": "Rates are percentages of finalized recipients: accepted (delivered + processed + complained) + bounced + failed. Queued and deferred recipients are pending and left out. \"processed\" means the receiving server accepted the message.",
                    "series": []
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "windowDays": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "rateBasis": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "series": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getDailySummary"
      }
    },
    "/api/public/v1/motor-blocks/{id}/rate-limits": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Motor Block rate limits",
        "description": "Current usage vs burst, hourly, and daily rate limits.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitsResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "limits": {
                      "burstLimit": 2400,
                      "hourlyRate": 1900,
                      "dailyVolume": 20000,
                      "concurrentConnections": 5
                    },
                    "throttled": false,
                    "throttleReason": null,
                    "timestamp": "2026-11-27T23:04:09.923Z",
                    "burst": {
                      "used": 0,
                      "limit": 2400,
                      "remaining": 2400,
                      "percentage": 0,
                      "resetIn": 60
                    },
                    "hourly": {
                      "used": 0,
                      "limit": 1900,
                      "remaining": 1900,
                      "percentage": 0,
                      "resetIn": 3351
                    },
                    "daily": {
                      "used": 0,
                      "limit": 20000,
                      "remaining": 20000,
                      "percentage": 0,
                      "resetIn": 3411
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getRateLimits"
      }
    },
    "/api/public/v1/account/rate-limits": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Account-wide rate limits",
        "description": "Account-wide send-quota usage vs the hourly and daily account cap, aggregated across all of the account's motor blocks.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountRateLimitsResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "source": "plan",
                    "timestamp": "2026-11-27T23:04:11.629Z",
                    "hourly": {
                      "used": 0,
                      "limit": 5000,
                      "remaining": 5000,
                      "resetIn": 3349
                    },
                    "daily": {
                      "used": 4290,
                      "limit": 20000,
                      "remaining": 15710,
                      "resetIn": 3409
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getAccountRateLimits"
      }
    },
    "/api/public/v1/account/state": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Composed account state",
        "description": "One composed answer for \"where does this account stand\": domain verification, DNS readiness, Motor Block existence, and sandbox status in a single call, account-wide (no motorBlockId needed, works before any Motor Block exists).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "stage": "production_ready",
                    "ready_to_send": true,
                    "blockers": [],
                    "next_action": null,
                    "path": "none",
                    "domains": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "domain": "example.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": false,
                        "spfConfigured": true,
                        "sendReady": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "domain": "example2.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": true,
                        "spfConfigured": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "domain": "example3.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": true,
                        "spfConfigured": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "domain": "example4.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": true,
                        "spfConfigured": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "domain": "example5.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": true,
                        "spfConfigured": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "domain": "example6.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": true,
                        "spfConfigured": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "domain": "example7.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": false,
                        "spfConfigured": true,
                        "sendReady": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "domain": "example8.com",
                        "verified": true,
                        "sandbox": false,
                        "dkimConfigured": true,
                        "spfConfigured": true,
                        "sendReady": true
                      }
                    ],
                    "domainCandidates": [
                      {
                        "id": "00000000-0000-4000-8000-000000000001",
                        "domain": "example.com",
                        "verified": true,
                        "sendReady": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000002",
                        "domain": "example2.com",
                        "verified": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000003",
                        "domain": "example3.com",
                        "verified": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000004",
                        "domain": "example4.com",
                        "verified": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000005",
                        "domain": "example5.com",
                        "verified": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000006",
                        "domain": "example6.com",
                        "verified": true,
                        "sendReady": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000007",
                        "domain": "example7.com",
                        "verified": true,
                        "sendReady": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000008",
                        "domain": "example8.com",
                        "verified": true,
                        "sendReady": true
                      }
                    ],
                    "motorBlocks": [
                      {
                        "id": "00000000-0000-4000-8000-000000000009",
                        "name": "Example 13",
                        "type": "transactional",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000010",
                        "name": "Example 16",
                        "type": "transactional",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000011",
                        "name": "example2.com — Campaigns",
                        "type": "marketing",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000012",
                        "name": "example3.com — Campaigns",
                        "type": "marketing",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000013",
                        "name": "Example 11",
                        "type": "general_purpose",
                        "active": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000014",
                        "name": "Example 6",
                        "type": "transactional",
                        "active": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000015",
                        "name": "Example 14",
                        "type": "transactional",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000016",
                        "name": "Example 15",
                        "type": "transactional",
                        "active": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000017",
                        "name": "Example 17",
                        "type": "marketing",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000018",
                        "name": "Example 12",
                        "type": "marketing",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000019",
                        "name": "Example 10",
                        "type": "transactional",
                        "active": false
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000020",
                        "name": "Example 18",
                        "type": "transactional",
                        "active": true
                      },
                      {
                        "id": "00000000-0000-4000-8000-000000000021",
                        "name": "Example 20",
                        "type": "transactional",
                        "active": true
                      }
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "stage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ready_to_send": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "blockers": {
                          "type": "array",
                          "items": {}
                        },
                        "next_action": {},
                        "path": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "domains": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "domain": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "verified": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "sandbox": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "dkimConfigured": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "spfConfigured": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "sendReady": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": true
                          }
                        },
                        "domainCandidates": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "domain": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "verified": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              },
                              "sendReady": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": true
                          }
                        },
                        "motorBlocks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "type": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "active": {
                                "type": [
                                  "boolean",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": true
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getAccountState"
      }
    },
    "/api/public/v1/domains/{id}": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "One sending domain",
        "description": "One domain of the account by id: verified, DNS authentication flags, DKIM mode, created. Read-only, no keys or tokens. 404 when the id is not one of your domains.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "domain": "example.com",
                    "verified": true,
                    "verified_at": "2026-11-22T13:04:11.682Z",
                    "sandbox": false,
                    "dkim_configured": false,
                    "spf_configured": true,
                    "dmarc_configured": true,
                    "mx_configured": false,
                    "email_auth_status": "partial",
                    "dkim_managed_type": "cname_managed",
                    "dkim_selector": "motorical1",
                    "created_at": "2026-11-22T13:04:11.683Z"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "domain": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "verified": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "verified_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "sandbox": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "dkim_configured": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "spf_configured": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "dmarc_configured": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "mx_configured": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "email_auth_status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "dkim_managed_type": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "dkim_selector": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "created_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "404": {
            "description": "Domain not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getDomain"
      }
    },
    "/api/public/v1/domains/{id}/health": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Email-authentication health of one domain",
        "description": "SPF, DKIM, DMARC, status and issues for one domain by id, cache-first with a source field. Works for a domain that has no Motor Block yet. Add refresh=true for a live DNS check.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "domain": "example.com",
                    "status": "partial",
                    "spf": {
                      "configured": true,
                      "valid": true
                    },
                    "dkim": {
                      "configured": false,
                      "valid": false
                    },
                    "dmarc": {
                      "configured": true,
                      "policy": null,
                      "valid": true
                    },
                    "lastCheckedAt": "2026-11-24T12:00:00.961Z",
                    "issues": [
                      "DKIM not configured (or not yet confirmed)"
                    ],
                    "source": "cache_stale",
                    "cacheTtlMs": 900000,
                    "refreshing": true,
                    "cacheAgeSeconds": 299052,
                    "nextAction": "A fresh DNS check has started in the background. Read again in about ten seconds, or pass refresh=true to wait for a live check."
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "domain": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "spf": {
                          "type": "object",
                          "properties": {
                            "configured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "valid": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "dkim": {
                          "type": "object",
                          "properties": {
                            "configured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "valid": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "dmarc": {
                          "type": "object",
                          "properties": {
                            "configured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "policy": {},
                            "valid": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "lastCheckedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "issues": {
                          "type": "array",
                          "items": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cacheTtlMs": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "refreshing": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "cacheAgeSeconds": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "nextAction": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "404": {
            "description": "Domain not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getDomainHealthById"
      }
    },
    "/api/public/v1/domains/{id}/dns-records": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "DNS records to publish for one domain",
        "description": "The DNS records to publish for the domain and what each is for. Add lookup=true to also check what DNS currently answers (slower, live lookups).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "lookup",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "domain": "example.com",
                  "verified": true,
                  "domainInfo": {
                    "parsed": {
                      "fullDomain": "mail.example.com",
                      "parts": [
                        "mail",
                        "example",
                        "com"
                      ],
                      "isSubdomain": true,
                      "rootDomain": "example6.com",
                      "subdomainPrefix": "mail",
                      "tldLength": 1
                    },
                    "isSubdomain": true,
                    "rootDomain": "example6.com",
                    "subdomainPrefix": "mail"
                  },
                  "hostingInfo": null,
                  "dnsRecords": [
                    {
                      "type": "CNAME",
                      "name": "motorical1._domainkey.example.com",
                      "shortName": "motorical1._domainkey.mail",
                      "value": "dkim_0123456789ab._domainkey.dkim.motorical.com",
                      "purpose": "DKIM email signing (managed by Motorical)",
                      "required": true,
                      "recordType": "dkim",
                      "dnsMethod": "cname"
                    },
                    {
                      "type": "TXT",
                      "name": "example.com",
                      "shortName": "mail",
                      "value": "v=spf1 include:motorical.com ~all",
                      "purpose": "SPF email authentication",
                      "required": true,
                      "recordType": "spf",
                      "spfStatus": null,
                      "requiresMerging": false,
                      "apexCoexistenceInfo": null
                    },
                    {
                      "type": "TXT",
                      "name": "_dmarc.example.com",
                      "shortName": "_dmarc.mail",
                      "value": "v=DMARC1; p=none; rua=mailto:recipient@motorical.com; fo=1",
                      "purpose": "DMARC email policy (required)",
                      "required": true,
                      "recordType": "dmarc",
                      "dmarcStatus": null,
                      "requiresMerging": false
                    }
                  ],
                  "dnsResults": {},
                  "spfStatus": null,
                  "dmarcStatus": null,
                  "lookupPerformed": false
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verified": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "domainInfo": {
                      "type": "object",
                      "properties": {
                        "parsed": {
                          "type": "object",
                          "properties": {
                            "fullDomain": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "isSubdomain": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "rootDomain": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "subdomainPrefix": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "tldLength": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "isSubdomain": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "rootDomain": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "subdomainPrefix": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": true
                    },
                    "hostingInfo": {},
                    "dnsRecords": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "shortName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "value": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "purpose": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "required": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "recordType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "dnsMethod": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "spfStatus": {},
                          "requiresMerging": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "apexCoexistenceInfo": {},
                          "dmarcStatus": {}
                        },
                        "additionalProperties": true
                      }
                    },
                    "dnsResults": {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": true
                    },
                    "spfStatus": {},
                    "dmarcStatus": {},
                    "lookupPerformed": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": true,
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "404": {
            "description": "Domain not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getDomainDnsRecords"
      }
    },
    "/api/public/v1/account/whoami": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Account identity, plan and grant",
        "description": "Who the credential acts for, account-wide (no motorBlockId needed): the account id, owner email and name, the plan name and status, and, for an OAuth grant, the client, the scopes it holds, the Motor Blocks it covers, when it was granted, canAdd (permissions it could still be given, available:false where the plan does not allow it) and addInDashboard. grant is null when the call is not made over an OAuth grant. account.billing carries the plan price (amount in minor units, currency, interval), trial end, current period end and next renewal date, whether it cancels at period end and when it ends, this month's sends against the plan cap (the dashboard figure), and whether the payment method is ok or failing. It is returned to every connection that can call whoami, needs no extra scope, and never includes invoices, receipts, card details or tax ids. A field that cannot be resolved is null with its reason under billing.unavailable.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "account": {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "email": "owner@example.com",
                      "name": "Example 21 Example 19",
                      "verified": true,
                      "billing": {
                        "subscribed": true,
                        "price": {
                          "amount": 500,
                          "currency": "eur",
                          "interval": "month"
                        },
                        "trialEnd": null,
                        "currentPeriodEnd": "2026-12-02T12:24:59.000Z",
                        "nextRenewalDate": "2026-12-02T12:24:59.000Z",
                        "cancelAtPeriodEnd": false,
                        "endsAt": null,
                        "usage": {
                          "period": "calendar_month",
                          "sent": 71296,
                          "limit": 150000,
                          "percent": 47.5
                        },
                        "paymentMethod": {
                          "status": "ok"
                        },
                        "unavailable": {}
                      }
                    },
                    "plan": {
                      "name": "Professional Plan",
                      "status": "active",
                      "hasSubscription": true
                    },
                    "grant": null
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "account": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "email": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "verified": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "billing": {
                              "type": "object",
                              "properties": {
                                "subscribed": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "price": {
                                  "type": "object",
                                  "properties": {
                                    "amount": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "currency": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "interval": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "additionalProperties": true
                                },
                                "trialEnd": {},
                                "currentPeriodEnd": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "format": "date-time"
                                },
                                "nextRenewalDate": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "format": "date-time"
                                },
                                "cancelAtPeriodEnd": {
                                  "type": [
                                    "boolean",
                                    "null"
                                  ]
                                },
                                "endsAt": {},
                                "usage": {
                                  "type": "object",
                                  "properties": {
                                    "period": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "sent": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "limit": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "percent": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    }
                                  },
                                  "additionalProperties": true
                                },
                                "paymentMethod": {
                                  "type": "object",
                                  "properties": {
                                    "status": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "additionalProperties": true
                                },
                                "unavailable": {
                                  "type": "object",
                                  "properties": {},
                                  "additionalProperties": true
                                }
                              },
                              "additionalProperties": true
                            }
                          },
                          "additionalProperties": true
                        },
                        "plan": {
                          "type": "object",
                          "properties": {
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "status": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "hasSubscription": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "grant": {}
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "404": {
            "description": "Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "whoami"
      }
    },
    "/api/public/v1/motor-blocks/{id}/metrics": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Metrics series and totals",
        "description": "Aggregated metrics (sent, delivered, bounced, complained) over hour/day buckets.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "series": [],
                    "totals": {
                      "total": 0,
                      "processed": 0,
                      "delivered": 0,
                      "bounced": 0,
                      "deferred": 0,
                      "failed": 0,
                      "complained": 0
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getMetrics"
      }
    },
    "/api/public/v1/motor-blocks/{id}/deliverability": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Deliverability by recipient domain",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "items": [],
                    "rateBasis": "Rates are percentages of finalized recipients: accepted (delivered + processed + complained) + bounced + failed. Queued and deferred recipients are pending and left out. \"processed\" means the receiving server accepted the message.",
                    "from": "2026-08-29T23:04:10.207Z",
                    "to": "2026-11-27T23:04:10.207Z"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {}
                        },
                        "rateBasis": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "from": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "to": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getDeliverability"
      }
    },
    "/api/public/v1/motor-blocks/{id}/reputation": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Delivery reputation score",
        "description": "The delivery reputation score (0-100), computed on request from this Motor Block delivery outcomes over the token retention window. It is not the dashboard Health score (a different formula over the dashboard timeframe), not the internal score behind automatic throttling, and not domain health (SPF, DKIM, DMARC), so those numbers differ by design; the response labels itself with kind, basis, formula and notTheSameAs. The overview reputation block is the same payload.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "score": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100,
                          "description": "Starts at 100, minus 50 points per 1% bounced, 20 points per 0.1% complained and 10 points per 1% failed (pro rata), limited to 0-100"
                        },
                        "windowDays": {
                          "type": "integer",
                          "description": "The window the score covers (the token retention window)"
                        },
                        "totals": {
                          "type": "object",
                          "properties": {
                            "total": {
                              "type": "integer"
                            },
                            "delivered": {
                              "type": "integer"
                            },
                            "bounced": {
                              "type": "integer",
                              "description": "Every bounce in the window"
                            },
                            "bouncedCounted": {
                              "type": "integer",
                              "description": "Present where the bounce-cause rule is active: the bounces that feed the score (address or domain does not exist, policy blocks, anything unclassified)"
                            },
                            "bouncedExcluded": {
                              "type": "integer",
                              "description": "Present where the bounce-cause rule is active: bounces not counted (full mailbox, network failure, a block on the platform own sending network)"
                            },
                            "complained": {
                              "type": "integer"
                            },
                            "failed": {
                              "type": "integer"
                            }
                          }
                        },
                        "rates": {
                          "type": "object",
                          "description": "Percentages. bounceRate is the counted rate where the bounce-cause rule is active",
                          "properties": {
                            "bounceRate": {
                              "type": "number"
                            },
                            "complaintRate": {
                              "type": "number"
                            },
                            "failRate": {
                              "type": "number"
                            }
                          }
                        },
                        "lowVolume": {
                          "type": "boolean",
                          "description": "Present (true) when the window has fewer than 50 sends: bounces are not scored yet, only complaints and failures"
                        },
                        "note": {
                          "type": "string",
                          "description": "Present with lowVolume: says so in words"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "delivery_reputation_score"
                          ],
                          "description": "Which score this is"
                        },
                        "label": {
                          "type": "string"
                        },
                        "basis": {
                          "type": "string",
                          "description": "What the score is computed from and over how many days. Where the bounce-cause rule is active it ends with a sentence saying which bounces are not counted"
                        },
                        "formula": {
                          "type": "string"
                        },
                        "notTheSameAs": {
                          "type": "string",
                          "description": "How it differs from the dashboard Health score, the internal sending-policy score and domain health"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "score": 100,
                    "windowDays": 90,
                    "totals": {
                      "total": 0,
                      "delivered": 0,
                      "bounced": 0,
                      "complained": 0,
                      "failed": 0,
                      "bouncedCounted": 0,
                      "bouncedExcluded": 0
                    },
                    "rates": {
                      "bounceRate": 0,
                      "complaintRate": 0,
                      "failRate": 0
                    },
                    "kind": "delivery_reputation_score",
                    "label": "Delivery reputation score",
                    "basis": "Computed on request from this Motor Block's delivery outcomes over the last 90 days (the retention window of your token). Bounces caused by the recipient's mailbox being full, by the network, or by Motorical's own sending IP range are not counted; the raw bounced figure is still shown.",
                    "formula": "Starts at 100, minus 50 points per 1% bounced, 20 points per 0.1% complained and 10 points per 1% failed (pro rata), limited to 0 to 100.",
                    "notTheSameAs": "The dashboard Health score uses a different formula over the timeframe selected in the dashboard, and the automatic sending policy (throttling and review) uses its own internal daily score, so the numbers differ by design. Domain health (SPF, DKIM, DMARC) is a set-up status, not a score.",
                    "lowVolume": true,
                    "note": "Fewer than 50 sends in this window: bounces are not scored yet, only complaints and failures."
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getReputation"
      }
    },
    "/api/public/v1/motor-blocks/{id}/anomalies": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Anomaly detection (bounce spikes)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "anomalies": [],
                    "windowDays": 14
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "anomalies": {
                          "type": "array",
                          "items": {}
                        },
                        "windowDays": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getAnomalies"
      }
    },
    "/api/public/v1/motor-blocks/{id}/providers": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Provider breakdown (gmail, outlook, yahoo, other)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "from": "2026-08-29T23:04:10.636Z",
                    "to": "2026-11-27T23:04:10.636Z",
                    "rateBasis": "Rates are percentages of finalized recipients: accepted (delivered + processed + complained) + bounced + failed. Queued and deferred recipients are pending and left out. \"processed\" means the receiving server accepted the message.",
                    "items": []
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "to": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "rateBasis": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "items": {
                          "type": "array",
                          "items": {}
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getProviders"
      }
    },
    "/api/public/v1/motor-blocks/{id}/error-codes": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "SMTP error code diagnostics",
        "description": "The SMTP codes recorded for this Motor Block in the window, most frequent first, each with a specific diagnosis. Counts are recipient outcomes: the same rows GET /motor-blocks/{id}/logs?smtpCode=<code> returns. The stored code is basic (550), enhanced (5.7.1) or a bucket (200 delivered to a Motorical-hosted mailbox; 400 and 500 when the exact code was not recorded).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "items": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string",
                                "description": "The stored SMTP code"
                              },
                              "count": {
                                "type": "integer",
                                "description": "Recipient outcomes with this code in the window"
                              },
                              "sampleStatus": {
                                "type": "string",
                                "nullable": true,
                                "description": "An outcome seen with this code (for example bounced, deferred, delivered)"
                              },
                              "category": {
                                "type": "string",
                                "enum": [
                                  "success",
                                  "temporary",
                                  "permanent",
                                  "unknown"
                                ]
                              },
                              "label": {
                                "type": "string",
                                "description": "What the code means, in one line"
                              },
                              "hint": {
                                "type": "string",
                                "description": "What to do about it"
                              },
                              "cause": {
                                "type": "string",
                                "description": "The platform bounce-classifier bucket (recipient_invalid, recipient_mailbox_full, recipient_dns_failure, policy_block_reputation, policy_block_content, policy_block_auth, temporary_deferral, network_failure, unclassified) or success, permanent_refusal, unrecorded_temporary, unrecorded_permanent, unrecorded"
                              },
                              "codeForm": {
                                "type": "string",
                                "enum": [
                                  "basic",
                                  "enhanced",
                                  "bucket",
                                  "other"
                                ]
                              },
                              "retryable": {
                                "type": "boolean",
                                "nullable": true,
                                "description": "true for a temporary failure the platform retries on its own; false for a permanent one; null for a success"
                              },
                              "suggestedAction": {
                                "type": "string",
                                "enum": [
                                  "none",
                                  "retry",
                                  "remove",
                                  "investigate"
                                ]
                              },
                              "lookup": {
                                "type": "object",
                                "description": "Pass these as query parameters to GET /motor-blocks/{id}/logs to list the messages behind this code",
                                "properties": {
                                  "smtpCode": {
                                    "type": "string"
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "from": "2026-08-29T23:04:10.774Z",
                    "to": "2026-11-27T23:04:10.774Z",
                    "items": []
                  }
                }
              }
            }
          },
          "403": {
            "description": "Token not bound to this Motor Block, or missing the analytics.read scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getErrorCodes"
      }
    },
    "/api/public/v1/motor-blocks/{id}/logs": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Search logs with cursor pagination",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "currentOutcome",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "queued",
                "processed",
                "deferred",
                "delivered",
                "bounced",
                "failed",
                "complained"
              ]
            }
          },
          {
            "name": "smtpCode",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by the SMTP code the receiving server reported. The stored value is either basic (550) or enhanced (5.7.1), so besides an exact code you can pass a class (5xx, 4xx or 5.x.x), a group (5.7.x), or a comma-separated list of up to 10 (for example 5.7.x,4xx). An invalid value is a 400 with error invalid_smtp_code.",
            "example": "5.7.x"
          },
          {
            "name": "query",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Space-separated key:value terms, all of which must match: recipient:<exact address>, domain:<exact domain>, code:<an SMTP code filter, same forms as smtpCode>, id:<message uuid>. Text without a known key is ignored."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includePII",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Requires logs.pii scope"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsResponse"
                },
                "example": {
                  "success": true,
                  "data": {
                    "items": [],
                    "nextCursor": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getLogs"
      }
    },
    "/api/public/v1/messages/{id}": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Get message by send id (UUID)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "includePII",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Requires logs.pii scope"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getMessage"
      }
    },
    "/api/public/v1/messages": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Lookup message by RFC Message-ID header",
        "description": "Not a collection/list endpoint. Requires query smtpMessageId (the RFC Message-ID / SMTP message id). For listing recent sends use GET /motor-blocks/{id}/logs. For lookup by send UUID use GET /messages/{id}.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "smtpMessageId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "RFC Message-ID value (with or without angle brackets)"
          },
          {
            "name": "includePII",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — data.items has 0 or 1 match"
          },
          "400": {
            "description": "Missing smtpMessageId",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "listMessages"
      }
    },
    "/api/public/v1/messages/{id}/events": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Get message event timeline",
        "description": "Canonical lifecycle events from email_events.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "includePII",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Requires logs.pii scope"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getMessageEvents"
      }
    },
    "/api/public/v1/messages/{id}/recipients": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Per-recipient outcomes for a multi-recipient send",
        "description": "GET /messages/{id} and GET /messages/{id}/events both collapse to a single email_events row (whichever recipient's log line landed first). This reads postfix_log_events grouped by recipient — the only place a multi-recipient send's individual recipient outcomes are visible.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "includePII",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Requires logs.pii scope"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getMessageRecipients"
      }
    },
    "/api/public/v1/motor-blocks/{id}/config": {
      "get": {
        "tags": [
          "Config"
        ],
        "summary": "Motor Block config snapshot",
        "description": "Read-only, non-sensitive configuration snapshot and domain status.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "name": "Example 16",
                    "description": null,
                    "type": "transactional",
                    "active": true,
                    "suspended": false,
                    "suspensionReason": null,
                    "domainMissing": false,
                    "limits": {
                      "burstLimit": 2400,
                      "hourlyRate": 1900,
                      "dailyVolume": 20000,
                      "concurrentConnections": 5
                    },
                    "effectiveLimits": {
                      "dailyVolume": 20000,
                      "hourlyRate": 1900,
                      "burstLimit": 2400,
                      "throttled": false
                    },
                    "reputation": {
                      "open_rate": 0,
                      "bounce_rate": 0,
                      "health_score": 90,
                      "last_updated": "2026-11-27T23:00:46.501738+00:00",
                      "health_status": "healthy",
                      "complaint_rate": 0,
                      "hard_bounce_rate": 0
                    },
                    "domain": {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "name": "example5.com",
                      "verified": true,
                      "emailAuthStatus": "complete",
                      "emailAuthCheckedAt": "2026-11-27T06:30:50.032Z",
                      "dkimConfigured": true,
                      "spfConfigured": true,
                      "dmarcConfigured": true
                    },
                    "flags": {
                      "hasWebhooks": false
                    },
                    "activeAuthMethod": "Password",
                    "createdAt": "2026-03-10T11:59:04.378Z",
                    "updatedAt": "2026-11-27T23:00:46.508Z"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "description": {},
                        "type": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "active": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "suspended": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "suspensionReason": {},
                        "domainMissing": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "limits": {
                          "type": "object",
                          "properties": {
                            "burstLimit": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "hourlyRate": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "dailyVolume": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "concurrentConnections": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "effectiveLimits": {
                          "type": "object",
                          "properties": {
                            "dailyVolume": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "hourlyRate": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "burstLimit": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "throttled": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "reputation": {
                          "type": "object",
                          "properties": {
                            "open_rate": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "bounce_rate": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "health_score": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "last_updated": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date-time"
                            },
                            "health_status": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "complaint_rate": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "hard_bounce_rate": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "domain": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "verified": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "emailAuthStatus": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "emailAuthCheckedAt": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "format": "date-time"
                            },
                            "dkimConfigured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "spfConfigured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "dmarcConfigured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "flags": {
                          "type": "object",
                          "properties": {
                            "hasWebhooks": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "activeAuthMethod": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getConfig"
      }
    },
    "/api/public/v1/motor-blocks/{id}/domain-health": {
      "get": {
        "tags": [
          "Config"
        ],
        "summary": "Domain health (SPF/DKIM/DMARC): a set-up status, not a score",
        "description": "Cache-first: returns DB auth flags immediately (sub-second). Stale/cold checks schedule an async DNS refresh. Pass refresh=true to wait for a live re-check (capped; may still return prior cache on timeout).",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "If true, attempt a synchronous live DNS refresh before responding"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": {
                    "domain": "example5.com",
                    "status": "ok",
                    "spf": {
                      "configured": true,
                      "valid": true
                    },
                    "dkim": {
                      "configured": true,
                      "valid": true
                    },
                    "dmarc": {
                      "configured": true,
                      "policy": null,
                      "valid": true
                    },
                    "lastCheckedAt": "2026-11-27T06:30:50.032Z",
                    "issues": [],
                    "source": "cache_stale",
                    "cacheTtlMs": 900000,
                    "refreshing": true,
                    "cacheAgeSeconds": 59601,
                    "nextAction": "A fresh DNS check has started in the background. Read again in about ten seconds, or pass refresh=true to wait for a live check."
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "domain": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "spf": {
                          "type": "object",
                          "properties": {
                            "configured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "valid": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "dkim": {
                          "type": "object",
                          "properties": {
                            "configured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "valid": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "dmarc": {
                          "type": "object",
                          "properties": {
                            "configured": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "policy": {},
                            "valid": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": true
                        },
                        "lastCheckedAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "issues": {
                          "type": "array",
                          "items": {}
                        },
                        "source": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cacheTtlMs": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "refreshing": {
                          "type": [
                            "boolean",
                            "null"
                          ]
                        },
                        "cacheAgeSeconds": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "nextAction": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getDomainHealth"
      }
    },
    "/api/public/v1/motor-blocks/{id}/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": []
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {}
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "listWebhooks"
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create webhook",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "description": "Defaults to all six events when omitted.",
                    "items": {
                      "type": "string",
                      "enum": [
                        "message.processed",
                        "message.deferred",
                        "message.delivered",
                        "message.bounced",
                        "message.failed",
                        "message.complained"
                      ]
                    }
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created. The signing secret is returned once and is not retrievable afterwards.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "secret": {
                          "type": "string",
                          "description": "Shown once. Store it — required for X-Motorical-Signature verification."
                        },
                        "secretMasked": {
                          "type": "string"
                        }
                      }
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "createWebhook"
      }
    },
    "/api/public/v1/motor-blocks/{id}/webhooks/{webhookId}": {
      "put": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update webhook",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "updateWebhook"
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete webhook",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "deleteWebhook"
      }
    },
    "/api/public/v1/motor-blocks/{id}/webhooks/{webhookId}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Enqueue a test webhook delivery",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "testWebhook"
      }
    },
    "/api/public/v1/motor-blocks/{id}/webhooks/{webhookId}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Webhook delivery history",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getWebhookDeliveries"
      }
    },
    "/api/public/v1/motor-blocks/{id}/webhooks/{webhookId}/stats": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Webhook delivery stats",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "hours",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 168
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getWebhookStats"
      }
    },
    "/api/public/v1/motor-blocks/{id}/events/stream": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Event stream (SSE)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "streamEvents"
      }
    },
    "/api/public/v1/motor-blocks/{id}/exports": {
      "post": {
        "tags": [
          "Exports"
        ],
        "summary": "Create export job",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jobType": {
                    "type": "string",
                    "enum": [
                      "logs",
                      "metrics"
                    ]
                  },
                  "params": {
                    "type": "object"
                  },
                  "includePII": {
                    "type": "boolean",
                    "description": "Requires logs.pii scope. Default false — recipient addresses are masked in the generated file otherwise."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "createExport"
      },
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "List recent export jobs",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T13:27:47.486Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000002",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T13:00:04.262Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000003",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:50:01.517Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000004",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:48:15.000Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000005",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:47:50.189Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000006",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:44:27.062Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000007",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:43:32.370Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000008",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:39:32.565Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000009",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T12:34:51.333Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000010",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-25T11:41:12.500Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000011",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-10T11:49:26.134Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000012",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-10T11:45:27.254Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000013",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-10T11:41:01.783Z"
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000014",
                      "job_status": "done",
                      "job_type": "logs",
                      "created_at": "2026-04-10T11:34:54.405Z"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "job_status": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "job_type": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          }
                        },
                        "additionalProperties": true
                      }
                    }
                  },
                  "additionalProperties": true,
                  "required": [
                    "success",
                    "data"
                  ],
                  "x-shape-source": "recorded",
                  "description": "Shape of a real response recorded from a live account (fields observed; more may appear; any value may be null)."
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "listExports"
      }
    },
    "/api/public/v1/motor-blocks/{id}/exports/preview": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Preview recent logs (no job creation)",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "includePII",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Requires logs.pii scope"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "previewExport"
      }
    },
    "/api/public/v1/exports/{jobId}": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Get export job status",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "401": {
            "description": "Missing, invalid or expired credential (code access_token_required, invalid_access_token or similar).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "403": {
            "description": "The credential lacks a scope this operation needs, or does not cover the Motor Block named (code missing_scope or motor_block_not_authorized).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "getExport"
      }
    },
    "/api/public/v1/exports/{jobId}/download": {
      "get": {
        "tags": [
          "Exports"
        ],
        "summary": "Download export file (signed token, single-use)",
        "description": "The file is deleted on a successful download — exports are not retained. GET the job status again for a fresh token against the same file if the download did not complete. An unretrieved file is deleted automatically 24 hours after the job completes.",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "403": {
            "description": "The download token is invalid or expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "404": {
            "description": "No such export, or its file is gone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            }
          }
        },
        "operationId": "downloadExport"
      }
    },
    "/api/system/public-status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Platform status (overall and per component)",
        "description": "The data behind https://motorical.com/status. No authentication. Cached briefly on the server and by `Cache-Control` (its `max-age` says how long), so polling more often than that returns the same answer. Always answers 200: when the status check itself fails, `status` is `unavailable` and every component is `unavailable` too. A component that is down is reported as `degraded`. It is served from the same servers it reports on, so a failure to reach it is itself a signal. For whether HTTP sending is up, `GET /v1/status` answers too.",
        "security": [],
        "responses": {
          "200": {
            "description": "Current platform status",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "status",
                    "updatedAt",
                    "components"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "operational",
                        "degraded",
                        "unavailable"
                      ],
                      "description": "Overall state. Treat an unknown value as degraded."
                    },
                    "message": {
                      "type": "string",
                      "description": "One sentence for people."
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time",
                      "description": "When these figures were computed."
                    },
                    "components": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "status"
                        ],
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "For example Delivery Pipeline, Public API, Communications API, Webhook Delivery."
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "operational",
                              "degraded",
                              "unavailable"
                            ]
                          },
                          "summary": {
                            "type": "string"
                          },
                          "metrics": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            },
                            "description": "Coarse labels such as normal, elevated, limited or unavailable; never raw numbers."
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "success": true,
                  "status": "operational",
                  "message": "All monitored systems are operating normally.",
                  "updatedAt": "2026-11-27T21:23:48.078Z",
                  "components": [
                    {
                      "name": "Delivery Pipeline",
                      "status": "operational",
                      "summary": "Message processing and delivery automation are monitored continuously.",
                      "metrics": {
                        "queue": "normal",
                        "processing": "normal",
                        "latency": "normal"
                      }
                    }
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Too many requests (code rate_limit_exceeded or RATE_LIMIT_ANONYMOUS); wait X-RateLimit-Reset seconds."
          }
        },
        "operationId": "getPlatformStatus"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Short-lived Public Analytics API token used for /api/public/v1 endpoints."
      },
      "dashboardBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Dashboard session JWT used only to mint Public Analytics API tokens."
      },
      "accountApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Account API key for token minting. Format: ApiKey ak_live_..."
      },
      "apiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Motor Block API key. Format: ApiKey mk_live_..."
      },
      "xApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Alternative API key header. Use ak_live_... for token minting or mk_live_... for /v1/send."
      },
      "tenantHeaderAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Tenant-Id",
        "description": "Communications Block tenant identifier used to scope lists, templates, campaigns, suppressions, and analytics."
      }
    },
    "schemas": {
      "MotorBlocksListResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RateLimitsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "burst": {
                "$ref": "#/components/schemas/LimitBucket"
              },
              "hourly": {
                "$ref": "#/components/schemas/LimitBucket"
              },
              "daily": {
                "$ref": "#/components/schemas/LimitBucket"
              },
              "limits": {
                "type": "object",
                "description": "Raw customer-configured limits (unaffected by throttling)"
              },
              "throttled": {
                "type": "boolean",
                "description": "Whether a system-imposed throttle is currently lowering the effective ceiling below the configured limits"
              },
              "throttleReason": {
                "type": "string",
                "nullable": true,
                "description": "Reason for the active throttle, if any"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "warning": {
            "type": "string",
            "description": "Present only when counter data was temporarily unavailable; the bucket values are then ceiling-only estimates, not live counts. Note this sits at the response root here, while AccountRateLimitsResponse carries it inside data."
          }
        }
      },
      "AccountRateLimitsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "hourly": {
                "$ref": "#/components/schemas/AccountLimitBucket"
              },
              "daily": {
                "$ref": "#/components/schemas/AccountLimitBucket"
              },
              "source": {
                "type": "string",
                "description": "Where the account ceiling came from -- \"plan\" or \"fallback\""
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              },
              "warning": {
                "type": "string",
                "description": "Present only when account usage data was temporarily unavailable (e.g. a Redis outage); the bucket values above are then fallback estimates, not live counts"
              }
            }
          }
        }
      },
      "AccountLimitBucket": {
        "type": "object",
        "properties": {
          "used": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "resetIn": {
            "type": "integer"
          }
        }
      },
      "LimitBucket": {
        "type": "object",
        "properties": {
          "used": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          },
          "remaining": {
            "type": "integer"
          },
          "percentage": {
            "type": "integer"
          },
          "resetIn": {
            "type": "integer"
          }
        }
      },
      "LogsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/LogItem"
                }
              },
              "nextCursor": {
                "type": "string",
                "nullable": true
              }
            }
          }
        }
      },
      "MessageSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "smtpMessageId": {
            "type": "string",
            "nullable": true
          },
          "recipient": {
            "type": "string"
          },
          "currentOutcome": {
            "type": "string",
            "enum": [
              "queued",
              "processed",
              "deferred",
              "delivered",
              "bounced",
              "failed",
              "complained"
            ]
          },
          "smtpCode": {
            "type": "string",
            "nullable": true
          },
          "queuedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MessageResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "smtpMessageId": {
            "type": "string",
            "nullable": true
          },
          "currentOutcome": {
            "type": "string"
          },
          "isTerminal": {
            "type": "boolean"
          },
          "from": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "queuedAt": {
            "type": "string",
            "format": "date-time"
          },
          "processedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "deliveredAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "bouncedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "smtpCode": {
            "type": "string",
            "nullable": true
          },
          "smtpResponse": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "WebhookEvent": {
        "type": "object",
        "properties": {
          "event": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "smtpMessageId": {
            "type": "string",
            "nullable": true
          },
          "motorBlockId": {
            "type": "string",
            "format": "uuid"
          },
          "from": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "subject": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "currentOutcome": {
            "type": "string"
          },
          "isTerminal": {
            "type": "boolean"
          },
          "smtpCode": {
            "type": "string",
            "nullable": true
          },
          "smtpResponse": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "LogItem": {
        "$ref": "#/components/schemas/MessageSummary"
      },
      "MetricsResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "series": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/MetricsPoint"
                }
              },
              "totals": {
                "$ref": "#/components/schemas/MetricsTotals"
              }
            }
          }
        }
      },
      "MetricsPoint": {
        "type": "object",
        "properties": {
          "t": {
            "type": "string",
            "format": "date-time"
          },
          "total": {
            "type": "integer"
          },
          "processed": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "deferred": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "complained": {
            "type": "integer"
          }
        }
      },
      "MetricsTotals": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "processed": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "deferred": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "complained": {
            "type": "integer"
          }
        }
      },
      "OverviewResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "type": "object",
            "properties": {
              "timeWindow": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "to": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "totals": {
                "type": "object",
                "properties": {
                  "sent": {
                    "type": "integer"
                  },
                  "delivered": {
                    "type": "integer"
                  },
                  "bounced": {
                    "type": "integer"
                  },
                  "complained": {
                    "type": "integer"
                  }
                }
              },
              "rates": {
                "type": "object",
                "properties": {
                  "deliveryRate": {
                    "type": "number"
                  },
                  "bounceRate": {
                    "type": "number"
                  },
                  "complaintRate": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/MessageResource"
          }
        }
      },
      "Error": {
        "type": "object",
        "description": "Every error body on this API. Branch on `code` (case-sensitive, never changes once published); never on `error` or `message` text. Every code: https://docs.motorical.com/api-reference/errors",
        "required": [
          "success",
          "error",
          "code"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "code": {
            "type": "string",
            "description": "Stable machine code. New codes are lower snake_case; some older codes are upper case and stay that way. Catalogue: https://docs.motorical.com/api-reference/errors",
            "examples": [
              "api_key_required",
              "VALIDATION_ERROR",
              "rate_limited_block"
            ]
          },
          "error": {
            "type": "string",
            "description": "Short description, or the code itself on some routes. For display, not for branching."
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation. Can change."
          },
          "requestId": {
            "type": "string",
            "description": "Same value as the X-Request-Id response header."
          },
          "details": {
            "description": "Per-field problems on validation errors, or extra context."
          },
          "nextAction": {
            "type": "object",
            "description": "When present: what to do next, and whether a person must do it (humanRequired).",
            "additionalProperties": true
          },
          "retryAfterSeconds": {
            "type": "integer",
            "description": "On some 429 and 503 answers: seconds to wait. The Retry-After header carries the same value where set."
          }
        },
        "additionalProperties": true,
        "example": {
          "success": false,
          "code": "api_key_required",
          "error": "API key required for /v1/send",
          "message": "API key required for /v1/send: send Authorization: ApiKey mk_live_<prefix>_<secret> (or X-Api-Key), or an OAuth token with send:transactional",
          "requestId": "req_5f0c2a9d4b7e41c3a8e2f6b1"
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "Unique id of this request, on every response. Quote it to support. A safe caller-supplied X-Request-Id is echoed back.",
        "schema": {
          "type": "string"
        }
      }
    }
  },
  "x-motorical-error-codes": [
    "api_key_required",
    "invalid_api_key",
    "access_token_required",
    "invalid_access_token",
    "invalid_token_type",
    "authorization_revoked",
    "INVALID_TOKEN",
    "TOKEN_EXPIRED",
    "unauthorized",
    "missing_scope",
    "grant_mismatch",
    "delegation_grant_mismatch",
    "motor_block_not_authorized",
    "motor_block_not_owned",
    "motor_block_not_found",
    "motor_block_id_required",
    "motor_block_id_conflict",
    "no_motor_block_covered",
    "oauth_grant_inactive",
    "subscription_required",
    "account_suspended",
    "ACCOUNT_NOT_VERIFIED",
    "use_comms_api",
    "feature_not_enabled",
    "forbidden",
    "MISSING_TOKEN",
    "AUTH_ERROR",
    "MISSING_REFRESH_TOKEN",
    "INVALID_REFRESH_TOKEN",
    "PASSWORD_NOT_SET",
    "PASSWORD_SETUP_NOT_REQUIRED",
    "ACCOUNT_SUSPENDED",
    "SIGNS_IN_ELSEWHERE",
    "VERIFIED_NO_PASSWORD",
    "UNVERIFIED_TOKEN_REFRESHED",
    "UNVERIFIED_EXPIRING_SOON",
    "EMAIL_CODE_REQUIRED",
    "EMAIL_CODE_NOT_APPLICABLE",
    "EMAIL_CODE_RATE_LIMITED",
    "NO_MFA_FACTOR",
    "TOTP_ALREADY_ENABLED",
    "AUTH_RATE_LIMIT",
    "signup_handoff_rate_limit",
    "signup_handoff_status_rate_limit",
    "ACCESS_DENIED",
    "DNS_TOKEN_MISMATCH",
    "DNS_RECORD_NOT_FOUND",
    "DNS_VERIFICATION_FAILED",
    "EMAIL_REQUIRED",
    "INVALID_EMAIL",
    "DOMAIN_HAS_MOTOR_BLOCKS",
    "VALIDATION_ERROR",
    "MISSING_REQUIRED_FIELD",
    "DISALLOWED_HEADERS",
    "ILLEGAL_HEADER_CHARS",
    "conflicting_fields",
    "invalid_attachment",
    "invalid_email",
    "invalid_id",
    "invalid_smtp_code",
    "IDEMPOTENCY_KEY_REQUIRED",
    "IDEMPOTENCY_KEY_INVALID",
    "idempotency_key_conflict",
    "webhook_url_blocked",
    "bad_request",
    "unprocessable",
    "DOMAIN_DNS_INCOMPLETE",
    "recipient_suppressed",
    "content_policy_rejected",
    "attachment_too_large",
    "attachments_total_too_large",
    "too_many_attachments",
    "attachment_type_not_allowed",
    "attachments_not_allowed",
    "payload_too_large",
    "message_too_large",
    "gateway_reply_unreadable",
    "delivery_status_unknown",
    "temporarily_unavailable",
    "sandbox_outbound_locked",
    "sandbox_recipient_denied",
    "allowlist_full",
    "sandbox_monthly_limit",
    "sandbox_dns_unavailable",
    "domain_has_motor_block",
    "free_recipient_not_confirmed",
    "free_policy_unavailable",
    "own_address",
    "recipient_limit",
    "invalid_code",
    "expired",
    "email_send_failed",
    "rate_limited_block",
    "rate_limited_account",
    "rate_limited_warmup",
    "rate_limit_exceeded",
    "RATE_LIMIT_EXCEEDED",
    "RATE_LIMIT_ANONYMOUS",
    "rate_limited",
    "dryrun_rate_limited",
    "too_many_large_requests",
    "allowlist_request_rate_limit",
    "free_recipient_request_rate_limit",
    "NOT_FOUND",
    "not_found",
    "domain_not_found",
    "account_not_found",
    "user_not_found",
    "grant_not_found",
    "not_an_oauth_grant",
    "DUPLICATE_RESOURCE",
    "FOREIGN_KEY_ERROR",
    "conflict",
    "method_not_allowed",
    "INTERNAL_ERROR",
    "APPLICATION_ERROR",
    "SERVICE_UNAVAILABLE",
    "FILE_TOO_LARGE",
    "TOO_MANY_FILES",
    "internal_error",
    "bad_gateway",
    "service_unavailable",
    "gateway_timeout"
  ]
}
