{
    "openapi": "3.1.0",
    "info": {
        "title": "tweak.email API",
        "version": "1.0.0",
        "description": "REST API for contacts, campaigns, sending, reporting, and AI copy tooling.\n\nAll collection endpoints are cursor-paginated: pass the `next_cursor` from a response as `?cursor=` to fetch the following page, and stop when `has_more` is false.\n\nUnsafe requests accept an `Idempotency-Key` header; a retry presenting the same key replays the original response instead of executing twice.",
        "contact": {
            "url": "http://tweak.email/api"
        }
    },
    "servers": [
        {
            "url": "http://tweak.email/api/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Identity",
            "description": "Who the presented key belongs to"
        },
        {
            "name": "Contacts",
            "description": "Contacts, lists, tags, and segments"
        },
        {
            "name": "Campaigns",
            "description": "Campaign authoring and sending"
        },
        {
            "name": "Reporting",
            "description": "Delivery events and campaign performance"
        },
        {
            "name": "Templates",
            "description": "Reusable email templates"
        },
        {
            "name": "Sequences",
            "description": "Automated sequences and enrolment"
        },
        {
            "name": "Waitlists",
            "description": "Waitlists and signups"
        },
        {
            "name": "Suppressions",
            "description": "The do-not-mail list"
        },
        {
            "name": "Transactional",
            "description": "One-off transactional sending"
        },
        {
            "name": "AI",
            "description": "Copy polish, subject lines, and deliverability scoring"
        },
        {
            "name": "Webhooks",
            "description": "Outbound event subscriptions"
        },
        {
            "name": "API keys",
            "description": "Credential management"
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "tags": [
                    "Identity"
                ],
                "summary": "Describe the presented credential",
                "operationId": "identityDescribeThePresentedCredential",
                "description": "Returns the owning team, the key's scopes, and the applicable rate limit.",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MeResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/contacts": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "List contacts",
                "operationId": "contactsListContacts",
                "description": "Cursor-paginated. Filterable by status, tag, list, segment, and modification time.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by contact status.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "pending",
                                "unsubscribed",
                                "bounced"
                            ]
                        }
                    },
                    {
                        "name": "tag_id",
                        "in": "query",
                        "required": false,
                        "description": "Only contacts carrying this tag.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "list_id",
                        "in": "query",
                        "required": false,
                        "description": "Only contacts on this list.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "segment_id",
                        "in": "query",
                        "required": false,
                        "description": "Only contacts matching this saved segment.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 timestamp. Only contacts modified since. Use this to run an incremental sync.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "description": "Comma-separated relations to embed: tags, lists.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Create or update a contact",
                "operationId": "contactsCreateOrUpdateAContact",
                "description": "Upserts on email address. An existing contact that has unsubscribed or bounced keeps that status regardless of what is sent. Use `status_if_new` to control only what a brand-new contact is created as.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ContactUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/contacts/bulk": {
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Bulk upsert contacts",
                "operationId": "contactsBulkUpsertContacts",
                "description": "Up to 1,000 per call. Returns a per-row result so a partial success is legible.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ContactBulk"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactBulkResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/contacts/{contact}": {
            "parameters": [
                {
                    "name": "contact",
                    "in": "path",
                    "required": true,
                    "description": "Contact id, or the contact's email address.",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Fetch a contact",
                "operationId": "contactsFetchAContact",
                "description": "Accepts either a numeric id or an email address.",
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Update a contact",
                "operationId": "contactsUpdateAContact",
                "description": "Setting `status` to `unsubscribed` also creates a suppression; setting it back to `active` lifts only the unsubscribe suppression, never a bounce or complaint.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ContactUpdate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Delete a contact",
                "operationId": "contactsDeleteAContact",
                "description": "Soft delete. For GDPR erasure use the erase endpoint instead.",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/contacts/{contact}/tags": {
            "parameters": [
                {
                    "name": "contact",
                    "in": "path",
                    "required": true,
                    "description": "Contact id or email address.",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Add tags to a contact",
                "operationId": "contactsAddTagsToAContact",
                "description": "Adding a tag fires any tag-triggered sequence enrolment, exactly as it does in the app.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TagIds"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/contacts/{contact}/tags/{tag}": {
            "parameters": [
                {
                    "name": "contact",
                    "in": "path",
                    "required": true,
                    "description": "Contact id or email address.",
                    "schema": {
                        "type": "string"
                    }
                },
                {
                    "name": "tag",
                    "in": "path",
                    "required": true,
                    "description": "Tag id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "delete": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Remove a tag from a contact",
                "operationId": "contactsRemoveATagFromAContact",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/contacts/{contact}/erase": {
            "parameters": [
                {
                    "name": "contact",
                    "in": "path",
                    "required": true,
                    "description": "Contact id or email address.",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Erase a contact (GDPR Art. 17)",
                "operationId": "contactsEraseAContactGDPRArt17",
                "description": "Permanently removes the contact and anonymises their delivery events. The suppression record is deliberately retained so an erased opt-out is never lost.",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EraseResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/lists": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "List contact lists",
                "operationId": "contactsListContactLists",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Create a contact list",
                "operationId": "contactsCreateAContactList",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ListUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/lists/{list}": {
            "parameters": [
                {
                    "name": "list",
                    "in": "path",
                    "required": true,
                    "description": "List id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Fetch a list",
                "operationId": "contactsFetchAList",
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Update a list",
                "operationId": "contactsUpdateAList",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ListUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ListResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Delete a list",
                "operationId": "contactsDeleteAList",
                "description": "The default list cannot be deleted.",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/lists/{list}/contacts": {
            "parameters": [
                {
                    "name": "list",
                    "in": "path",
                    "required": true,
                    "description": "List id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "List the contacts on a list",
                "operationId": "contactsListTheContactsOnAList",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContactCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Attach contacts to a list",
                "operationId": "contactsAttachContactsToAList",
                "description": "Ids belonging to another team are silently skipped and reported in the `skipped` count.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ContactIds"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AttachResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/lists/{list}/contacts/{contact}": {
            "parameters": [
                {
                    "name": "list",
                    "in": "path",
                    "required": true,
                    "description": "List id.",
                    "schema": {
                        "type": "integer"
                    }
                },
                {
                    "name": "contact",
                    "in": "path",
                    "required": true,
                    "description": "Contact id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "delete": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Remove a contact from a list",
                "operationId": "contactsRemoveAContactFromAList",
                "description": "Detaches the membership only. The contact itself is untouched.",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DetachResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/tags": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "List tags",
                "operationId": "contactsListTags",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TagCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Create a tag",
                "operationId": "contactsCreateATag",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TagUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TagResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/tags/{tag}": {
            "parameters": [
                {
                    "name": "tag",
                    "in": "path",
                    "required": true,
                    "description": "Tag id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Fetch a tag",
                "operationId": "contactsFetchATag",
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TagResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Update a tag",
                "operationId": "contactsUpdateATag",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TagUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TagResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Delete a tag",
                "operationId": "contactsDeleteATag",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/segments": {
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "List segments",
                "operationId": "contactsListSegments",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SegmentCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Create a segment",
                "operationId": "contactsCreateASegment",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SegmentUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SegmentResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/segments/preview": {
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Preview an unsaved segment definition",
                "operationId": "contactsPreviewAnUnsavedSegmentDefinition",
                "description": "Read-only. Returns the resolved contact count plus a 10-record sample, so a definition can be iterated on before it is committed.",
                "x-required-scope": "contacts:read",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SegmentDefinition"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SegmentPreviewResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/segments/{segment}": {
            "parameters": [
                {
                    "name": "segment",
                    "in": "path",
                    "required": true,
                    "description": "Segment id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Fetch a segment",
                "operationId": "contactsFetchASegment",
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SegmentResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Update a segment",
                "operationId": "contactsUpdateASegment",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SegmentUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SegmentResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Delete a segment",
                "operationId": "contactsDeleteASegment",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/segments/{segment}/preview": {
            "parameters": [
                {
                    "name": "segment",
                    "in": "path",
                    "required": true,
                    "description": "Segment id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Contacts"
                ],
                "summary": "Preview a saved segment",
                "operationId": "contactsPreviewASavedSegment",
                "description": "Read-only: resolved count plus a sample.",
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SegmentPreviewResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns": {
            "get": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "List campaigns",
                "operationId": "campaignsListCampaigns",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by campaign status.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Create a campaign",
                "operationId": "campaignsCreateACampaign",
                "description": "Created as a draft. Set the body separately via the content endpoint.",
                "x-required-scope": "campaigns:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CampaignUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Fetch a campaign",
                "operationId": "campaignsFetchACampaign",
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Update a campaign",
                "operationId": "campaignsUpdateACampaign",
                "description": "Refused with 422 once the campaign is screening, sending, or sent.",
                "x-required-scope": "campaigns:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CampaignUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Delete a campaign",
                "operationId": "campaignsDeleteACampaign",
                "x-required-scope": "campaigns:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/content": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "put": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Set campaign content",
                "operationId": "campaignsSetCampaignContent",
                "description": "Supplying `template_id` copies that template's body in, so a later edit to the template cannot change a campaign somebody already reviewed.",
                "x-required-scope": "campaigns:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CampaignContent"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/variants": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Replace the A/B variant set",
                "operationId": "campaignsReplaceTheABVariantSet",
                "description": "Variants are replaced wholesale, and A/B testing is switched on.",
                "x-required-scope": "campaigns:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CampaignVariants"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VariantCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/preflight": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Dry-run the send checks",
                "operationId": "campaignsDryRunTheSendChecks",
                "description": "Read-only. Returns every reason a send would currently be refused, plus the estimated recipient count.",
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PreflightResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/send": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Send a campaign",
                "operationId": "campaignsSendACampaign",
                "description": "Hands the campaign to abuse screening, which releases it to the send pipeline. Returns 422 with a `blockers` array if any send gate fails.\n\nSend an `Idempotency-Key` header: a retried send is the one mistake in this API that cannot be undone.",
                "x-required-scope": "campaigns:send",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/schedule": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Schedule a campaign",
                "operationId": "campaignsScheduleACampaign",
                "description": "Runs the same gates as an immediate send.",
                "x-required-scope": "campaigns:send",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CampaignSchedule"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/cancel": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Cancel a campaign",
                "operationId": "campaignsCancelACampaign",
                "description": "Only a draft, scheduled, or paused campaign can be cancelled: once chunks are dispatched the messages are already gone.",
                "x-required-scope": "campaigns:send",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CampaignResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/test": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Campaigns"
                ],
                "summary": "Send test messages",
                "operationId": "campaignsSendTestMessages",
                "description": "Up to 5 addresses. Counts against the plan's email allowance, because these are real sends.",
                "x-required-scope": "campaigns:send",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TestSend"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TestSendResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/report": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Campaign performance",
                "operationId": "reportingCampaignPerformance",
                "description": "Opens exclude machine/bot opens (Apple MPP), so the rates reflect human engagement.",
                "x-required-scope": "events:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ReportResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/report/links": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Per-link click breakdown",
                "operationId": "reportingPerLinkClickBreakdown",
                "x-required-scope": "events:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/LinkReportResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/report/variants": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Per-variant A/B results",
                "operationId": "reportingPerVariantABResults",
                "x-required-scope": "events:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/VariantCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/campaigns/{campaign}/recipients": {
            "parameters": [
                {
                    "name": "campaign",
                    "in": "path",
                    "required": true,
                    "description": "Campaign id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Per-recipient delivery detail",
                "operationId": "reportingPerRecipientDeliveryDetail",
                "description": "Who received the campaign and whether they opened or clicked.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "filter",
                        "in": "query",
                        "required": false,
                        "description": "Narrow to a delivery outcome.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "all",
                                "opened",
                                "clicked",
                                "bounced",
                                "pending",
                                "sent"
                            ]
                        }
                    }
                ],
                "x-required-scope": "events:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/RecipientCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/events": {
            "get": {
                "tags": [
                    "Reporting"
                ],
                "summary": "List delivery events",
                "operationId": "reportingListDeliveryEvents",
                "description": "The read side of the event pipeline, bounded by a 180-day retention window. Machine opens are excluded unless explicitly requested.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "required": false,
                        "description": "Filter by event type.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "delivered",
                                "bounced",
                                "deferred",
                                "dropped",
                                "spam_report",
                                "unsubscribed",
                                "opened",
                                "clicked",
                                "queued",
                                "sent"
                            ]
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": false,
                        "description": "Filter by recipient address.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "campaign_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by campaign.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "contact_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by contact.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "since",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 lower bound.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "until",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 upper bound.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "include_machine_opens",
                        "in": "query",
                        "required": false,
                        "description": "Include Apple MPP and bot prefetch opens.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "x-required-scope": "events:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EventCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Reporting"
                ],
                "summary": "Ingest delivery events",
                "operationId": "reportingIngestDeliveryEvents",
                "description": "Up to 1,000 per call. Events flow through the same pipeline as provider webhooks: campaign stats update, suppressions are created, contact statuses sync.",
                "x-required-scope": "events:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/EventIngest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EventIngestResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/templates": {
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "List templates",
                "operationId": "templatesListTemplates",
                "description": "Includes the platform's system starter templates alongside your own.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "Which templates to return.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "all",
                                "system",
                                "team"
                            ]
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Filter by category.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Templates"
                ],
                "summary": "Create a template",
                "operationId": "templatesCreateATemplate",
                "x-required-scope": "campaigns:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TemplateUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/templates/{template}": {
            "parameters": [
                {
                    "name": "template",
                    "in": "path",
                    "required": true,
                    "description": "Template id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Templates"
                ],
                "summary": "Fetch a template",
                "operationId": "templatesFetchATemplate",
                "description": "Unlike the listing, this includes the full body.",
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Templates"
                ],
                "summary": "Update a template",
                "operationId": "templatesUpdateATemplate",
                "description": "System templates cannot be modified.",
                "x-required-scope": "campaigns:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TemplateUpsert"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TemplateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Templates"
                ],
                "summary": "Delete a template",
                "operationId": "templatesDeleteATemplate",
                "x-required-scope": "campaigns:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sequences": {
            "get": {
                "tags": [
                    "Sequences"
                ],
                "summary": "List sequences",
                "operationId": "sequencesListSequences",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SequenceCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sequences/{sequence}": {
            "parameters": [
                {
                    "name": "sequence",
                    "in": "path",
                    "required": true,
                    "description": "Sequence id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Sequences"
                ],
                "summary": "Fetch a sequence",
                "operationId": "sequencesFetchASequence",
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SequenceResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sequences/{sequence}/subscribers": {
            "parameters": [
                {
                    "name": "sequence",
                    "in": "path",
                    "required": true,
                    "description": "Sequence id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Sequences"
                ],
                "summary": "List subscribers",
                "operationId": "sequencesListSubscribers",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "campaigns:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SubscriberCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Sequences"
                ],
                "summary": "Enrol contacts",
                "operationId": "sequencesEnrolContacts",
                "description": "Accepts contact ids or email addresses. This is how you trigger onboarding from your own signup flow.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SequenceEnrol"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EnrolResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/sequences/{sequence}/subscribers/{contact}": {
            "parameters": [
                {
                    "name": "sequence",
                    "in": "path",
                    "required": true,
                    "description": "Sequence id.",
                    "schema": {
                        "type": "integer"
                    }
                },
                {
                    "name": "contact",
                    "in": "path",
                    "required": true,
                    "description": "Contact id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "delete": {
                "tags": [
                    "Sequences"
                ],
                "summary": "Remove a contact from a sequence",
                "operationId": "sequencesRemoveAContactFromASequence",
                "description": "Stops any pending steps. `removed` is false when the contact was not enrolled.",
                "x-required-scope": "contacts:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UnenrolResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/waitlists": {
            "get": {
                "tags": [
                    "Waitlists"
                ],
                "summary": "List waitlists",
                "operationId": "waitlistsListWaitlists",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WaitlistCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/waitlists/{waitlist}": {
            "parameters": [
                {
                    "name": "waitlist",
                    "in": "path",
                    "required": true,
                    "description": "Waitlist id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Waitlists"
                ],
                "summary": "Fetch a waitlist",
                "operationId": "waitlistsFetchAWaitlist",
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WaitlistResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/waitlists/{waitlist}/signups": {
            "parameters": [
                {
                    "name": "waitlist",
                    "in": "path",
                    "required": true,
                    "description": "Waitlist id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Waitlists"
                ],
                "summary": "List signups",
                "operationId": "waitlistsListSignups",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "contacts:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignupCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Waitlists"
                ],
                "summary": "Add a signup",
                "operationId": "waitlistsAddASignup",
                "description": "Queue position is assigned server-side.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WaitlistSignupCreate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SignupResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/waitlists/{waitlist}/invite": {
            "parameters": [
                {
                    "name": "waitlist",
                    "in": "path",
                    "required": true,
                    "description": "Waitlist id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Waitlists"
                ],
                "summary": "Invite signups",
                "operationId": "waitlistsInviteSignups",
                "description": "Either specific ids, or `count` to take the next N from the front of the queue.",
                "x-required-scope": "contacts:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WaitlistInvite"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/InviteResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/suppressions": {
            "get": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "List suppressions",
                "operationId": "suppressionsListSuppressions",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    },
                    {
                        "name": "reason",
                        "in": "query",
                        "required": false,
                        "description": "Filter by reason.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "hard_bounce",
                                "soft_bounce",
                                "spam_report",
                                "unsubscribe",
                                "manual"
                            ]
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": false,
                        "description": "Exact address match.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "x-required-scope": "suppressions:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SuppressionCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "Add a suppression",
                "operationId": "suppressionsAddASuppression",
                "description": "Upserts on address.",
                "x-required-scope": "suppressions:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SuppressionCreate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SuppressionResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Suppressions"
                ],
                "summary": "Remove a suppression",
                "operationId": "suppressionsRemoveASuppression",
                "description": "The address becomes eligible for future sends.",
                "x-required-scope": "suppressions:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/SuppressionDelete"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StatusResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/send": {
            "post": {
                "tags": [
                    "Transactional"
                ],
                "summary": "Send a transactional message",
                "operationId": "transactionalSendATransactionalMessage",
                "description": "Honours suppressions, sender-domain verification, and the plan's email allowance. Platform-wide suppressions (confirmed hard bounces and complaints) cannot be bypassed.",
                "x-required-scope": "transactional:send",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TransactionalSend"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/TransactionalResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/ai/polish": {
            "post": {
                "tags": [
                    "AI"
                ],
                "summary": "Polish email copy",
                "operationId": "aIPolishEmailCopy",
                "description": "Rewrites for a requested tone and goal, and returns concrete suggestions plus a quality score. Counts against the plan's monthly AI allowance.",
                "x-required-scope": "ai:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AiPolish"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiPolishResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/ai/subject-lines": {
            "post": {
                "tags": [
                    "AI"
                ],
                "summary": "Generate and score subject lines",
                "operationId": "aIGenerateAndScoreSubjectLines",
                "description": "Set `use_history` to ground the scoring in this team's own historical open rates rather than generic heuristics.",
                "x-required-scope": "ai:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AiSubject"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiSubjectResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/ai/deliverability": {
            "post": {
                "tags": [
                    "AI"
                ],
                "summary": "Score a message for deliverability",
                "operationId": "aIScoreAMessageForDeliverability",
                "description": "Returns a spam score, specific issues, and a pass/warn/fail verdict. Useful as a pre-send check in CI.",
                "x-required-scope": "ai:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/AiDeliverability"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiDeliverabilityResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/ai/usage": {
            "get": {
                "tags": [
                    "AI"
                ],
                "summary": "Remaining AI and email allowance",
                "operationId": "aIRemainingAIAndEmailAllowance",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AiUsageResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "List webhook endpoints",
                "operationId": "webhooksListWebhookEndpoints",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "webhooks:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Create a webhook endpoint",
                "operationId": "webhooksCreateAWebhookEndpoint",
                "description": "The response is the only time the signing secret is returned. Payloads are signed as `Tweak-Signature: t={timestamp},v1={hmac}` where the HMAC is SHA-256 over `{timestamp}.{raw body}`.",
                "x-required-scope": "webhooks:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookCreate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/event-types": {
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "List subscribable event types",
                "operationId": "webhooksListSubscribableEventTypes",
                "x-required-scope": "webhooks:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EventTypeCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}": {
            "parameters": [
                {
                    "name": "endpoint",
                    "in": "path",
                    "required": true,
                    "description": "Webhook endpoint id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Fetch a webhook endpoint",
                "operationId": "webhooksFetchAWebhookEndpoint",
                "x-required-scope": "webhooks:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "patch": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Update a webhook endpoint",
                "operationId": "webhooksUpdateAWebhookEndpoint",
                "x-required-scope": "webhooks:write",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/WebhookUpdate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Delete a webhook endpoint",
                "operationId": "webhooksDeleteAWebhookEndpoint",
                "x-required-scope": "webhooks:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeletedResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}/deliveries": {
            "parameters": [
                {
                    "name": "endpoint",
                    "in": "path",
                    "required": true,
                    "description": "Webhook endpoint id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Delivery history",
                "operationId": "webhooksDeliveryHistory",
                "description": "What was sent and what your endpoint answered, for debugging.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "x-required-scope": "webhooks:read",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/DeliveryCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}/test": {
            "parameters": [
                {
                    "name": "endpoint",
                    "in": "path",
                    "required": true,
                    "description": "Webhook endpoint id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Send a test event",
                "operationId": "webhooksSendATestEvent",
                "description": "Lets you verify signature checking without provoking a real bounce.",
                "x-required-scope": "webhooks:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StatusResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/webhooks/{endpoint}/rotate-secret": {
            "parameters": [
                {
                    "name": "endpoint",
                    "in": "path",
                    "required": true,
                    "description": "Webhook endpoint id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "post": {
                "tags": [
                    "Webhooks"
                ],
                "summary": "Rotate the signing secret",
                "operationId": "webhooksRotateTheSigningSecret",
                "description": "Returns the new secret once.",
                "x-required-scope": "webhooks:write",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/WebhookResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/api-keys": {
            "get": {
                "tags": [
                    "API keys"
                ],
                "summary": "List API keys",
                "operationId": "aPIKeysListAPIKeys",
                "description": "Secrets are never returned; only a masked prefix.",
                "parameters": [
                    {
                        "$ref": "#/components/parameters/PerPage"
                    },
                    {
                        "$ref": "#/components/parameters/Cursor"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiKeyCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            },
            "post": {
                "tags": [
                    "API keys"
                ],
                "summary": "Mint an API key",
                "operationId": "aPIKeysMintAnAPIKey",
                "description": "The secret is returned exactly once. A key cannot grant scopes it does not itself hold.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiKeyCreate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiKeyCreateResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/api-keys/scopes": {
            "get": {
                "tags": [
                    "API keys"
                ],
                "summary": "List available scopes",
                "operationId": "aPIKeysListAvailableScopes",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScopeCollection"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        },
        "/api-keys/{key}": {
            "parameters": [
                {
                    "name": "key",
                    "in": "path",
                    "required": true,
                    "description": "API key id.",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "delete": {
                "tags": [
                    "API keys"
                ],
                "summary": "Revoke an API key",
                "operationId": "aPIKeysRevokeAnAPIKey",
                "description": "Revoked rather than deleted, so the audit record survives.",
                "responses": {
                    "200": {
                        "description": "Success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/StatusResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Your API key, as `Authorization: Bearer lt_...`. The `X-Api-Key` header is also accepted."
            }
        },
        "parameters": {
            "PerPage": {
                "name": "per_page",
                "in": "query",
                "required": false,
                "description": "Records per page (1\u2013100, default 25).",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 25
                }
            },
            "Cursor": {
                "name": "cursor",
                "in": "query",
                "required": false,
                "description": "The `next_cursor` value from a previous response.",
                "schema": {
                    "type": "string"
                }
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "description": "A human-readable explanation."
                    },
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "description": "Field-level validation messages, when applicable."
                    }
                }
            },
            "StatusResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "example": "ok"
                            }
                        }
                    }
                }
            },
            "DeletedResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer",
                                "example": 42
                            },
                            "deleted": {
                                "type": "boolean",
                                "example": true
                            }
                        }
                    }
                }
            },
            "DetachResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "list_id": {
                                "type": "integer",
                                "example": 7
                            },
                            "contact_id": {
                                "type": "integer",
                                "example": 42
                            },
                            "detached": {
                                "type": "boolean",
                                "example": true
                            }
                        }
                    }
                }
            },
            "UnenrolResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "sequence_id": {
                                "type": "integer",
                                "example": 3
                            },
                            "contact_id": {
                                "type": "integer",
                                "example": 42
                            },
                            "removed": {
                                "type": "boolean",
                                "example": true
                            }
                        }
                    }
                }
            },
            "Contact": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 42
                    },
                    "email": {
                        "type": "string",
                        "format": "email",
                        "example": "jane@example.com"
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "Jane"
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "Okonkwo"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "pending",
                            "unsubscribed",
                            "bounced"
                        ],
                        "example": "active"
                    },
                    "metadata": {
                        "type": "object",
                        "example": {
                            "company": "Acme",
                            "city": "Copenhagen"
                        }
                    },
                    "subscribed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-08-01T09:15:00+00:00"
                    },
                    "unsubscribed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": null
                    },
                    "confirmed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": null
                    },
                    "consent_source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "signup_form"
                    },
                    "soft_bounce_count": {
                        "type": "integer",
                        "example": 0
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-08-01T09:15:00+00:00"
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-08-09T14:02:00+00:00"
                    }
                }
            },
            "ContactUpsert": {
                "type": "object",
                "required": [
                    "email"
                ],
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email",
                        "example": "jane@example.com"
                    },
                    "first_name": {
                        "type": "string",
                        "example": "Jane"
                    },
                    "last_name": {
                        "type": "string",
                        "example": "Okonkwo"
                    },
                    "metadata": {
                        "type": "object",
                        "description": "Arbitrary key/value data, addressable as merge tags.",
                        "example": {
                            "company": "Acme",
                            "plan": "pro"
                        }
                    },
                    "status_if_new": {
                        "type": "string",
                        "enum": [
                            "active",
                            "pending"
                        ],
                        "description": "Status for a contact that does not already exist. Has no effect on an existing contact.",
                        "example": "active"
                    },
                    "tag_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "example": [
                            3,
                            8
                        ]
                    },
                    "list_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "example": [
                            1
                        ]
                    },
                    "consent_source": {
                        "type": "string",
                        "description": "Where consent was captured. Recorded for compliance evidence.",
                        "example": "signup_form"
                    },
                    "consent_ip": {
                        "type": "string",
                        "format": "ipv4",
                        "example": "203.0.113.24"
                    }
                }
            },
            "ContactUpdate": {
                "type": "object",
                "properties": {
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "metadata": {
                        "type": "object"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "active",
                            "pending",
                            "unsubscribed"
                        ]
                    },
                    "tag_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Replaces the contact's tags."
                    },
                    "list_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Replaces the contact's list memberships."
                    }
                }
            },
            "ContactBulk": {
                "type": "object",
                "required": [
                    "contacts"
                ],
                "properties": {
                    "contacts": {
                        "type": "array",
                        "maxItems": 1000,
                        "items": {
                            "$ref": "#/components/schemas/ContactUpsert"
                        }
                    },
                    "tag_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Applied to every contact in the batch."
                    },
                    "list_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "description": "Applied to every contact in the batch."
                    }
                }
            },
            "ContactBulkResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "email": {
                                    "type": "string"
                                },
                                "id": {
                                    "type": "integer"
                                },
                                "created": {
                                    "type": "boolean"
                                },
                                "status": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "created": {
                        "type": "integer"
                    },
                    "updated": {
                        "type": "integer"
                    }
                }
            },
            "ContactResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Contact"
                    }
                }
            },
            "ContactCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Contact"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "ContactIds": {
                "type": "object",
                "required": [
                    "contact_ids"
                ],
                "properties": {
                    "contact_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "TagIds": {
                "type": "object",
                "required": [
                    "tag_ids"
                ],
                "properties": {
                    "tag_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "AttachResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "list_id": {
                                "type": "integer"
                            },
                            "attached": {
                                "type": "integer"
                            },
                            "skipped": {
                                "type": "integer",
                                "description": "Ids that did not resolve to a contact on your team."
                            }
                        }
                    }
                }
            },
            "EraseResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "contacts_deleted": {
                                "type": "integer"
                            },
                            "events_anonymized": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "ContactList": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_default": {
                        "type": "boolean"
                    },
                    "opt_in_mode": {
                        "type": "string",
                        "enum": [
                            "single",
                            "double"
                        ]
                    },
                    "contacts_count": {
                        "type": "integer"
                    }
                }
            },
            "ListUpsert": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "opt_in_mode": {
                        "type": "string",
                        "enum": [
                            "single",
                            "double"
                        ],
                        "description": "Double opt-in creates new contacts as `pending` until they confirm."
                    }
                }
            },
            "ListResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/ContactList"
                    }
                }
            },
            "ListCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ContactList"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "Tag": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "contacts_count": {
                        "type": "integer"
                    }
                }
            },
            "TagUpsert": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "color": {
                        "type": "string"
                    }
                }
            },
            "TagResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Tag"
                    }
                }
            },
            "TagCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Tag"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "SegmentDefinitionBody": {
                "type": "object",
                "properties": {
                    "tag_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "date_from": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "date_to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    },
                    "search": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Matches email, first name, or last name."
                    },
                    "company": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Matches the contact metadata `company` field."
                    },
                    "location": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Matches metadata city, country, or location."
                    },
                    "engagement": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Restrict to contacts by email engagement over a trailing window. Machine opens (Apple MPP and bot prefetches) are excluded. Note that only the SendGrid integration flags them, so on other providers positive open conditions may still be over-inclusive.",
                        "required": [
                            "type",
                            "days"
                        ],
                        "properties": {
                            "type": {
                                "type": "string",
                                "enum": [
                                    "opened",
                                    "clicked",
                                    "not_opened",
                                    "not_clicked",
                                    "inactive"
                                ],
                                "description": "\"inactive\" means neither opened nor clicked."
                            },
                            "days": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 180,
                                "description": "Trailing window in days. Capped at 180 because email events are pruned at that age, beyond which absence of an event cannot be distinguished from absence of data."
                            }
                        }
                    }
                }
            },
            "Segment": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "definition": {
                        "$ref": "#/components/schemas/SegmentDefinitionBody"
                    }
                }
            },
            "SegmentDefinition": {
                "type": "object",
                "properties": {
                    "definition": {
                        "$ref": "#/components/schemas/SegmentDefinitionBody"
                    }
                }
            },
            "SegmentUpsert": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "definition": {
                        "$ref": "#/components/schemas/SegmentDefinitionBody"
                    }
                }
            },
            "SegmentResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Segment"
                    }
                }
            },
            "SegmentCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Segment"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "SegmentPreviewResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "count": {
                                "type": "integer",
                                "description": "Active contacts the definition resolves to."
                            },
                            "filters": {
                                "$ref": "#/components/schemas/SegmentDefinitionBody"
                            },
                            "sample": {
                                "type": "array",
                                "items": {
                                    "$ref": "#/components/schemas/Contact"
                                }
                            }
                        }
                    }
                }
            },
            "Campaign": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 118
                    },
                    "name": {
                        "type": "string",
                        "example": "August product update"
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "What's new this month"
                    },
                    "preheader": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "Three things we shipped"
                    },
                    "from_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "Jane at Acme"
                    },
                    "from_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "hello@acme.com"
                    },
                    "reply_to": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "support@acme.com"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "scheduled",
                            "screening",
                            "held",
                            "queuing",
                            "sending",
                            "paused",
                            "sent",
                            "partial",
                            "cancelled",
                            "failed"
                        ],
                        "example": "sent"
                    },
                    "audience": {
                        "type": "object",
                        "example": {
                            "source": "list",
                            "contact_list_id": 1,
                            "filters": null
                        }
                    },
                    "template_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 12
                    },
                    "ab_test": {
                        "type": "object",
                        "example": {
                            "enabled": false,
                            "percentage": null,
                            "winner_metric": null,
                            "delay_minutes": null,
                            "winner_variant_id": null
                        }
                    },
                    "total_recipients": {
                        "type": "integer",
                        "example": 12480
                    },
                    "sent_count": {
                        "type": "integer",
                        "example": 12463
                    },
                    "failed_count": {
                        "type": "integer",
                        "example": 17
                    },
                    "failure_reason": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": null
                    },
                    "scheduled_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": null
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-08-09T10:00:00+00:00"
                    }
                }
            },
            "CampaignUpsert": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "subject": {
                        "type": "string"
                    },
                    "preheader": {
                        "type": "string"
                    },
                    "from_name": {
                        "type": "string"
                    },
                    "from_email": {
                        "type": "string",
                        "format": "email",
                        "description": "Must sit on a fully verified sending domain, or the send is refused."
                    },
                    "reply_to": {
                        "type": "string",
                        "format": "email"
                    },
                    "audience_source": {
                        "type": "string",
                        "enum": [
                            "list",
                            "bigquery"
                        ]
                    },
                    "contact_list_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "segment_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Copies the segment's filter definition onto the campaign."
                    },
                    "audience_filters": {
                        "$ref": "#/components/schemas/SegmentDefinitionBody"
                    },
                    "template_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "ab_test_enabled": {
                        "type": "boolean"
                    },
                    "ab_test_percentage": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50
                    },
                    "ab_winner_metric": {
                        "type": "string",
                        "enum": [
                            "opens",
                            "clicks"
                        ]
                    },
                    "ab_test_delay_minutes": {
                        "type": "integer",
                        "minimum": 5
                    }
                }
            },
            "CampaignContent": {
                "type": "object",
                "properties": {
                    "html_content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "plain_content": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "blocks_json": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "object"
                        }
                    },
                    "template_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                }
            },
            "CampaignSchedule": {
                "type": "object",
                "required": [
                    "send_at"
                ],
                "properties": {
                    "send_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Must be in the future. Interpreted as UTC unless an offset is given."
                    }
                }
            },
            "CampaignVariants": {
                "type": "object",
                "required": [
                    "variants"
                ],
                "properties": {
                    "variants": {
                        "type": "array",
                        "minItems": 2,
                        "maxItems": 4,
                        "items": {
                            "type": "object",
                            "required": [
                                "label",
                                "subject"
                            ],
                            "properties": {
                                "label": {
                                    "type": "string"
                                },
                                "subject": {
                                    "type": "string"
                                },
                                "from_name": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "CampaignResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Campaign"
                    }
                }
            },
            "CampaignCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Campaign"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "PreflightResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "campaign_id": {
                                "type": "integer"
                            },
                            "status": {
                                "type": "string"
                            },
                            "launchable": {
                                "type": "boolean"
                            },
                            "blockers": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "estimated_recipients": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Null for a BigQuery audience, which is resolved at send time."
                            }
                        }
                    }
                }
            },
            "TestSend": {
                "type": "object",
                "required": [
                    "emails"
                ],
                "properties": {
                    "emails": {
                        "type": "array",
                        "maxItems": 5,
                        "items": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                }
            },
            "TestSendResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "sent": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "failed": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "CampaignVariant": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "label": {
                        "type": "string"
                    },
                    "subject": {
                        "type": "string"
                    },
                    "from_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_winner": {
                        "type": "boolean"
                    },
                    "sent": {
                        "type": "integer"
                    },
                    "opened": {
                        "type": "integer"
                    },
                    "clicked": {
                        "type": "integer"
                    },
                    "open_rate": {
                        "type": "number"
                    },
                    "click_rate": {
                        "type": "number"
                    }
                }
            },
            "VariantCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/CampaignVariant"
                        }
                    }
                }
            },
            "ReportResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "campaign_id": {
                                "type": "integer"
                            },
                            "name": {
                                "type": "string"
                            },
                            "subject": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "status": {
                                "type": "string"
                            },
                            "sent_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "metrics": {
                                "type": "object",
                                "properties": {
                                    "recipients": {
                                        "type": "integer",
                                        "example": 12480
                                    },
                                    "sent": {
                                        "type": "integer",
                                        "example": 12463
                                    },
                                    "delivered": {
                                        "type": "integer",
                                        "example": 12301
                                    },
                                    "opened": {
                                        "type": "integer",
                                        "description": "Unique human opens; machine opens excluded.",
                                        "example": 5238
                                    },
                                    "clicked": {
                                        "type": "integer",
                                        "example": 1104
                                    },
                                    "bounced": {
                                        "type": "integer",
                                        "example": 162
                                    },
                                    "unsubscribed": {
                                        "type": "integer",
                                        "example": 38
                                    },
                                    "complained": {
                                        "type": "integer",
                                        "example": 3
                                    },
                                    "delivery_rate": {
                                        "type": "number",
                                        "example": 98.7
                                    },
                                    "open_rate": {
                                        "type": "number",
                                        "example": 42.6
                                    },
                                    "click_rate": {
                                        "type": "number",
                                        "example": 9
                                    },
                                    "ctor": {
                                        "type": "number",
                                        "description": "Clicks over opens.",
                                        "example": 21.1
                                    },
                                    "bounce_rate": {
                                        "type": "number",
                                        "example": 1.3
                                    },
                                    "unsubscribe_rate": {
                                        "type": "number",
                                        "example": 0.3
                                    },
                                    "complaint_rate": {
                                        "type": "number",
                                        "example": 0.02
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "LinkReportResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "example": "https://acme.com/changelog"
                                },
                                "clicks": {
                                    "type": "integer",
                                    "description": "Human clicks, with detected bot traffic removed.",
                                    "example": 412
                                },
                                "unique": {
                                    "type": "integer",
                                    "example": 388
                                },
                                "bots": {
                                    "type": "integer",
                                    "example": 27
                                }
                            }
                        }
                    }
                }
            },
            "RecipientCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "contact_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "email": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "status": {
                                    "type": "string"
                                },
                                "sent_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "opened_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "clicked_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "error_message": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "EmailEvent": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 90211
                    },
                    "email": {
                        "type": "string",
                        "example": "jane@example.com"
                    },
                    "event": {
                        "type": "string",
                        "example": "clicked"
                    },
                    "campaign_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 118
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "example": 42
                    },
                    "provider": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "postal"
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "webhook"
                    },
                    "is_machine_open": {
                        "type": "boolean",
                        "example": false
                    },
                    "metadata": {
                        "type": "object",
                        "example": {
                            "url": "https://acme.com/changelog"
                        }
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "example": "2026-08-09T10:04:12+00:00"
                    }
                }
            },
            "EventCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/EmailEvent"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "EventIngest": {
                "type": "object",
                "required": [
                    "events"
                ],
                "properties": {
                    "events": {
                        "type": "array",
                        "maxItems": 1000,
                        "items": {
                            "type": "object",
                            "required": [
                                "email",
                                "event"
                            ],
                            "properties": {
                                "email": {
                                    "type": "string",
                                    "format": "email"
                                },
                                "event": {
                                    "type": "string",
                                    "enum": [
                                        "delivered",
                                        "bounced",
                                        "deferred",
                                        "dropped",
                                        "spam_report",
                                        "unsubscribed",
                                        "opened",
                                        "clicked",
                                        "queued",
                                        "sent"
                                    ]
                                },
                                "campaign_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "contact_id": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "provider": {
                                    "type": "string"
                                },
                                "source": {
                                    "type": "string"
                                },
                                "metadata": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "EventIngestResponse": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string"
                    },
                    "processed": {
                        "type": "integer"
                    }
                }
            },
            "EmailTemplate": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "category": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "style": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_system": {
                        "type": "boolean"
                    },
                    "html_content": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Only returned when fetching a single template."
                    }
                }
            },
            "TemplateUpsert": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "style": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "html_content": {
                        "type": "string"
                    },
                    "blocks_json": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    }
                }
            },
            "TemplateResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/EmailTemplate"
                    }
                }
            },
            "TemplateCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/EmailTemplate"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "Sequence": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "trigger_type": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "subscribers_count": {
                        "type": "integer"
                    }
                }
            },
            "SequenceResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Sequence"
                    }
                }
            },
            "SequenceCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Sequence"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "SequenceEnrol": {
                "type": "object",
                "properties": {
                    "contact_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "emails": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "format": "email"
                        }
                    }
                },
                "description": "Supply either contact_ids or emails."
            },
            "EnrolResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "sequence_id": {
                                "type": "integer"
                            },
                            "matched": {
                                "type": "integer"
                            },
                            "enrolled": {
                                "type": "integer"
                            },
                            "skipped": {
                                "type": "integer",
                                "description": "Matched but not eligible: already enrolled, unsubscribed, or bounced."
                            }
                        }
                    }
                }
            },
            "SubscriberCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "Waitlist": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "public_url": {
                        "type": "string"
                    },
                    "signups_count": {
                        "type": "integer"
                    }
                }
            },
            "WaitlistResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Waitlist"
                    }
                }
            },
            "WaitlistCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Waitlist"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "WaitlistSignup": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "email": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "position": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "referral_code": {
                        "type": "string"
                    },
                    "referrals_count": {
                        "type": "integer"
                    }
                }
            },
            "WaitlistSignupCreate": {
                "type": "object",
                "required": [
                    "email"
                ],
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email"
                    },
                    "name": {
                        "type": "string"
                    },
                    "referral_code": {
                        "type": "string",
                        "description": "The referring signup's code, if this signup came through a referral."
                    },
                    "metadata": {
                        "type": "object"
                    }
                }
            },
            "WaitlistInvite": {
                "type": "object",
                "properties": {
                    "signup_ids": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    },
                    "count": {
                        "type": "integer",
                        "description": "Invite the next N by queue position."
                    }
                }
            },
            "InviteResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "waitlist_id": {
                                "type": "integer"
                            },
                            "invited": {
                                "type": "integer"
                            },
                            "signup_ids": {
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "SignupResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/WaitlistSignup"
                    }
                }
            },
            "SignupCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/WaitlistSignup"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "Suppression": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "email": {
                        "type": "string"
                    },
                    "reason": {
                        "type": "string",
                        "enum": [
                            "hard_bounce",
                            "soft_bounce",
                            "spam_report",
                            "unsubscribe",
                            "manual"
                        ]
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "campaign_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                }
            },
            "SuppressionCreate": {
                "type": "object",
                "required": [
                    "email",
                    "reason"
                ],
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email"
                    },
                    "reason": {
                        "type": "string",
                        "enum": [
                            "hard_bounce",
                            "spam_report",
                            "unsubscribe",
                            "manual"
                        ]
                    },
                    "metadata": {
                        "type": "object"
                    }
                }
            },
            "SuppressionDelete": {
                "type": "object",
                "required": [
                    "email"
                ],
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email"
                    }
                }
            },
            "SuppressionResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/Suppression"
                    }
                }
            },
            "SuppressionCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Suppression"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "TransactionalSend": {
                "type": "object",
                "required": [
                    "to",
                    "from_email",
                    "subject"
                ],
                "properties": {
                    "to": {
                        "type": "string",
                        "format": "email"
                    },
                    "to_name": {
                        "type": "string"
                    },
                    "from_email": {
                        "type": "string",
                        "format": "email",
                        "description": "Must be on a fully verified sending domain."
                    },
                    "from_name": {
                        "type": "string"
                    },
                    "reply_to": {
                        "type": "string",
                        "format": "email"
                    },
                    "subject": {
                        "type": "string",
                        "description": "Merge tags are substituted here too."
                    },
                    "html": {
                        "type": "string",
                        "description": "Required unless template_id is given."
                    },
                    "text": {
                        "type": "string",
                        "description": "Derived from the HTML when omitted."
                    },
                    "template_id": {
                        "type": "integer"
                    },
                    "variables": {
                        "type": "object",
                        "description": "Values for {{merge_tags}} in the subject and body."
                    },
                    "ignore_suppression": {
                        "type": "boolean",
                        "description": "Waives your own suppression list for a genuinely operational message. Never waives platform-wide suppressions."
                    }
                }
            },
            "TransactionalResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "string",
                                "enum": [
                                    "sent",
                                    "sandboxed"
                                ]
                            },
                            "to": {
                                "type": "string"
                            },
                            "subject": {
                                "type": "string"
                            },
                            "delivered": {
                                "type": "boolean"
                            }
                        }
                    }
                }
            },
            "AiPolish": {
                "type": "object",
                "required": [
                    "content"
                ],
                "properties": {
                    "content": {
                        "type": "string",
                        "minLength": 10,
                        "maxLength": 50000
                    },
                    "tone": {
                        "type": "string",
                        "enum": [
                            "professional",
                            "casual",
                            "friendly",
                            "formal",
                            "persuasive"
                        ]
                    },
                    "goal": {
                        "type": "string",
                        "enum": [
                            "clarity",
                            "engagement",
                            "conversion",
                            "brevity",
                            "warmth"
                        ]
                    }
                }
            },
            "AiPolishResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "tweaked_content": {
                                "type": "string"
                            },
                            "ai_suggestions": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "quality_score": {
                                "type": "number"
                            },
                            "model_used": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "tokens_used": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "AiSubject": {
                "type": "object",
                "required": [
                    "subject"
                ],
                "properties": {
                    "subject": {
                        "type": "string"
                    },
                    "use_history": {
                        "type": "boolean",
                        "description": "Ground scoring in this team's real historical open rates."
                    }
                }
            },
            "AiSubjectResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "variations": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            },
                            "winning_subject": {
                                "type": "string"
                            },
                            "original_score": {
                                "type": "number"
                            },
                            "best_score": {
                                "type": "number"
                            }
                        }
                    }
                }
            },
            "AiDeliverability": {
                "type": "object",
                "required": [
                    "content"
                ],
                "properties": {
                    "content": {
                        "type": "string"
                    },
                    "subject": {
                        "type": "string"
                    },
                    "use_account_signals": {
                        "type": "boolean",
                        "description": "Weight the assessment by your account's real bounce, complaint, and domain-auth signals. Defaults to true."
                    }
                }
            },
            "AiDeliverabilityResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "spam_score": {
                                "type": "number",
                                "description": "0\u2013100; lower is better."
                            },
                            "issues": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            },
                            "checks_passed": {
                                "type": "array",
                                "items": {
                                    "type": "object"
                                }
                            },
                            "verdict": {
                                "type": "string",
                                "enum": [
                                    "pass",
                                    "warn",
                                    "fail"
                                ]
                            }
                        }
                    }
                }
            },
            "AiUsageResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "period_start": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "period_end": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "ai_tweaks": {
                                "type": "object"
                            },
                            "subject_tests": {
                                "type": "object"
                            },
                            "emails": {
                                "type": "object"
                            }
                        }
                    }
                }
            },
            "WebhookEndpoint": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "url": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "last_delivered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "consecutive_failures": {
                        "type": "integer"
                    },
                    "secret": {
                        "type": "string",
                        "description": "Returned only on creation and rotation."
                    }
                }
            },
            "WebhookCreate": {
                "type": "object",
                "required": [
                    "url",
                    "events"
                ],
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Must be publicly routable. Private and reserved IPs are rejected."
                    },
                    "description": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "description": "Event types, or [\"*\"] for all."
                    }
                }
            },
            "WebhookUpdate": {
                "type": "object",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "description": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                }
            },
            "WebhookResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "$ref": "#/components/schemas/WebhookEndpoint"
                    }
                }
            },
            "WebhookCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/WebhookEndpoint"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "WebhookDelivery": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "event_type": {
                        "type": "string"
                    },
                    "event_id": {
                        "type": "string"
                    },
                    "payload": {
                        "type": "object"
                    },
                    "response_status": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "response_body": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "attempt": {
                        "type": "integer"
                    },
                    "succeeded": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "DeliveryCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/WebhookDelivery"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "EventTypeCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "ApiKey": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "masked_key": {
                        "type": "string"
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "last_used_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "expires_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "revoked_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "ApiKeyCreate": {
                "type": "object",
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "scopes": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "contacts:read",
                                "contacts:write",
                                "campaigns:read",
                                "campaigns:write",
                                "campaigns:send",
                                "events:read",
                                "events:write",
                                "suppressions:read",
                                "suppressions:write",
                                "transactional:send",
                                "ai:write",
                                "webhooks:read",
                                "webhooks:write"
                            ]
                        },
                        "description": "Defaults to every scope the minting key holds."
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "ApiKeyCreateResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/ApiKey"
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "key": {
                                        "type": "string",
                                        "description": "The secret. Returned exactly once."
                                    }
                                }
                            }
                        ]
                    }
                }
            },
            "ApiKeyCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/ApiKey"
                        }
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "next_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "prev_page_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "has_more": {
                        "type": "boolean"
                    }
                }
            },
            "ScopeCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "scope": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            },
            "MeResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "team": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "integer",
                                        "example": 9
                                    },
                                    "name": {
                                        "type": "string",
                                        "example": "Acme"
                                    },
                                    "plan": {
                                        "type": "string",
                                        "example": "business"
                                    }
                                }
                            },
                            "api_key": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "example": 4
                                    },
                                    "name": {
                                        "type": "string",
                                        "example": "CRM sync"
                                    },
                                    "scopes": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "example": [
                                            "contacts:read",
                                            "contacts:write"
                                        ]
                                    },
                                    "legacy": {
                                        "type": "boolean",
                                        "description": "True for a key minted before scoping existed.",
                                        "example": false
                                    }
                                }
                            },
                            "rate_limit": {
                                "type": "object",
                                "properties": {
                                    "requests_per_minute": {
                                        "type": "integer",
                                        "example": 600
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "responses": {
            "Unauthorized": {
                "description": "Missing, invalid, revoked, or expired API key.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "The key lacks a required scope, or the plan does not include API access.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "No such record for this team.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "ValidationError": {
                "description": "The request was understood but could not be applied.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Rate limit exceeded. Retry after the interval in `Retry-After`.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        }
                    }
                }
            }
        }
    },
    "x-scopes": [
        {
            "scope": "contacts:read",
            "description": "Read contacts, lists, tags, and segments"
        },
        {
            "scope": "contacts:write",
            "description": "Create and modify contacts, lists, tags, and segments"
        },
        {
            "scope": "campaigns:read",
            "description": "Read campaigns, templates, and sequences"
        },
        {
            "scope": "campaigns:write",
            "description": "Create and modify campaigns and templates"
        },
        {
            "scope": "campaigns:send",
            "description": "Launch, schedule, and cancel campaign sends"
        },
        {
            "scope": "events:read",
            "description": "Read delivery events and campaign reports"
        },
        {
            "scope": "events:write",
            "description": "Ingest delivery events"
        },
        {
            "scope": "suppressions:read",
            "description": "Read the suppression list"
        },
        {
            "scope": "suppressions:write",
            "description": "Add and remove suppressions"
        },
        {
            "scope": "transactional:send",
            "description": "Send transactional email"
        },
        {
            "scope": "ai:write",
            "description": "Run AI polish, subject line, and deliverability calls"
        },
        {
            "scope": "webhooks:read",
            "description": "Read webhook endpoints and delivery history"
        },
        {
            "scope": "webhooks:write",
            "description": "Create and modify webhook endpoints"
        }
    ],
    "x-webhook-events": [
        {
            "type": "contact.created",
            "description": "A contact was added"
        },
        {
            "type": "contact.updated",
            "description": "A contact record changed"
        },
        {
            "type": "contact.unsubscribed",
            "description": "A contact opted out"
        },
        {
            "type": "contact.bounced",
            "description": "A contact hard bounced and was suppressed"
        },
        {
            "type": "campaign.sent",
            "description": "A campaign finished sending"
        },
        {
            "type": "campaign.failed",
            "description": "A campaign send failed"
        },
        {
            "type": "email.delivered",
            "description": "A message was accepted by the receiving server"
        },
        {
            "type": "email.opened",
            "description": "A recipient opened a message"
        },
        {
            "type": "email.clicked",
            "description": "A recipient clicked a tracked link"
        },
        {
            "type": "email.bounced",
            "description": "A message bounced"
        },
        {
            "type": "email.complained",
            "description": "A recipient reported a message as spam"
        },
        {
            "type": "suppression.created",
            "description": "An address was added to the suppression list"
        }
    ]
}