{
    "openapi": "3.1.0",
    "info": {
        "title": "MailSequence API",
        "version": "v1",
        "description": "The MailSequence Developer Platform REST API. Authenticate with a Bearer key (`ms_sk_\u2026` workspace or `ms_pk_\u2026` provisioning); every endpoint is scope-gated and tenant-isolated. Lists use opaque cursor pagination (`{ data, next_cursor }`); errors return `{ error: { type, message, field? } }`."
    },
    "servers": [
        {
            "url": "https:\/\/app.mailsequence.com\/api\/v1"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "paths": {
        "\/analytics\/daily": {
            "get": {
                "operationId": "v1.analytics.daily",
                "summary": "List daily analytics",
                "tags": [
                    "Analytics"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `DailyMetricResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/campaigns": {
            "get": {
                "operationId": "v1.campaigns.index",
                "summary": "List campaigns",
                "tags": [
                    "Campaign"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `CampaignResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.campaigns.store",
                "summary": "Create a campaign",
                "tags": [
                    "CampaignWrite"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreCampaignRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`CampaignResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/CampaignResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/campaigns\/{campaign}": {
            "get": {
                "operationId": "v1.campaigns.show",
                "description": "Route-model binding resolves under AppWorkspaceScope, so a cross-workspace\nid yields a 404 rather than another tenant's row.",
                "summary": "Get a campaign",
                "tags": [
                    "Campaign"
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "The campaign ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`CampaignResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/CampaignResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            },
            "patch": {
                "operationId": "v1.campaigns.update",
                "summary": "Update a campaign",
                "tags": [
                    "CampaignWrite"
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "The campaign ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateCampaignRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`CampaignResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/CampaignResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts": {
            "get": {
                "operationId": "v1.contacts.index",
                "description": "Cursor-paginated list with a deterministic order (required so the cursor\nnever drops\/duplicates rows). Filters are whitelisted query params only;\nan unknown param is ignored and never widens scope.\n\nNote: a Contact has no literal `status` column \u2014 its CRM lifecycle field\nis `stage`, so the documented `status` filter maps to `stage`.",
                "summary": "List contacts",
                "tags": [
                    "Contact"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.contacts.store",
                "summary": "Create a contact",
                "tags": [
                    "ContactWrite"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/{contact}": {
            "get": {
                "operationId": "v1.contacts.show",
                "description": "Route-model binding resolves under AppWorkspaceScope, so a cross-workspace\nid yields a 404 (ModelNotFound) rather than another tenant's row \u2014 we never\ntrust a client-supplied workspace id.",
                "summary": "Get a contact",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ContactResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            },
            "patch": {
                "operationId": "v1.contacts.update",
                "description": "Patch a contact resolved by the scoped route binding (a cross-workspace id\nis a 404, never another tenant's row). The merge is keyed by the bound\ncontact's own email \u2014 identity is immutable on PATCH \u2014 and routed through\nthe upserter so the chokepoint and its invariants still apply.",
                "summary": "Update a contact",
                "tags": [
                    "ContactWrite"
                ],
                "parameters": [
                    {
                        "name": "contact",
                        "in": "path",
                        "required": true,
                        "description": "The contact ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ContactResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ContactResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/enrollments": {
            "get": {
                "operationId": "v1.enrollments.index",
                "summary": "List enrollments",
                "tags": [
                    "Enrollment"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `EnrollmentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/enrollments\/{enrollment}": {
            "get": {
                "operationId": "v1.enrollments.show",
                "description": "Route-model binding resolves under AppWorkspaceScope, so a cross-workspace\nid yields a 404 rather than another tenant's row.",
                "summary": "Get an enrollment",
                "tags": [
                    "Enrollment"
                ],
                "parameters": [
                    {
                        "name": "enrollment",
                        "in": "path",
                        "required": true,
                        "description": "The enrollment ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`EnrollmentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/EnrollmentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/campaigns\/{campaign}\/enrollments": {
            "post": {
                "operationId": "v1.campaigns.enrollments.store",
                "description": "Enroll a contact into the campaign via the canonical {@see EnrollmentCreator}\n(same validation + first-step wiring the app uses). A not-enrollable campaign\n(inactive, unpublished sequence, no steps, un-sendable contact) is a typed 422.",
                "summary": "Enroll a contact in a campaign",
                "tags": [
                    "EnrollmentWrite"
                ],
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "description": "The campaign ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreEnrollmentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`EnrollmentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/EnrollmentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/enrollments\/{enrollment}\/pause": {
            "post": {
                "operationId": "v1.enrollments.pause",
                "summary": "Pause an enrollment",
                "tags": [
                    "EnrollmentWrite"
                ],
                "parameters": [
                    {
                        "name": "enrollment",
                        "in": "path",
                        "required": true,
                        "description": "The enrollment ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`EnrollmentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/EnrollmentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/enrollments\/{enrollment}\/resume": {
            "post": {
                "operationId": "v1.enrollments.resume",
                "summary": "Resume an enrollment",
                "tags": [
                    "EnrollmentWrite"
                ],
                "parameters": [
                    {
                        "name": "enrollment",
                        "in": "path",
                        "required": true,
                        "description": "The enrollment ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`EnrollmentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/EnrollmentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/enrollments\/{enrollment}\/stop": {
            "post": {
                "operationId": "v1.enrollments.stop",
                "summary": "Stop an enrollment",
                "tags": [
                    "EnrollmentWrite"
                ],
                "parameters": [
                    {
                        "name": "enrollment",
                        "in": "path",
                        "required": true,
                        "description": "The enrollment ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StopEnrollmentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`EnrollmentResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/EnrollmentResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/import": {
            "post": {
                "operationId": "v1.contacts.import",
                "summary": "Bulk import contacts",
                "tags": [
                    "Import"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/BulkImportRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "The job re-checks the cap against the rows still ahead at execution time\n(async TOCTOU guard) \u2014 it recomputes from the staged file, keyed by the\nSOURCE_API provenance, so no count needs threading through the dispatch.\n\n\n\n`ImportBatchResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ImportBatchResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/imports\/{import}": {
            "get": {
                "operationId": "v1.imports.show",
                "description": "Status for a batch resolved by the scoped route binding \u2014 a cross-workspace\nid is a 404 (AppWorkspaceScope), never another tenant's batch.",
                "summary": "Get import batch status",
                "tags": [
                    "Import"
                ],
                "parameters": [
                    {
                        "name": "import",
                        "in": "path",
                        "required": true,
                        "description": "The import ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ImportBatchResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ImportBatchResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/inboxes": {
            "get": {
                "operationId": "v1.inboxes.index",
                "summary": "List inboxes",
                "tags": [
                    "Inbox"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `InboxResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/inboxes\/{inbox}": {
            "get": {
                "operationId": "v1.inboxes.show",
                "summary": "Get an inbox",
                "tags": [
                    "Inbox"
                ],
                "parameters": [
                    {
                        "name": "inbox",
                        "in": "path",
                        "required": true,
                        "description": "The inbox UUID",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`InboxResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/InboxResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/me": {
            "get": {
                "operationId": "v1.me",
                "summary": "Get API key identity",
                "tags": [
                    "Me"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "tier": {
                                            "type": "string"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "prefix": {
                                            "type": "string"
                                        },
                                        "scopes": {
                                            "anyOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0,
                                                    "additionalItems": false
                                                }
                                            ]
                                        },
                                        "app_workspace_id": {
                                            "type": "string"
                                        },
                                        "organization_id": {
                                            "type": "string"
                                        },
                                        "rate_limit_per_minute": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "tier",
                                        "name",
                                        "prefix",
                                        "scopes",
                                        "app_workspace_id",
                                        "organization_id",
                                        "rate_limit_per_minute"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/provisioning\/workspaces": {
            "post": {
                "operationId": "v1.provisioning.workspaces.store",
                "description": "Create a workspace + seed + mint a Tier-W key. The minted plaintext is in\nthe 201 body exactly once.",
                "summary": "Provision a workspace",
                "tags": [
                    "Provisioning"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ProvisionWorkspaceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`ProvisionedWorkspaceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ProvisionedWorkspaceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/provisioning\/workspaces\/{workspaceUuid}\/seed": {
            "post": {
                "operationId": "v1.provisioning.workspaces.seed",
                "description": "Re-runnable config seed for a workspace under the key's org. The workspace is\nresolved + org-scoped inside {@see SeedWorkspaceRequest::authorize()} (NOT via\nimplicit route binding), so a missing OR foreign-org uuid both 404 with the\nsame envelope \u2014 no cross-org existence oracle.",
                "summary": "Seed a workspace",
                "tags": [
                    "Provisioning"
                ],
                "parameters": [
                    {
                        "name": "workspaceUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/SeedWorkspaceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "uuid": {
                                                    "type": "string"
                                                },
                                                "seeded": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "uuid",
                                                "seeded"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    }
                }
            }
        },
        "\/sequences": {
            "get": {
                "operationId": "v1.sequences.index",
                "summary": "List sequences",
                "tags": [
                    "Sequence"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `SequenceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.sequences.store",
                "summary": "Create a sequence",
                "tags": [
                    "SequenceWrite"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreSequenceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`SequenceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/SequenceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/sequences\/{sequence}": {
            "get": {
                "operationId": "v1.sequences.show",
                "description": "Route-model binding resolves under AppWorkspaceScope, so a cross-workspace\nid yields a 404 rather than another tenant's row.",
                "summary": "Get a sequence",
                "tags": [
                    "Sequence"
                ],
                "parameters": [
                    {
                        "name": "sequence",
                        "in": "path",
                        "required": true,
                        "description": "The sequence ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`SequenceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/SequenceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            },
            "patch": {
                "operationId": "v1.sequences.update",
                "summary": "Update a sequence",
                "tags": [
                    "SequenceWrite"
                ],
                "parameters": [
                    {
                        "name": "sequence",
                        "in": "path",
                        "required": true,
                        "description": "The sequence ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateSequenceRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`SequenceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/SequenceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/threads": {
            "get": {
                "operationId": "v1.threads.index",
                "summary": "List threads",
                "tags": [
                    "Thread"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `ThreadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/threads\/{thread}": {
            "get": {
                "operationId": "v1.threads.show",
                "description": "Route-model binding resolves under AppWorkspaceScope, so a cross-workspace\nid yields a 404 rather than another tenant's row.",
                "summary": "Get a thread",
                "tags": [
                    "Thread"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ThreadResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ThreadResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/threads\/{thread}\/messages": {
            "get": {
                "operationId": "v1.threads.messages",
                "description": "Nested message list. The parent {thread} is resolved by route-model binding\nUNDER AppWorkspaceScope first \u2014 so a cross-workspace (or nonexistent) thread\nid is a 404 before any message is listed (\u00a78a TEN). Messages are then listed\nvia the scoped relation with a deterministic order for stable paging.",
                "summary": "List thread messages",
                "tags": [
                    "Thread"
                ],
                "parameters": [
                    {
                        "name": "thread",
                        "in": "path",
                        "required": true,
                        "description": "The thread ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `MessageResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        },
        "\/webhook-endpoints": {
            "get": {
                "operationId": "v1.webhook-endpoints.index",
                "description": "Cursor-paginated list of the workspace's endpoints (secret never included).",
                "summary": "List webhook endpoints",
                "tags": [
                    "WebhookEndpoint"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `WebhookEndpointResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#\/components\/schemas\/CursorCollection"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "links": {
                                                    "type": "object",
                                                    "properties": {
                                                        "first": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "last": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "prev": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "next": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "first",
                                                        "last",
                                                        "prev",
                                                        "next"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "path": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "Base path for paginator generated URLs."
                                                        },
                                                        "per_page": {
                                                            "type": "integer",
                                                            "description": "Number of items shown per page.",
                                                            "minimum": 0
                                                        },
                                                        "next_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the next set of items."
                                                        },
                                                        "prev_cursor": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "description": "The \"cursor\" that points to the previous set of items."
                                                        }
                                                    },
                                                    "required": [
                                                        "path",
                                                        "per_page",
                                                        "next_cursor",
                                                        "prev_cursor"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "links",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.webhook-endpoints.store",
                "description": "Create an endpoint. The URL is SSRF-validated before persisting (F1); a\nfresh signing secret is minted (encrypted at rest, $hidden) and returned in\nthe response body exactly once.",
                "summary": "Create a webhook endpoint",
                "tags": [
                    "WebhookEndpoint"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreWebhookEndpointRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`WebhookEndpointResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/WebhookEndpointResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/webhook-endpoints\/{webhookEndpoint}": {
            "delete": {
                "operationId": "v1.webhook-endpoints.destroy",
                "description": "Delete an endpoint resolved by the scoped route binding (cross-workspace id\n\u2192 404, never another tenant's row). Cascades its deliveries.",
                "summary": "Delete a webhook endpoint",
                "tags": [
                    "WebhookEndpoint"
                ],
                "parameters": [
                    {
                        "name": "webhookEndpoint",
                        "in": "path",
                        "required": true,
                        "description": "The webhook endpoint ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Bearer key \u2014 `ms_sk_\u2026` (workspace tier) or `ms_pk_\u2026` (provisioning tier). Send as `Authorization: Bearer <key>`.",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "AiProvider": {
                "type": "string",
                "enum": [
                    "openai",
                    "openrouter"
                ],
                "title": "AiProvider"
            },
            "BulkImportRequest": {
                "type": "object",
                "description": "Validates a bulk contact-import payload for `POST \/api\/v1\/contacts\/import` (M35a).\n\nShape: `{ \"conflict_policy\"?: \"skip|fill_empty_only|overwrite\", \"rows\": [ { \"email\": \u2026, \u2026 } ] }`.\nThe `rows` array is capped at `config('services.api.import_max_rows')` so an\noversized payload is a 422 BEFORE any batch is created (failure mode A). Per-row\nfields whitelist the scalar, customer-owned contact surface only \u2014 tenancy,\nprovenance, compliance, and sync columns are never accepted from the client (the\nreused `ContactUpserter` treats them as reserved).",
                "properties": {
                    "conflict_policy": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "skip",
                            "fill_empty_only",
                            "overwrite",
                            null
                        ]
                    },
                    "rows": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "email": {
                                    "type": "string",
                                    "format": "email",
                                    "maxLength": 255
                                },
                                "first_name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "last_name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "company": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "title": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "phone": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "industry": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "revenue": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "revenue_amount": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0
                                },
                                "region": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "country": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "minLength": 2,
                                    "maxLength": 2
                                },
                                "city": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "employee_count": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 4294967295
                                },
                                "sic_code": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "stage": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                }
                            },
                            "required": [
                                "email"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 10000
                    }
                },
                "required": [
                    "rows"
                ],
                "title": "BulkImportRequest"
            },
            "CampaignResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "campaign_type": {
                        "type": "string"
                    },
                    "campaign_type_label": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "active_sequence_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "uuid",
                    "name",
                    "campaign_type",
                    "campaign_type_label",
                    "status",
                    "active_sequence_id",
                    "created_at",
                    "updated_at"
                ],
                "title": "CampaignResource"
            },
            "ContactResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "email": {
                        "type": "string"
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "company": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "revenue": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "revenue_amount": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "region": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "employee_count": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "sic_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "stage": {
                        "type": "string"
                    },
                    "source": {
                        "type": "string"
                    },
                    "custom_1": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "custom_2": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "custom_3": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "custom_json_1": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "custom_fields_json": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    },
                    "verified_status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "verified_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "suppressed": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "email",
                    "first_name",
                    "last_name",
                    "company",
                    "title",
                    "phone",
                    "industry",
                    "revenue",
                    "revenue_amount",
                    "region",
                    "country",
                    "city",
                    "employee_count",
                    "sic_code",
                    "stage",
                    "source",
                    "custom_1",
                    "custom_2",
                    "custom_3",
                    "custom_json_1",
                    "custom_fields_json",
                    "verified_status",
                    "verified_at",
                    "suppressed",
                    "created_at",
                    "updated_at"
                ],
                "title": "ContactResource"
            },
            "CursorCollection": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/ContactResource"
                        }
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "data",
                    "next_cursor"
                ],
                "title": "CursorCollection"
            },
            "CursorResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {}
                    },
                    "next_cursor": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Opaque cursor for the next page, or null on the last page. Pass back as ?cursor=."
                    }
                },
                "required": [
                    "data",
                    "next_cursor"
                ],
                "title": "CursorResponse"
            },
            "EnrollmentResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "campaign_id": {
                        "type": "integer"
                    },
                    "contact_id": {
                        "type": "integer"
                    },
                    "inbox_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "current_step_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "next_due_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "stopped_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_error_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_error_message": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "retry_count": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "campaign_id",
                    "contact_id",
                    "inbox_id",
                    "status",
                    "current_step_id",
                    "next_due_at",
                    "stopped_reason",
                    "last_error_code",
                    "last_error_message",
                    "retry_count",
                    "created_at",
                    "updated_at"
                ],
                "title": "EnrollmentResource"
            },
            "ErrorEnvelope": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "type": {
                                "type": "string",
                                "description": "Machine-readable category, e.g. validation_error, unauthorized, forbidden, not_found, rate_limited."
                            },
                            "message": {
                                "type": "string"
                            },
                            "field": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "The offending input field, present only on field-scoped validation errors."
                            }
                        },
                        "required": [
                            "type",
                            "message"
                        ]
                    }
                },
                "required": [
                    "error"
                ],
                "title": "ErrorEnvelope"
            },
            "ImportBatchResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "total_rows": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "processed": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "`last_processed_row` is the CSV LINE number (the header is line 1, so\ndata rows are 2..N+1). Subtract the header offset so `processed` is the\ncount of data rows handled (0..total_rows), never total_rows+1."
                    },
                    "created": {
                        "type": "integer"
                    },
                    "updated": {
                        "type": "integer"
                    },
                    "skipped": {
                        "type": "integer"
                    },
                    "suppressed": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "status",
                    "total_rows",
                    "processed",
                    "created",
                    "updated",
                    "skipped",
                    "suppressed",
                    "created_at"
                ],
                "title": "ImportBatchResource"
            },
            "InboxResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "uuid": {
                        "type": "string"
                    },
                    "email_address": {
                        "type": "string"
                    },
                    "sender_first_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sender_last_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "sender_name": {
                        "type": "string"
                    },
                    "sender_sign_off": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "domain_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "provider_type": {
                        "type": "string"
                    },
                    "auth_state": {
                        "type": "string"
                    },
                    "warmup_state": {
                        "type": "string"
                    },
                    "warmup_day_number": {
                        "type": "integer"
                    },
                    "status": {
                        "type": "string"
                    },
                    "reputation_score": {
                        "type": "string"
                    },
                    "health_score": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_send_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_sync_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "uuid",
                    "email_address",
                    "sender_first_name",
                    "sender_last_name",
                    "sender_name",
                    "sender_sign_off",
                    "domain_id",
                    "provider_type",
                    "auth_state",
                    "warmup_state",
                    "warmup_day_number",
                    "status",
                    "reputation_score",
                    "health_score",
                    "last_send_at",
                    "last_sync_at",
                    "created_at",
                    "updated_at"
                ],
                "title": "InboxResource"
            },
            "ProvisionWorkspaceRequest": {
                "type": "object",
                "description": "Create body for `POST \/api\/v1\/provisioning\/workspaces` (M35b).\n\n`name` is required; `config` is an optional seed of WHITELISTED workspace\nsettings only. `organization_id` is NEVER accepted from the body \u2014 the org\ncomes from the Tier-P key. Unknown `config` keys are rejected (422) rather than\nsilently dropped, and the whitelist is sourced from {@see WorkspaceProvisioner}\nso the two never drift.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "config": {
                        "type": "object",
                        "properties": {
                            "ai_preferred_provider": {
                                "$ref": "#\/components\/schemas\/AiProvider"
                            },
                            "ai_preferred_model": {
                                "type": "string",
                                "maxLength": 100
                            },
                            "domain_daily_send_limit": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100000
                            },
                            "unsubscribe_footer_enabled": {
                                "type": "boolean"
                            },
                            "message_body_retention_days": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3650
                            }
                        }
                    }
                },
                "required": [
                    "name"
                ],
                "title": "ProvisionWorkspaceRequest"
            },
            "ProvisionedWorkspaceResource": {
                "type": "object",
                "properties": {
                    "workspace": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "uuid": {
                                "type": "string"
                            },
                            "name": {
                                "type": "string"
                            },
                            "organization_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "created_at": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "uuid",
                            "name",
                            "organization_id",
                            "created_at"
                        ]
                    },
                    "api_key": {
                        "type": "object",
                        "properties": {
                            "prefix": {
                                "type": "string"
                            },
                            "plaintext_once": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "prefix",
                            "plaintext_once"
                        ]
                    }
                },
                "required": [
                    "workspace",
                    "api_key"
                ],
                "title": "ProvisionedWorkspaceResource"
            },
            "SeedWorkspaceRequest": {
                "type": "object",
                "description": "Body for `POST \/api\/v1\/provisioning\/workspaces\/{workspace}\/seed` (M35b) \u2014 a\nre-runnable config seed. `config` is required (the request's only purpose) and\nlimited to the same whitelisted settings as the create route; unknown keys are\nrejected (422). Reuses {@see ProvisionWorkspaceRequest}'s shared rules so the\ntwo routes validate config identically.\n\nThe org-tenancy check runs in {@see authorize()} \u2014 BEFORE body validation \u2014 so a\nworkspace belonging to ANOTHER org is a 404 regardless of whether the body is\nvalid. (If the check lived in the controller, an invalid body on a foreign-org\nUUID would 422 while a nonexistent UUID 404s, leaking a cross-org existence\noracle.)",
                "properties": {
                    "config": {
                        "type": "object",
                        "properties": {
                            "ai_preferred_provider": {
                                "$ref": "#\/components\/schemas\/AiProvider"
                            },
                            "ai_preferred_model": {
                                "type": "string",
                                "maxLength": 100
                            },
                            "domain_daily_send_limit": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 100000
                            },
                            "unsubscribe_footer_enabled": {
                                "type": "boolean"
                            },
                            "message_body_retention_days": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3650
                            }
                        }
                    }
                },
                "required": [
                    "config"
                ],
                "title": "SeedWorkspaceRequest"
            },
            "SequenceResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "campaign_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "version_number": {
                        "type": "integer"
                    },
                    "is_published": {
                        "type": "boolean"
                    },
                    "stop_on_reply": {
                        "type": "boolean"
                    },
                    "use_ai_personalization": {
                        "type": "boolean"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "campaign_id",
                    "name",
                    "status",
                    "version_number",
                    "is_published",
                    "stop_on_reply",
                    "use_ai_personalization",
                    "created_at",
                    "updated_at"
                ],
                "title": "SequenceResource"
            },
            "StopEnrollmentRequest": {
                "type": "object",
                "description": "Body for POST \/api\/v1\/enrollments\/{enrollment}\/stop (M34a).\n\n`reason` must be one of the StoppedReason enum values \u2014 it is persisted to the\n`enrollments.stopped_reason` ENUM column, which MySQL would otherwise silently\ntruncate to an empty string for an out-of-range value (mirrors the web stop\ncontroller's guard).",
                "properties": {
                    "reason": {
                        "type": "string",
                        "enum": [
                            "replied",
                            "manual",
                            "bounce",
                            "error",
                            "unsubscribe",
                            "do_not_contact",
                            "not_interested",
                            "suppressed"
                        ]
                    }
                },
                "required": [
                    "reason"
                ],
                "title": "StopEnrollmentRequest"
            },
            "StoreCampaignRequest": {
                "type": "object",
                "description": "Body for POST \/api\/v1\/campaigns (M34a). Minimal CRUD: a name, and an optional\nlifecycle status (defaults to `draft`). Tenancy + uuid are set server-side; a\nclient never supplies app_workspace_id.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "campaign_type": {
                        "type": "string",
                        "enum": [
                            "cold_outreach",
                            "marketing",
                            "transactional"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "active",
                            "paused",
                            "completed",
                            "archived"
                        ]
                    }
                },
                "required": [
                    "name"
                ],
                "title": "StoreCampaignRequest"
            },
            "StoreContactRequest": {
                "type": "object",
                "description": "Create-or-upsert body for POST \/api\/v1\/contacts (M34a).\n\nWhitelists ONLY public, customer-owned contact fields. Identity\/tenancy\n(`app_workspace_id`), provenance (`source`, `lawful_basis`, `import_batch_id`),\ncompliance (`suppressed`, `verified_*`), and sync bookkeeping (`crm_*`) are NOT\naccepted from the client \u2014 the API never sets them and the upserter treats them\nas reserved. `validated()` therefore yields only safe columns.",
                "properties": {
                    "email": {
                        "type": "string",
                        "format": "email",
                        "maxLength": 255
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "company": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "revenue": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "revenue_amount": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "region": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "employee_count": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "sic_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "stage": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_2": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_3": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_json_1": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "custom_fields_json": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "required": [
                    "email"
                ],
                "title": "StoreContactRequest"
            },
            "StoreEnrollmentRequest": {
                "type": "object",
                "description": "Body for POST \/api\/v1\/campaigns\/{campaign}\/enrollments (M34a).\n\nOnly the contact to enroll is accepted; the campaign comes from the route and\nthe contact is resolved under tenant scope in the controller. We deliberately\ndo NOT use an `exists` rule: it bypasses AppWorkspaceScope and would match any\ntenant's contact, turning a 422-vs-404 difference into a cross-workspace\nexistence oracle. A non-existent or cross-workspace id is a uniform 404 from\nthe controller's scoped `findOrFail` instead.",
                "properties": {
                    "contact_id": {
                        "type": "integer"
                    }
                },
                "required": [
                    "contact_id"
                ],
                "title": "StoreEnrollmentRequest"
            },
            "StoreSequenceRequest": {
                "type": "object",
                "description": "Body for POST \/api\/v1\/sequences (M34a). A sequence may optionally belong to a\ncampaign \u2014 `campaign_id` is resolved under tenant scope in the controller (no\n`exists` rule, to avoid a cross-workspace existence oracle). Tenancy is set\nserver-side.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "campaign_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "paused",
                            "archived"
                        ]
                    },
                    "stop_on_reply": {
                        "type": "boolean"
                    },
                    "use_ai_personalization": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "name"
                ],
                "title": "StoreSequenceRequest"
            },
            "StoreWebhookEndpointRequest": {
                "type": "object",
                "description": "Create body for POST \/api\/v1\/webhook-endpoints (M34b).\n\nWhitelists `url` + `events` only. The signing secret is server-generated\n(never client-supplied), tenancy comes from the key, and `status` \/\n`consecutive_failures` are managed internally. The SSRF check on `url` runs in\nthe controller (so a private host renders a 422), since it needs DNS resolution\nbeyond a static rule.",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                    },
                    "events": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "message.sent",
                                "email.opened",
                                "email.clicked",
                                "email.replied",
                                "email.bounced",
                                "contact.created",
                                "enrollment.completed"
                            ]
                        },
                        "minItems": 1
                    }
                },
                "required": [
                    "url",
                    "events"
                ],
                "title": "StoreWebhookEndpointRequest"
            },
            "ThreadResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "inbox_id": {
                        "type": "integer"
                    },
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "subject": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "snippet": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_read": {
                        "type": "boolean"
                    },
                    "is_starred": {
                        "type": "boolean"
                    },
                    "is_spam": {
                        "type": "boolean"
                    },
                    "is_warmup": {
                        "type": "boolean"
                    },
                    "status": {
                        "type": "string"
                    },
                    "reply_category": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "reply_category_set_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "inbox_id",
                    "contact_id",
                    "subject",
                    "snippet",
                    "last_message_at",
                    "is_read",
                    "is_starred",
                    "is_spam",
                    "is_warmup",
                    "status",
                    "reply_category",
                    "reply_category_set_at",
                    "created_at",
                    "updated_at"
                ],
                "title": "ThreadResource"
            },
            "UpdateCampaignRequest": {
                "type": "object",
                "description": "Body for PATCH \/api\/v1\/campaigns\/{campaign} (M34a). Every field optional; a\npartial update touches only the keys supplied.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "active",
                            "paused",
                            "completed",
                            "archived"
                        ]
                    }
                },
                "title": "UpdateCampaignRequest"
            },
            "UpdateContactRequest": {
                "type": "object",
                "description": "Update body for PATCH \/api\/v1\/contacts\/{contact} (M34a).\n\n`email` is the contact's immutable identity key and is NOT accepted here \u2014 the\nroute-bound contact's own email keys the merge. Only the public mutable fields\n(shared with {@see StoreContactRequest}) may be patched; every field is\noptional, so a partial update touches only the keys supplied.",
                "properties": {
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "company": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "industry": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "revenue": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "revenue_amount": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "region": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "country": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "city": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "employee_count": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "sic_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "stage": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_2": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_3": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "custom_json_1": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "custom_fields_json": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "title": "UpdateContactRequest"
            },
            "UpdateSequenceRequest": {
                "type": "object",
                "description": "Body for PATCH \/api\/v1\/sequences\/{sequence} (M34a). Every field optional. The\ncampaign association is immutable on PATCH (no `campaign_id` here), so a patch\ncannot re-parent a sequence into another campaign.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "draft",
                            "published",
                            "paused",
                            "archived"
                        ]
                    },
                    "stop_on_reply": {
                        "type": "boolean"
                    },
                    "use_ai_personalization": {
                        "type": "boolean"
                    }
                },
                "title": "UpdateSequenceRequest"
            },
            "WebhookEndpointResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "url": {
                        "type": "string"
                    },
                    "events": {
                        "type": "array",
                        "items": {}
                    },
                    "status": {
                        "type": "string"
                    },
                    "last_delivery_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "consecutive_failures": {
                        "type": "integer"
                    },
                    "created_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "url",
                    "events",
                    "status",
                    "last_delivery_at",
                    "consecutive_failures",
                    "created_at",
                    "updated_at"
                ],
                "title": "WebhookEndpointResource"
            }
        },
        "responses": {
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "AuthorizationException": {
                "description": "Authorization error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}