{
    "openapi": "3.1.0",
    "info": {
        "title": "Outstamp API",
        "version": "2026-09-06",
        "summary": "A transactional email API built on Amazon SES, without the AWS operations.",
        "description": "Outstamp is a **server-side** email API. Never embed an API key in browser-delivered code.\n\nAcceptance is not delivery: a successful send returns `202` with an email id after the request\nis durably recorded. Delivery outcomes arrive as events."
    },
    "servers": [
        {
            "url": "https://api.outstamp.dev",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Emails"
        },
        {
            "name": "Domains"
        },
        {
            "name": "API keys"
        },
        {
            "name": "Webhooks"
        },
        {
            "name": "Suppressions"
        },
        {
            "name": "Usage"
        }
    ],
    "paths": {
        "/v1/emails": {
            "post": {
                "tags": [
                    "Emails"
                ],
                "summary": "Send an email",
                "description": "Returns 202 once the request and its idempotency decision are durably stored.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "schema": {
                            "type": "string",
                            "maxLength": 256,
                            "pattern": "^[A-Za-z0-9_.:-]{1,256}$"
                        },
                        "description": "Replaying the same key with the same body returns the original result."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SendRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Email"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "invalid_request_error — for example: invalid_cursor, invalid_idempotency_key, invalid_json",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "payload_too_large_error — for example: message_too_large, attachment_too_large, request_body_too_large",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limit_error — for example: api_rate_limit_exceeded, recipient_rate_limit_exceeded, daily_trust_limit_exceeded, monthly_plan_limit_exceeded, scheduled_backlog_limit_exceeded, attachment_bandwidth_exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "500": {
                        "description": "api_error — for example: internal_error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "service_unavailable_error — for example: project_provisioning, storage_unavailable, provider_unavailable",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Emails"
                ],
                "summary": "List emails",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "An opaque cursor from a previous next_cursor."
                    },
                    {
                        "name": "environment",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "test",
                                "live"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "recipient",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tag",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "until",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A page of emails",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "enum": [
                                                "list"
                                            ]
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Email"
                                            }
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        },
                                        "next_cursor": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "previous_cursor": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limit_error — for example: api_rate_limit_exceeded, recipient_rate_limit_exceeded, daily_trust_limit_exceeded, monthly_plan_limit_exceeded, scheduled_backlog_limit_exceeded, attachment_bandwidth_exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/emails/batch": {
            "post": {
                "tags": [
                    "Emails"
                ],
                "summary": "Send up to 100 emails",
                "description": "The whole batch is validated before anything is accepted. Returned ids preserve request order.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "emails"
                                ],
                                "properties": {
                                    "emails": {
                                        "type": "array",
                                        "minItems": 1,
                                        "maxItems": 100,
                                        "items": {
                                            "$ref": "#/components/schemas/SendRequest"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Accepted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "enum": [
                                                "list"
                                            ]
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Email"
                                            }
                                        },
                                        "has_more": {
                                            "type": "boolean"
                                        },
                                        "next_cursor": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "previous_cursor": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limit_error — for example: api_rate_limit_exceeded, recipient_rate_limit_exceeded, daily_trust_limit_exceeded, monthly_plan_limit_exceeded, scheduled_backlog_limit_exceeded, attachment_bandwidth_exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/emails/{email_id}": {
            "parameters": [
                {
                    "name": "email_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Emails"
                ],
                "summary": "Retrieve an email",
                "responses": {
                    "200": {
                        "description": "The email",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Email"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Emails"
                ],
                "summary": "Reschedule an email",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "scheduled_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rescheduled"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/emails/{email_id}/events": {
            "parameters": [
                {
                    "name": "email_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Emails"
                ],
                "summary": "Retrieve the event timeline",
                "responses": {
                    "200": {
                        "description": "Events"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/emails/{email_id}/cancel": {
            "parameters": [
                {
                    "name": "email_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Emails"
                ],
                "summary": "Cancel a scheduled email",
                "responses": {
                    "200": {
                        "description": "Cancelled"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/domains": {
            "post": {
                "tags": [
                    "Domains"
                ],
                "summary": "Add a sending domain",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "name"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "mail_from_domain": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Domains"
                ],
                "summary": "List domains",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "An opaque cursor from a previous next_cursor."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Domains"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/domains/{domain_id}": {
            "parameters": [
                {
                    "name": "domain_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Domains"
                ],
                "summary": "Retrieve a domain and its DNS records",
                "responses": {
                    "200": {
                        "description": "Domain"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Domains"
                ],
                "summary": "Update domain settings",
                "responses": {
                    "200": {
                        "description": "Updated"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Domains"
                ],
                "summary": "Delete a domain",
                "responses": {
                    "202": {
                        "description": "Deletion started"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/domains/{domain_id}/verify": {
            "parameters": [
                {
                    "name": "domain_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Domains"
                ],
                "summary": "Check the DNS records now",
                "responses": {
                    "200": {
                        "description": "Check queued"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limit_error — for example: api_rate_limit_exceeded, recipient_rate_limit_exceeded, daily_trust_limit_exceeded, monthly_plan_limit_exceeded, scheduled_backlog_limit_exceeded, attachment_bandwidth_exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/domains/{domain_id}/dns-host": {
            "parameters": [
                {
                    "name": "domain_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Domains"
                ],
                "summary": "The domain's DNS host and whether its records can be approved there in one step (Domain Connect). The apply URL is returned only to a credential that can change the domain.",
                "responses": {
                    "200": {
                        "description": "DNS host"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/api-keys": {
            "post": {
                "tags": [
                    "API keys"
                ],
                "summary": "Create a key. The secret is returned once and never again.",
                "responses": {
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limit_error — for example: api_rate_limit_exceeded, recipient_rate_limit_exceeded, daily_trust_limit_exceeded, monthly_plan_limit_exceeded, scheduled_backlog_limit_exceeded, attachment_bandwidth_exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "API keys"
                ],
                "summary": "List keys without their secrets",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "An opaque cursor from a previous next_cursor."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Keys"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/api-keys/{key_id}": {
            "parameters": [
                {
                    "name": "key_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "patch": {
                "tags": [
                    "API keys"
                ],
                "summary": "Rename or restrict a key",
                "responses": {
                    "200": {
                        "description": "Updated"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "API keys"
                ],
                "summary": "Revoke a key",
                "responses": {
                    "200": {
                        "description": "Revoked"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhooks": {
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Create an endpoint. The signing secret is returned once.",
                "responses": {
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "conflict_error — for example: idempotency_key_reused, idempotency_request_in_progress, domain_already_claimed, resource_locked, email_not_cancellable, already_exists",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "List endpoints",
                "responses": {
                    "200": {
                        "description": "Endpoints"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhooks/{webhook_id}": {
            "parameters": [
                {
                    "name": "webhook_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Retrieve an endpoint and its health",
                "responses": {
                    "200": {
                        "description": "Endpoint"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Update subscriptions or enabled state",
                "responses": {
                    "200": {
                        "description": "Updated"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Delete an endpoint",
                "responses": {
                    "200": {
                        "description": "Deleted"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhooks/{webhook_id}/test": {
            "parameters": [
                {
                    "name": "webhook_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Send a signed test event through the real pipeline",
                "responses": {
                    "200": {
                        "description": "Queued"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "rate_limit_error — for example: api_rate_limit_exceeded, recipient_rate_limit_exceeded, daily_trust_limit_exceeded, monthly_plan_limit_exceeded, scheduled_backlog_limit_exceeded, attachment_bandwidth_exceeded",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhooks/{webhook_id}/deliveries": {
            "parameters": [
                {
                    "name": "webhook_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "List delivery attempts",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "An opaque cursor from a previous next_cursor."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deliveries"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/webhook-events/{event_id}/replay": {
            "parameters": [
                {
                    "name": "event_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Replay a retained event",
                "description": "The event id and payload are preserved. A new delivery id is created and marked as a replay.",
                "responses": {
                    "200": {
                        "description": "Replayed"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/suppressions": {
            "post": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "Suppress an address",
                "responses": {
                    "201": {
                        "description": "Created"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "List suppressions",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "description": "An opaque cursor from a previous next_cursor."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Suppressions"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/suppressions/{suppression_id}": {
            "parameters": [
                {
                    "name": "suppression_id",
                    "in": "path",
                    "required": true,
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "Retrieve a suppression",
                "responses": {
                    "200": {
                        "description": "Suppression"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "Remove a suppression",
                "description": "Removing an automatic hard-bounce or complaint suppression requires confirm: true.",
                "responses": {
                    "200": {
                        "description": "Removed"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "not_found_error — for example: resource_not_found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "validation_error — for example: invalid_email_address, missing_required_field, recipient_limit_exceeded, missing_message_body, conflicting_body_fields, subject_too_long",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/usage": {
            "get": {
                "tags": [
                    "Usage"
                ],
                "summary": "Current usage and effective limits",
                "responses": {
                    "200": {
                        "description": "Usage"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/v1/metrics": {
            "get": {
                "tags": [
                    "Usage"
                ],
                "summary": "Aggregate delivery metrics",
                "responses": {
                    "200": {
                        "description": "Metrics"
                    },
                    "401": {
                        "description": "authentication_error — for example: missing_api_key, invalid_api_key, revoked_api_key, expired_session",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "permission_error — for example: step_up_required, insufficient_scope, environment_mismatch, domain_not_authorized, key_domain_restricted, project_paused",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "An API key: os_test_... or os_live_.... Server-side only."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "type",
                            "code",
                            "message",
                            "retryable",
                            "request_id"
                        ],
                        "properties": {
                            "type": {
                                "type": "string",
                                "enum": [
                                    "authentication_error",
                                    "permission_error",
                                    "invalid_request_error",
                                    "validation_error",
                                    "not_found_error",
                                    "conflict_error",
                                    "payload_too_large_error",
                                    "rate_limit_error",
                                    "method_not_allowed_error",
                                    "api_error",
                                    "service_unavailable_error"
                                ]
                            },
                            "code": {
                                "type": "string",
                                "enum": [
                                    "missing_api_key",
                                    "invalid_api_key",
                                    "revoked_api_key",
                                    "expired_session",
                                    "step_up_required",
                                    "insufficient_scope",
                                    "environment_mismatch",
                                    "domain_not_authorized",
                                    "key_domain_restricted",
                                    "project_paused",
                                    "mfa_required",
                                    "payment_method_required",
                                    "paid_plan_required",
                                    "operator_only",
                                    "invalid_email_address",
                                    "missing_required_field",
                                    "recipient_limit_exceeded",
                                    "missing_message_body",
                                    "conflicting_body_fields",
                                    "subject_too_long",
                                    "unsupported_internationalized_local_part",
                                    "invalid_header_name",
                                    "invalid_header_value",
                                    "protected_header",
                                    "invalid_tag_name",
                                    "invalid_tag_value",
                                    "too_many_tags",
                                    "prohibited_attachment_type",
                                    "attachment_scan_failed",
                                    "remote_attachment_not_supported",
                                    "invalid_scheduled_at",
                                    "batch_too_large",
                                    "batch_item_invalid",
                                    "invalid_domain",
                                    "invalid_webhook_url",
                                    "invalid_parameter",
                                    "invalid_cursor",
                                    "invalid_idempotency_key",
                                    "invalid_json",
                                    "message_too_large",
                                    "attachment_too_large",
                                    "request_body_too_large",
                                    "resource_not_found",
                                    "idempotency_key_reused",
                                    "idempotency_request_in_progress",
                                    "domain_already_claimed",
                                    "resource_locked",
                                    "email_not_cancellable",
                                    "already_exists",
                                    "plan_limit_reached",
                                    "api_rate_limit_exceeded",
                                    "recipient_rate_limit_exceeded",
                                    "daily_trust_limit_exceeded",
                                    "monthly_plan_limit_exceeded",
                                    "scheduled_backlog_limit_exceeded",
                                    "attachment_bandwidth_exceeded",
                                    "onboarding_send_limit_exceeded",
                                    "provider_capacity_exceeded",
                                    "project_provisioning",
                                    "storage_unavailable",
                                    "provider_unavailable",
                                    "method_not_allowed",
                                    "internal_error"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "parameter": {
                                "type": "string"
                            },
                            "request_id": {
                                "type": "string"
                            },
                            "retryable": {
                                "type": "boolean"
                            },
                            "docs_url": {
                                "type": "string",
                                "format": "uri"
                            },
                            "data": {
                                "type": "object",
                                "additionalProperties": true
                            }
                        }
                    }
                }
            },
            "SendRequest": {
                "type": "object",
                "required": [
                    "from",
                    "to",
                    "subject"
                ],
                "properties": {
                    "from": {
                        "type": "string",
                        "description": "In live, the domain must be verified for this project."
                    },
                    "to": {
                        "oneOf": [
                            {
                                "type": "string",
                                "description": "An address, optionally with a display name."
                            },
                            {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "maxItems": 50
                            }
                        ]
                    },
                    "cc": {
                        "oneOf": [
                            {
                                "type": "string",
                                "description": "An address, optionally with a display name."
                            },
                            {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "maxItems": 50
                            }
                        ]
                    },
                    "bcc": {
                        "oneOf": [
                            {
                                "type": "string",
                                "description": "An address, optionally with a display name."
                            },
                            {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "maxItems": 50
                            }
                        ],
                        "description": "Envelope-only. Never exposed to other recipients."
                    },
                    "reply_to": {
                        "oneOf": [
                            {
                                "type": "string",
                                "description": "An address, optionally with a display name."
                            },
                            {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "maxItems": 50
                            }
                        ]
                    },
                    "subject": {
                        "type": "string",
                        "maxLength": 998
                    },
                    "html": {
                        "type": "string"
                    },
                    "text": {
                        "type": "string",
                        "description": "Generated from html when omitted. An explicit empty string disables generation."
                    },
                    "headers": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    },
                    "tags": {
                        "type": "array",
                        "maxItems": 20,
                        "items": {
                            "type": "object",
                            "required": [
                                "name",
                                "value"
                            ],
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "value": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "attachments": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "filename"
                            ],
                            "properties": {
                                "filename": {
                                    "type": "string"
                                },
                                "content": {
                                    "type": "string",
                                    "description": "Base64. Provide this or asset_id."
                                },
                                "asset_id": {
                                    "type": "string"
                                },
                                "content_type": {
                                    "type": "string"
                                },
                                "content_id": {
                                    "type": "string",
                                    "description": "Set to reference the file inline from the HTML body."
                                }
                            }
                        }
                    },
                    "scheduled_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, between 1 minute and 30 days ahead."
                    },
                    "tracking": {
                        "type": "object",
                        "properties": {
                            "opens": {
                                "type": "boolean"
                            },
                            "clicks": {
                                "type": "boolean"
                            }
                        }
                    }
                }
            },
            "Email": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "em_2n4k8x1q7c5m9r3t6v0w2y4a"
                    },
                    "object": {
                        "type": "string",
                        "enum": [
                            "email"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "environment": {
                        "type": "string",
                        "enum": [
                            "test",
                            "live"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "recipient_counts": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer"
                        }
                    },
                    "recipient_count": {
                        "type": "integer"
                    },
                    "has_complaint": {
                        "type": "boolean"
                    },
                    "scheduled_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true
                    }
                }
            }
        },
        "headers": {
            "Outstamp-Request-Id": {
                "schema": {
                    "type": "string"
                },
                "description": "Unique id for this request. Include it in any support conversation."
            },
            "Outstamp-RateLimit-Remaining": {
                "schema": {
                    "type": "integer"
                }
            },
            "Retry-After": {
                "schema": {
                    "type": "integer"
                },
                "description": "Present on 429 and 503."
            }
        }
    },
    "x-outstamp-events": [
        {
            "type": "email.accepted",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "The API request was durably accepted. Not a delivery."
        },
        {
            "type": "email.scheduled",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "The email is waiting for its scheduled time."
        },
        {
            "type": "email.queued",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "The email was released to the dispatch queue."
        },
        {
            "type": "email.sent",
            "group": "email_lifecycle",
            "source": "ses",
            "description": "The provider accepted the message and will attempt delivery."
        },
        {
            "type": "email.delivered",
            "group": "email_lifecycle",
            "source": "ses",
            "description": "The recipient mail server accepted the message. Not proof of inbox placement."
        },
        {
            "type": "email.delivery_delayed",
            "group": "email_lifecycle",
            "source": "ses",
            "description": "A temporary delivery problem occurred; the provider may keep retrying."
        },
        {
            "type": "email.bounced",
            "group": "email_lifecycle",
            "source": "ses",
            "description": "Final delivery failure with a normalised bounce classification."
        },
        {
            "type": "email.complained",
            "group": "email_lifecycle",
            "source": "ses",
            "description": "The recipient or mailbox provider reported the message as spam."
        },
        {
            "type": "email.rejected",
            "group": "email_lifecycle",
            "source": "ses",
            "description": "The provider rejected the message content, including virus findings."
        },
        {
            "type": "email.failed",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "The message could not be submitted or rendered."
        },
        {
            "type": "email.suppressed",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "Sending was skipped because the address is suppressed."
        },
        {
            "type": "email.canceled",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "A scheduled email was cancelled before dispatch."
        },
        {
            "type": "email.submission_unknown",
            "group": "email_lifecycle",
            "source": "outstamp",
            "description": "Provider acceptance could not be determined safely."
        },
        {
            "type": "email.opened",
            "group": "engagement",
            "source": "ses",
            "description": "A tracking pixel was loaded. Approximate; not proof of human reading."
        },
        {
            "type": "email.clicked",
            "group": "engagement",
            "source": "ses",
            "description": "A tracked link was requested. Automated scanners can create these."
        },
        {
            "type": "domain.created",
            "group": "domain",
            "source": "outstamp",
            "description": "A domain was accepted and provider provisioning started."
        },
        {
            "type": "domain.status_changed",
            "group": "domain",
            "source": "outstamp",
            "description": "Domain, DKIM or MAIL FROM status changed."
        },
        {
            "type": "domain.deleted",
            "group": "domain",
            "source": "outstamp",
            "description": "Provider cleanup for the domain completed."
        },
        {
            "type": "suppression.created",
            "group": "suppression",
            "source": "outstamp",
            "description": "A suppression was created manually or automatically."
        },
        {
            "type": "suppression.deleted",
            "group": "suppression",
            "source": "outstamp",
            "description": "An authorised suppression removal completed."
        },
        {
            "type": "project.quota_warning",
            "group": "project",
            "source": "outstamp",
            "description": "A usage or trust threshold was crossed."
        },
        {
            "type": "project.reputation_warning",
            "group": "project",
            "source": "outstamp",
            "description": "Reputation entered watch or worse."
        },
        {
            "type": "project.sending_paused",
            "group": "project",
            "source": "outstamp",
            "description": "Sending was blocked by Outstamp or by AWS."
        },
        {
            "type": "project.sending_resumed",
            "group": "project",
            "source": "outstamp",
            "description": "Sending was restored."
        }
    ],
    "x-outstamp-errors": [
        {
            "code": "missing_api_key",
            "type": "authentication_error",
            "status": 401,
            "retryable": false,
            "message": "No API key was provided. Send it as an Authorization: Bearer header."
        },
        {
            "code": "invalid_api_key",
            "type": "authentication_error",
            "status": 401,
            "retryable": false,
            "message": "The API key is invalid."
        },
        {
            "code": "revoked_api_key",
            "type": "authentication_error",
            "status": 401,
            "retryable": false,
            "message": "This API key has been revoked."
        },
        {
            "code": "expired_session",
            "type": "authentication_error",
            "status": 401,
            "retryable": false,
            "message": "Your session has expired. Sign in again."
        },
        {
            "code": "step_up_required",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "This action requires you to confirm your password again."
        },
        {
            "code": "insufficient_scope",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "This API key does not have the required permission."
        },
        {
            "code": "environment_mismatch",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "This key belongs to a different environment than the resource it addressed."
        },
        {
            "code": "domain_not_authorized",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "The sender domain is not verified for this project."
        },
        {
            "code": "key_domain_restricted",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "This API key is restricted to other domains."
        },
        {
            "code": "project_paused",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "Sending is paused for this project."
        },
        {
            "code": "mfa_required",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "This workspace requires multi-factor authentication."
        },
        {
            "code": "payment_method_required",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "Add a payment method to enable live sending on the free plan."
        },
        {
            "code": "paid_plan_required",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "Your free allowance is used by another account you own. Choose a paid plan to send live from this one."
        },
        {
            "code": "operator_only",
            "type": "permission_error",
            "status": 403,
            "retryable": false,
            "message": "This endpoint requires operator access."
        },
        {
            "code": "invalid_email_address",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The email address is not valid."
        },
        {
            "code": "missing_required_field",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "A required field is missing."
        },
        {
            "code": "recipient_limit_exceeded",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "A single email may address at most 50 recipients across to, cc and bcc."
        },
        {
            "code": "missing_message_body",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "Provide html, text or a published template."
        },
        {
            "code": "conflicting_body_fields",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "A template cannot be combined with html or text."
        },
        {
            "code": "subject_too_long",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The subject exceeds the maximum length."
        },
        {
            "code": "unsupported_internationalized_local_part",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "Internationalized local parts are not supported."
        },
        {
            "code": "invalid_header_name",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The header name is not valid."
        },
        {
            "code": "invalid_header_value",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The header value is not valid."
        },
        {
            "code": "protected_header",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "This header is managed by Outstamp and cannot be set."
        },
        {
            "code": "invalid_tag_name",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The tag name is not valid."
        },
        {
            "code": "invalid_tag_value",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The tag value is not valid."
        },
        {
            "code": "too_many_tags",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "Too many tags on one email."
        },
        {
            "code": "prohibited_attachment_type",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "This attachment type is not allowed."
        },
        {
            "code": "attachment_scan_failed",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The attachment could not be scanned or failed the malware check."
        },
        {
            "code": "remote_attachment_not_supported",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "Remote attachment URLs are not supported."
        },
        {
            "code": "invalid_scheduled_at",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "scheduled_at must be an RFC 3339 timestamp between 1 minute and 30 days in the future."
        },
        {
            "code": "batch_too_large",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "A batch may contain at most 100 emails."
        },
        {
            "code": "batch_item_invalid",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "One or more emails in the batch failed validation."
        },
        {
            "code": "invalid_domain",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The domain name is not valid."
        },
        {
            "code": "invalid_webhook_url",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "The webhook URL must be a public HTTPS endpoint."
        },
        {
            "code": "invalid_parameter",
            "type": "validation_error",
            "status": 422,
            "retryable": false,
            "message": "A parameter is not valid."
        },
        {
            "code": "invalid_cursor",
            "type": "invalid_request_error",
            "status": 400,
            "retryable": false,
            "message": "The pagination cursor is not valid."
        },
        {
            "code": "invalid_idempotency_key",
            "type": "invalid_request_error",
            "status": 400,
            "retryable": false,
            "message": "The Idempotency-Key header is not valid."
        },
        {
            "code": "invalid_json",
            "type": "invalid_request_error",
            "status": 400,
            "retryable": false,
            "message": "The request body is not valid JSON."
        },
        {
            "code": "message_too_large",
            "type": "payload_too_large_error",
            "status": 413,
            "retryable": false,
            "message": "The encoded message exceeds 40 MB."
        },
        {
            "code": "attachment_too_large",
            "type": "payload_too_large_error",
            "status": 413,
            "retryable": false,
            "message": "The attachment is too large."
        },
        {
            "code": "request_body_too_large",
            "type": "payload_too_large_error",
            "status": 413,
            "retryable": false,
            "message": "The request body is too large."
        },
        {
            "code": "resource_not_found",
            "type": "not_found_error",
            "status": 404,
            "retryable": false,
            "message": "No such resource in this scope."
        },
        {
            "code": "idempotency_key_reused",
            "type": "conflict_error",
            "status": 409,
            "retryable": false,
            "message": "This idempotency key was already used with a different request body."
        },
        {
            "code": "idempotency_request_in_progress",
            "type": "conflict_error",
            "status": 409,
            "retryable": true,
            "message": "A request with this idempotency key is still in progress."
        },
        {
            "code": "domain_already_claimed",
            "type": "conflict_error",
            "status": 409,
            "retryable": false,
            "message": "This domain, or an overlapping parent or child domain, is already in use."
        },
        {
            "code": "resource_locked",
            "type": "conflict_error",
            "status": 409,
            "retryable": false,
            "message": "The resource is being modified. Try again."
        },
        {
            "code": "email_not_cancellable",
            "type": "conflict_error",
            "status": 409,
            "retryable": false,
            "message": "This email can no longer be cancelled."
        },
        {
            "code": "already_exists",
            "type": "conflict_error",
            "status": 409,
            "retryable": false,
            "message": "The resource already exists."
        },
        {
            "code": "plan_limit_reached",
            "type": "conflict_error",
            "status": 409,
            "retryable": false,
            "message": "Your plan's limit for this resource has been reached."
        },
        {
            "code": "api_rate_limit_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "Too many API requests. Slow down and retry."
        },
        {
            "code": "recipient_rate_limit_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "Recipient send rate exceeded for this project."
        },
        {
            "code": "daily_trust_limit_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "The rolling 24-hour sending limit for this project has been reached."
        },
        {
            "code": "monthly_plan_limit_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "The monthly recipient allowance for this plan has been used."
        },
        {
            "code": "scheduled_backlog_limit_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "Too many scheduled emails are outstanding."
        },
        {
            "code": "attachment_bandwidth_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "The attachment bandwidth allowance has been used."
        },
        {
            "code": "onboarding_send_limit_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "The daily onboarding email limit for this workspace has been reached."
        },
        {
            "code": "provider_capacity_exceeded",
            "type": "rate_limit_error",
            "status": 429,
            "retryable": true,
            "message": "Sending capacity is temporarily unavailable."
        },
        {
            "code": "project_provisioning",
            "type": "service_unavailable_error",
            "status": 503,
            "retryable": true,
            "message": "This project is still being provisioned. Try again shortly."
        },
        {
            "code": "storage_unavailable",
            "type": "service_unavailable_error",
            "status": 503,
            "retryable": true,
            "message": "The request could not be durably recorded. No email was created. Retry."
        },
        {
            "code": "provider_unavailable",
            "type": "service_unavailable_error",
            "status": 503,
            "retryable": true,
            "message": "The sending provider is temporarily unavailable."
        },
        {
            "code": "method_not_allowed",
            "type": "method_not_allowed_error",
            "status": 405,
            "retryable": false,
            "message": "This method is not supported on this endpoint."
        },
        {
            "code": "internal_error",
            "type": "api_error",
            "status": 500,
            "retryable": true,
            "message": "An unexpected error occurred."
        }
    ],
    "x-outstamp-id-prefixes": {
        "user": "usr",
        "workspace": "ws",
        "membership": "mem",
        "project": "prj",
        "domain": "dom",
        "dns_record": "dns",
        "api_key": "key",
        "email": "em",
        "delivery": "dlv",
        "event": "evt",
        "webhook_endpoint": "whk",
        "webhook_delivery": "whd",
        "webhook_attempt": "wha",
        "suppression": "sup",
        "request": "req",
        "asset": "ast",
        "export": "exp",
        "session": "ses",
        "passkey": "pkey",
        "notification": "ntf",
        "shard": "shd",
        "binding": "bnd",
        "risk_case": "case",
        "audit": "aud",
        "usage": "usg",
        "idempotency": "idm",
        "claim": "clm"
    }
}
