{
    "openapi": "3.1.0",
    "info": {
        "title": "WA Orbit API",
        "version": "v1",
        "description": "WA Orbit REST API. Authenticate with a workspace API key: send it as `Authorization: Bearer <key>`. Generate keys in the dashboard under Developers \/ API."
    },
    "servers": [
        {
            "url": "https:\/\/app.waorbit.com\/api\/v1"
        }
    ],
    "tags": [
        {
            "name": "Message",
            "description": "Send a single WhatsApp message \u2014 text, media (image \/ video \/ document \/ audio) or a location pin \u2014 to one number, then read its delivery status or your message history. A file can be attached directly as a multipart `media` field or referenced by a public URL."
        },
        {
            "name": "Template",
            "description": "Create, list and manage your approved WhatsApp templates, and send a template to one number with your own header, body variables and button values. Use this for utility \/ marketing sends that need a pre-approved template \u2014 including one with a PDF \/ document header (pass the file's public URL as the header, e.g. from the Media endpoint)."
        },
        {
            "name": "Media",
            "description": "Upload a file once (multipart \/ form-data, field name `file`, up to 16 MB) and get back a hosted public URL you can reuse across sends \u2014 for example a PDF to use as a document-header on a template, or an image on a message."
        },
        {
            "name": "Contact",
            "description": "Full create \/ read \/ update \/ delete over your contacts and leads, including search by number, tags and custom attributes."
        },
        {
            "name": "ContactGroup",
            "description": "Organise contacts into groups: create groups, list them, and add or remove members \u2014 handy for targeting broadcasts and campaigns."
        },
        {
            "name": "Broadcast",
            "description": "Send the same message to many contacts at once and track each broadcast's progress and per-recipient delivery."
        },
        {
            "name": "Campaign",
            "description": "Create, start, pause and monitor drip \/ marketing campaigns and their recipients."
        },
        {
            "name": "Scheduled",
            "description": "Schedule a WhatsApp send for a future time, list upcoming scheduled messages, and cancel one before it goes out."
        },
        {
            "name": "AutoReply",
            "description": "Manage keyword auto-replies \u2014 the automatic responses that fire when an inbound message matches a rule."
        },
        {
            "name": "Flow",
            "description": "Enroll a contact into an automation flow (chatbot) and manage your flows through the API."
        },
        {
            "name": "Device",
            "description": "List the WhatsApp numbers \/ devices connected to your workspace and check each one's connection status."
        },
        {
            "name": "Webhook",
            "description": "Register and manage webhook endpoints so WA Orbit POSTs real-time events (message received \/ sent \/ delivered \/ read \/ failed, plus campaign and contact events) to your server. When you set a signing secret each delivery carries an HMAC-SHA256 signature header you can verify."
        },
        {
            "name": "Deal",
            "description": "Manage sales-pipeline deals \u2014 create, list, update and move deals between stages."
        },
        {
            "name": "Conversation",
            "description": "Read your workspace inbox: list chat threads (conversations) and fetch the messages inside a thread."
        },
        {
            "name": "Account",
            "description": "Read your account details, plan, limits and message-credit usage."
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "\/me": {
            "get": {
                "operationId": "v1.account.me",
                "description": "data: {\n  account: { name, email },\n  workspace: { id, name, slug, timezone, currency },\n  plan: { id, name, is_free },\n  limits: { <limit_key>: int|null },   \/\/ null = unlimited\n  features: { <feature_key>: bool }    \/\/ unlocked capabilities\n}",
                "summary": "GET \/api\/v1\/me \u2014 the current workspace, its plan and numeric limits",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "account": {
                                                    "type": "object",
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "email": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "name",
                                                        "email"
                                                    ]
                                                },
                                                "workspace": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "slug": {
                                                            "type": "string"
                                                        },
                                                        "timezone": {
                                                            "type": "string"
                                                        },
                                                        "currency": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "slug",
                                                        "timezone",
                                                        "currency"
                                                    ]
                                                },
                                                "plan": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "enum": [
                                                                        "Free"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "is_free": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "is_free"
                                                    ]
                                                },
                                                "limits": {
                                                    "type": "string"
                                                },
                                                "features": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "account",
                                                "workspace",
                                                "plan",
                                                "limits",
                                                "features"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Workspace not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/usage": {
            "get": {
                "operationId": "v1.account.usage",
                "description": "data: {\n  period: { label, resets_on, days_left },\n  messages: { used, limit, unlimited, remaining, percent },\n  credits: int,                         \/\/ owner wallet credits\n  meters: { <key>: { label, used, limit, unlimited, percent } }\n}",
                "summary": "GET \/api\/v1\/usage \u2014 message sends used and remaining this billing month",
                "tags": [
                    "Account"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "period": {
                                                    "type": "object",
                                                    "properties": {
                                                        "label": {
                                                            "type": "string"
                                                        },
                                                        "resets_on": {
                                                            "type": "string"
                                                        },
                                                        "days_left": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "label",
                                                        "resets_on",
                                                        "days_left"
                                                    ]
                                                },
                                                "plan": {
                                                    "type": "object",
                                                    "description": "Plan VALIDITY (subscription expiry) \u2014 distinct from the monthly\nmessage cycle above; a year out for yearly plans. null = no expiry.",
                                                    "properties": {
                                                        "name": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "enum": [
                                                                        "Free"
                                                                    ]
                                                                }
                                                            ]
                                                        },
                                                        "valid_until": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "valid_until_days": {
                                                            "type": [
                                                                "integer",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "name",
                                                        "valid_until",
                                                        "valid_until_days"
                                                    ]
                                                },
                                                "messages": {
                                                    "type": "object",
                                                    "properties": {
                                                        "used": {
                                                            "type": "integer"
                                                        },
                                                        "limit": {
                                                            "type": [
                                                                "integer",
                                                                "null"
                                                            ]
                                                        },
                                                        "unlimited": {
                                                            "type": "boolean"
                                                        },
                                                        "remaining": {
                                                            "type": [
                                                                "object",
                                                                "null"
                                                            ]
                                                        },
                                                        "percent": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "null"
                                                                },
                                                                {
                                                                    "type": "object"
                                                                },
                                                                {
                                                                    "type": "integer",
                                                                    "enum": [
                                                                        0
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "used",
                                                        "limit",
                                                        "unlimited",
                                                        "remaining",
                                                        "percent"
                                                    ]
                                                },
                                                "credits": {
                                                    "type": "integer"
                                                },
                                                "meters": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "period",
                                                "plan",
                                                "messages",
                                                "credits",
                                                "meters"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Workspace not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/auto-replies": {
            "get": {
                "operationId": "v1.auto-replies.index",
                "summary": "GET \/api\/v1\/auto-replies \u2014 list the workspace's auto-replies",
                "tags": [
                    "AutoReply"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {}
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "list_failed"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Could not list auto-replies."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.auto-replies.store",
                "summary": "POST \/api\/v1\/auto-replies \u2014 create an auto-reply",
                "tags": [
                    "AutoReply"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreAutoReplyRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/auto-replies\/{id}": {
            "get": {
                "operationId": "v1.auto-replies.show",
                "summary": "GET \/api\/v1\/auto-replies\/{id} \u2014 one auto-reply",
                "tags": [
                    "AutoReply"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Auto-reply not found."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "v1.auto-replies.update",
                "summary": "PUT \/api\/v1\/auto-replies\/{id} \u2014 update an auto-reply",
                "tags": [
                    "AutoReply"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateAutoReplyRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "meta": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "meta"
                                            ]
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.auto-replies.destroy",
                "summary": "DELETE \/api\/v1\/auto-replies\/{id} \u2014 delete an auto-reply",
                "tags": [
                    "AutoReply"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "deleted"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Auto-reply not found."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/broadcasts": {
            "post": {
                "operationId": "v1.broadcasts.store",
                "summary": "POST \/api\/v1\/broadcasts \u2014 send a template to a list \/ group",
                "tags": [
                    "Broadcast"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreBroadcastRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "meta": {
                                                    "type": "object",
                                                    "properties": {
                                                        "broadcast_ids": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "array",
                                                                    "prefixItems": [
                                                                        {
                                                                            "type": "string"
                                                                        }
                                                                    ],
                                                                    "minItems": 1,
                                                                    "maxItems": 1,
                                                                    "additionalItems": false
                                                                }
                                                            ]
                                                        },
                                                        "devices_count": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "integer",
                                                                    "enum": [
                                                                        1
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "broadcast_ids",
                                                        "devices_count"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "meta"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "broadcast_ids": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "string"
                                                                    },
                                                                    "minItems": 0,
                                                                    "maxItems": 0,
                                                                    "additionalItems": false
                                                                }
                                                            ]
                                                        },
                                                        "devices_count": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "integer",
                                                                    "enum": [
                                                                        1
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "broadcast_ids",
                                                        "devices_count"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "meta"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "get": {
                "operationId": "v1.broadcasts.index",
                "summary": "GET \/api\/v1\/broadcasts \u2014 recent broadcasts for the workspace",
                "tags": [
                    "Broadcast"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/broadcasts\/{id}": {
            "get": {
                "operationId": "v1.broadcasts.show",
                "summary": "GET \/api\/v1\/broadcasts\/{id} \u2014 one broadcast with status counts",
                "tags": [
                    "Broadcast"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Broadcast not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/broadcasts\/{id}\/recipients": {
            "get": {
                "operationId": "v1.broadcasts.recipients",
                "summary": "GET \/api\/v1\/broadcasts\/{id}\/recipients \u2014 per-recipient delivery",
                "tags": [
                    "Broadcast"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "contact_id": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "string",
                                                                "enum": [
                                                                    "pending"
                                                                ]
                                                            }
                                                        ]
                                                    },
                                                    "error": {
                                                        "type": "string"
                                                    },
                                                    "wa_message_id": {
                                                        "type": "string"
                                                    },
                                                    "sent_at": {
                                                        "type": "string"
                                                    },
                                                    "delivered_at": {
                                                        "type": "string"
                                                    },
                                                    "read_at": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "contact_id",
                                                    "status",
                                                    "error",
                                                    "wa_message_id",
                                                    "sent_at",
                                                    "delivered_at",
                                                    "read_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "stats": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "minItems": 0,
                                                            "maxItems": 0,
                                                            "additionalItems": false
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "count",
                                                "stats"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Broadcast not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/broadcasts\/{id}\/stop": {
            "post": {
                "operationId": "v1.broadcasts.stop",
                "summary": "POST \/api\/v1\/broadcasts\/{id}\/stop \u2014 cancel a scheduled \/ in-flight broadcast",
                "tags": [
                    "Broadcast"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_stoppable"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Only scheduled or in-flight broadcasts can be stopped."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Broadcast not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/campaigns\/statistics": {
            "get": {
                "operationId": "v1.campaigns.statistics",
                "summary": "GET \/api\/v1\/campaigns\/statistics \u2014 workspace-wide rollup",
                "tags": [
                    "Campaign"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "anyOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0,
                                                    "additionalItems": false
                                                }
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "stats_failed"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Statistics could not be fetched."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/campaigns": {
            "get": {
                "operationId": "v1.campaigns.index",
                "summary": "GET \/api\/v1\/campaigns \u2014 list the workspace's campaigns",
                "tags": [
                    "Campaign"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {}
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "list_failed"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Campaigns could not be listed."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.campaigns.store",
                "description": "Routes through the web WaCampaignsController::store \u2014 the SINGLE real\ndispatch path. `now` campaigns fire immediately; `scheduled`\/`recurring`\nare armed for the heartbeat sweeper. (The mobile-app controller only\npersists rows and never dispatches, so we deliberately don't use it.)\nThe public `schedule_type=later` maps to the web vocabulary `scheduled`,\nand recipient phone numbers ride in as `manual_numbers` \u2014 the web path\nmaterialises a workspace Contact for each, so sends are always scoped to\nthe caller's own workspace.",
                "summary": "POST \/api\/v1\/campaigns \u2014 create a campaign and dispatch it",
                "tags": [
                    "Campaign"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreCampaignRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "plan_limit"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Campaign plan limit reached."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/campaigns\/{id}": {
            "get": {
                "operationId": "v1.campaigns.show",
                "summary": "GET \/api\/v1\/campaigns\/{id} \u2014 one campaign with counts + metrics",
                "tags": [
                    "Campaign"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "counts": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "minItems": 0,
                                                            "maxItems": 0,
                                                            "additionalItems": false
                                                        }
                                                    ]
                                                },
                                                "metrics": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            },
                                                            "minItems": 0,
                                                            "maxItems": 0,
                                                            "additionalItems": false
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "counts",
                                                "metrics"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Campaign not found."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v1.campaigns.destroy",
                "summary": "DELETE \/api\/v1\/campaigns\/{id} \u2014 delete a scheduled \/ failed \/ completed campaign",
                "tags": [
                    "Campaign"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "deleted": {
                                                            "type": "boolean"
                                                        },
                                                        "message": {
                                                            "anyOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "enum": [
                                                                        "Campaign deleted successfully"
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "deleted",
                                                        "message"
                                                    ]
                                                },
                                                "meta": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "meta"
                                            ]
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/campaigns\/{id}\/stop": {
            "post": {
                "operationId": "v1.campaigns.stop",
                "summary": "POST \/api\/v1\/campaigns\/{id}\/stop \u2014 stop a running \/ scheduled campaign",
                "tags": [
                    "Campaign"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "meta": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "meta"
                                            ]
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/contacts": {
            "get": {
                "operationId": "v1.contacts.index",
                "summary": "GET \/api\/v1\/contacts \u2014 paginated list, optional ?search",
                "tags": [
                    "Contact"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {}
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "page": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ]
                                                },
                                                "per_page": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ]
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "page",
                                                "per_page",
                                                "total",
                                                "last_page"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.contacts.store",
                "summary": "POST \/api\/v1\/contacts \u2014 create a contact",
                "tags": [
                    "Contact"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contacts\/{id}": {
            "get": {
                "operationId": "v1.contacts.show",
                "summary": "GET \/api\/v1\/contacts\/{id} \u2014 read a single contact",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Contact not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "v1.contacts.update",
                "summary": "PUT \/api\/v1\/contacts\/{id} \u2014 update a contact (only present fields)",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateContactRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Contact not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.contacts.destroy",
                "summary": "DELETE \/api\/v1\/contacts\/{id} \u2014 delete a contact",
                "tags": [
                    "Contact"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "deleted"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Contact not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/contact-groups": {
            "get": {
                "operationId": "v1.contact-groups.index",
                "summary": "GET \/api\/v1\/contact-groups \u2014 list groups with member counts",
                "tags": [
                    "ContactGroup"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.contact-groups.store",
                "summary": "POST \/api\/v1\/contact-groups \u2014 create a group",
                "tags": [
                    "ContactGroup"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreContactGroupRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/contact-groups\/{id}": {
            "delete": {
                "operationId": "v1.contact-groups.destroy",
                "summary": "DELETE \/api\/v1\/contact-groups\/{id} \u2014 delete a group + detach it",
                "tags": [
                    "ContactGroup"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "deleted"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Contact group not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/conversations": {
            "get": {
                "operationId": "v1.conversations.index",
                "summary": "GET \/api\/v1\/conversations \u2014 recent chat threads (newest first)",
                "tags": [
                    "Conversation"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "contact": {
                                                        "anyOf": [
                                                            {
                                                                "type": "null"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "items": {}
                                                            },
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "object"
                                                            }
                                                        ]
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "last_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "last_message_at": {
                                                        "type": "string"
                                                    },
                                                    "unread": {
                                                        "type": "integer"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "channel": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "contact",
                                                    "name",
                                                    "last_message",
                                                    "last_message_at",
                                                    "unread",
                                                    "status",
                                                    "channel"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "page",
                                                "per_page",
                                                "total",
                                                "last_page"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/conversations\/{id}\/messages": {
            "get": {
                "operationId": "v1.conversations.messages",
                "summary": "GET \/api\/v1\/conversations\/{id}\/messages \u2014 messages in one thread",
                "tags": [
                    "Conversation"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {}
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "conversation_id": {
                                                    "type": "integer"
                                                },
                                                "page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "conversation_id",
                                                "page",
                                                "per_page",
                                                "total",
                                                "last_page"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Conversation not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/deals": {
            "get": {
                "operationId": "v1.deals.index",
                "summary": "GET \/api\/v1\/deals \u2014 paginated, optional pipeline_id \/ stage_id \/ status",
                "tags": [
                    "Deal"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.deals.store",
                "summary": "POST \/api\/v1\/deals \u2014 create an opportunity",
                "tags": [
                    "Deal"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 191
                                    },
                                    "pipeline_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "stage_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "value": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 99999999
                                    },
                                    "currency": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    },
                                    "contact_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "owner_user_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "expected_close_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/deals\/{id}": {
            "get": {
                "operationId": "v1.deals.show",
                "summary": "GET \/api\/v1\/deals\/{id}",
                "tags": [
                    "Deal"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "v1.deals.update",
                "summary": "PUT \/api\/v1\/deals\/{id} \u2014 update fields (incl. stage to advance it)",
                "tags": [
                    "Deal"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 191
                                    },
                                    "value": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 99999999
                                    },
                                    "currency": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    },
                                    "stage_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "contact_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "owner_user_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "expected_close_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "lost_reason": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 191
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.deals.destroy",
                "summary": "DELETE \/api\/v1\/deals\/{id}",
                "tags": [
                    "Deal"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/devices": {
            "get": {
                "operationId": "v1.devices.index",
                "summary": "GET \/api\/v1\/devices \u2014 list every channel the workspace owns",
                "tags": [
                    "Device"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/devices\/{id}": {
            "get": {
                "operationId": "v1.devices.show",
                "summary": "GET \/api\/v1\/devices\/{id} \u2014 one device",
                "tags": [
                    "Device"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Device not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/flows": {
            "get": {
                "operationId": "v1.flows.index",
                "summary": "GET \/api\/v1\/flows \u2014 list the workspace's flows",
                "tags": [
                    "Flow"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/flows\/{id}": {
            "get": {
                "operationId": "v1.flows.show",
                "summary": "GET \/api\/v1\/flows\/{id} \u2014 one flow",
                "tags": [
                    "Flow"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Flow not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/flows\/{id}\/enroll": {
            "post": {
                "operationId": "v1.flows.enroll",
                "summary": "POST \/api\/v1\/flows\/{id}\/enroll \u2014 enroll a contact (by id or phone) into\nthe flow. Delegates to FlowEnrollmentService::enroll(), which is\nidempotent at the UNIQUE(flow_id, contact_id) constraint and POSTs to\nthe Node flow runtime",
                "tags": [
                    "Flow"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/EnrollFlowRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "string"
                                                },
                                                "contact_id": {
                                                    "type": "integer"
                                                },
                                                "subscriber_id": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "enrolled_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "flow_id",
                                                "contact_id",
                                                "subscriber_id",
                                                "status",
                                                "enrolled_at"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "object",
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "const": "contact_not_found"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "const": "No contact matches that id or phone in this workspace."
                                                        },
                                                        "details": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "code",
                                                        "message",
                                                        "details"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "error"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "object",
                                                    "properties": {
                                                        "code": {
                                                            "type": "string",
                                                            "const": "not_found"
                                                        },
                                                        "message": {
                                                            "type": "string",
                                                            "const": "Flow not found."
                                                        },
                                                        "details": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "code",
                                                        "message",
                                                        "details"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "error"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/flows\/{id}\/subscribers": {
            "get": {
                "operationId": "v1.flows.subscribers",
                "summary": "GET \/api\/v1\/flows\/{id}\/subscribers \u2014 list the flow's subscribers and\ntheir state. Mirrors FlowsController::apiSubscribers",
                "tags": [
                    "Flow"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                },
                                                "counts": {
                                                    "type": "object",
                                                    "properties": {
                                                        "active": {
                                                            "type": "integer",
                                                            "minimum": 0
                                                        },
                                                        "paused": {
                                                            "type": "integer",
                                                            "minimum": 0
                                                        },
                                                        "completed": {
                                                            "type": "integer",
                                                            "minimum": 0
                                                        },
                                                        "failed": {
                                                            "type": "integer",
                                                            "minimum": 0
                                                        }
                                                    },
                                                    "required": [
                                                        "active",
                                                        "paused",
                                                        "completed",
                                                        "failed"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "count",
                                                "counts"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Flow not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/media": {
            "post": {
                "operationId": "v1.media.store",
                "summary": "POST \/api\/v1\/media \u2014 multipart upload (field name: file).\nReturns { url, path, type, mime, size }",
                "tags": [
                    "Media"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application\/octet-stream",
                                        "description": "Max 16 MB \u2014 the WhatsApp document ceiling.",
                                        "maxLength": 16384
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "url": {
                                                    "type": "string"
                                                },
                                                "path": {
                                                    "type": "string"
                                                },
                                                "type": {
                                                    "type": "string",
                                                    "enum": [
                                                        "image",
                                                        "video",
                                                        "audio",
                                                        "document"
                                                    ]
                                                },
                                                "mime": {
                                                    "type": "string"
                                                },
                                                "size": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "url",
                                                "path",
                                                "type",
                                                "mime",
                                                "size"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/messages": {
            "post": {
                "operationId": "v1.messages.store",
                "summary": "POST \/api\/v1\/messages \u2014 send one message (text \/ location)",
                "tags": [
                    "Message"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/SendMessageRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "get": {
                "operationId": "v1.messages.index",
                "summary": "GET \/api\/v1\/messages \u2014 recent message history",
                "tags": [
                    "Message"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/messages\/{id}": {
            "get": {
                "operationId": "v1.messages.show",
                "summary": "GET \/api\/v1\/messages\/{id} \u2014 delivery status of one message",
                "tags": [
                    "Message"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Message not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/scheduled": {
            "post": {
                "operationId": "v1.scheduled.store",
                "summary": "POST \/api\/v1\/scheduled \u2014 schedule a send (template\/message + recipients + run_at)",
                "tags": [
                    "Scheduled"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreScheduledRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "template_not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Template not found in this workspace."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "v1.scheduled.index",
                "summary": "GET \/api\/v1\/scheduled \u2014 list the workspace's scheduled messages",
                "tags": [
                    "Scheduled"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/scheduled\/{id}": {
            "get": {
                "operationId": "v1.scheduled.show",
                "summary": "GET \/api\/v1\/scheduled\/{id} \u2014 one scheduled message",
                "tags": [
                    "Scheduled"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Scheduled message not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "v1.scheduled.destroy",
                "summary": "DELETE \/api\/v1\/scheduled\/{id} \u2014 cancel a future scheduled message",
                "tags": [
                    "Scheduled"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_cancellable"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "This schedule is already finished."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Scheduled message not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/templates": {
            "get": {
                "operationId": "v1.templates.index",
                "summary": "GET \/api\/v1\/templates \u2014 list the workspace's templates",
                "tags": [
                    "Template"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "array",
                                                "items": {}
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "count"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "list_failed"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Templates could not be listed."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.templates.store",
                "summary": "POST \/api\/v1\/templates \u2014 create a template",
                "tags": [
                    "Template"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreTemplateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/templates\/categories": {
            "get": {
                "operationId": "v1.templates.categories",
                "summary": "GET \/api\/v1\/templates\/categories \u2014 the Meta category list",
                "tags": [
                    "Template"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "anyOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0,
                                                    "additionalItems": false
                                                }
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/templates\/{id}\/send": {
            "post": {
                "operationId": "v1.templates.send",
                "summary": "POST \/api\/v1\/templates\/{id}\/send \u2014 send one approved WhatsApp template to a\nsingle recipient with your own variable values (WABA Cloud). This is the\nsingle message + variables send that the list\/broadcast endpoints don't cover",
                "tags": [
                    "Template"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "description": "Recipient phone in international format \u2014 digits or +E.164 (e.g. 919812345678). Required.",
                                        "maxLength": 32
                                    },
                                    "header_text": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Value for a {{1}} in a TEXT header. Only for text-header templates.",
                                        "maxLength": 1024
                                    },
                                    "header_media_url": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "uri",
                                        "description": "Public https URL for an IMAGE \/ VIDEO \/ DOCUMENT header. Only for media-header templates.",
                                        "maxLength": 2048
                                    },
                                    "header_media": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "binary",
                                        "contentMediaType": "application\/octet-stream",
                                        "description": "OR attach the header file (PDF \/ image \/ video) directly in ONE multipart\/form-data\nrequest \u2014 field name `header_media`, up to 16 MB. We host it and use it as the header,\nso you don't need a separate upload call. Takes precedence over header_media_url.",
                                        "maxLength": 16384
                                    },
                                    "header_filename": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Display filename the recipient sees for a DOCUMENT header (e.g. \"Invoice-2045.pdf\").\nOptional \u2014 when you attach header_media we default it to the uploaded file's own name.",
                                        "maxLength": 255
                                    },
                                    "body": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "description": "BODY variables, positional -> {{1}}, {{2}}, ... Send a list [\"John\",\"12345\"]\nor a 1-indexed map {\"1\":\"John\",\"2\":\"12345\"}. Omit if the body has no variables.",
                                        "items": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "maxLength": 1024
                                        }
                                    },
                                    "buttons": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "description": "Dynamic button parameters, one object per variable button, e.g. [{\"index\":0,\"sub_type\":\"url\",\"value\":\"ORDER123\"}].",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "index": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Zero-based position of the button in the template.",
                                                    "minimum": 0
                                                },
                                                "sub_type": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Button kind: \"url\" (dynamic URL suffix) or \"quick_reply\" (payload).",
                                                    "maxLength": 32
                                                },
                                                "value": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "The dynamic value \u2014 URL suffix or quick-reply payload.",
                                                    "maxLength": 2048
                                                }
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "to"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "wamid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "const": "sent"
                                                },
                                                "template_id": {
                                                    "type": "integer"
                                                },
                                                "template_name": {
                                                    "type": "string"
                                                },
                                                "to": {
                                                    "anyOf": [
                                                        {
                                                            "type": "null"
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {}
                                                        },
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "object"
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "wamid",
                                                "status",
                                                "template_id",
                                                "template_name",
                                                "to"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "template_not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Template not found in this workspace."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/templates\/{id}": {
            "get": {
                "operationId": "v1.templates.show",
                "summary": "GET \/api\/v1\/templates\/{id} \u2014 single template detail",
                "tags": [
                    "Template"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Template not found."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "v1.templates.update",
                "summary": "PUT \/api\/v1\/templates\/{id} \u2014 update a template",
                "tags": [
                    "Template"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UpdateTemplateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "meta": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "data",
                                                "meta"
                                            ]
                                        },
                                        {
                                            "type": "string"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.templates.destroy",
                "summary": "DELETE \/api\/v1\/templates\/{id} \u2014 delete a template",
                "tags": [
                    "Template"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "deleted": {
                                                    "type": "boolean"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Template deleted successfully"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "deleted",
                                                "message"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "anyOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "enum": [
                                                                "Template not found."
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "\/webhooks": {
            "get": {
                "operationId": "v1.webhooks.index",
                "summary": "GET \/api\/v1\/webhooks \u2014 list the workspace's registered webhooks",
                "tags": [
                    "Webhook"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "count": {
                                                    "type": "integer"
                                                },
                                                "available_events": {
                                                    "type": "array",
                                                    "items": {}
                                                }
                                            },
                                            "required": [
                                                "count",
                                                "available_events"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "v1.webhooks.store",
                "summary": "POST \/api\/v1\/webhooks \u2014 register a new outbound webhook endpoint",
                "tags": [
                    "Webhook"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/StoreWebhookRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/webhooks\/{id}": {
            "delete": {
                "operationId": "v1.webhooks.destroy",
                "summary": "DELETE \/api\/v1\/webhooks\/{id} \u2014 remove a webhook endpoint",
                "tags": [
                    "Webhook"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "deleted": {
                                                    "type": "boolean"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "deleted"
                                            ]
                                        },
                                        "meta": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "object",
                                            "properties": {
                                                "code": {
                                                    "type": "string",
                                                    "const": "not_found"
                                                },
                                                "message": {
                                                    "type": "string",
                                                    "const": "Webhook not found."
                                                },
                                                "details": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "code",
                                                "message",
                                                "details"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "error"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "EnrollFlowRequest": {
                "type": "object",
                "description": "Enroll a contact into a flow. Scramble reads these rules to document the\nrequest body. Identify the contact by `contact_id` (a contact already in\nthe workspace) OR by `phone` (the contact is looked up by its E.164\nnumber). Exactly one is required; the controller resolves it to a Contact\nand hands it to FlowEnrollmentService::enroll().",
                "properties": {
                    "contact_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Id of an existing contact in the workspace. Required unless `phone` is given."
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Contact phone in international format (digits, E.164). Used to look up\nthe contact when `contact_id` is omitted. Required unless `contact_id` is given.",
                        "maxLength": 32
                    }
                },
                "title": "EnrollFlowRequest"
            },
            "SendMessageRequest": {
                "type": "object",
                "description": "Send a single WhatsApp message. Scramble reads these rules to document the\nrequest body. Supports text, media (by URL) and location; template\/bulk\nsends use the \/templates + \/broadcasts endpoints.",
                "properties": {
                    "to": {
                        "type": "string",
                        "description": "Recipient phone in international format (digits, E.164). Required.",
                        "maxLength": 32
                    },
                    "device_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Sending sender (optional \u2014 defaults to the workspace's primary).\nAccepts a Baileys device id (57), a WABA\/Twilio provider-config id\n(\"cfg_20\" or a bare 20), or an \"engine:id\" key \u2014 resolved across\nboth the devices + wa_provider_configs tables. String, not int,\nso the \"cfg_20\" form from \/api\/v1\/devices is accepted.",
                        "maxLength": 40
                    },
                    "type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Message type. Defaults to \"text\".",
                        "enum": [
                            "text",
                            "image",
                            "video",
                            "document",
                            "audio",
                            "location"
                        ]
                    },
                    "text": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Text body (required for text; used as caption for media).",
                        "maxLength": 4096
                    },
                    "media": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "binary",
                        "contentMediaType": "application\/octet-stream",
                        "description": "Image \/ video \/ document \/ audio sends \u2014 EITHER way:\nmedia     \u2014 attach the file directly (multipart upload, max 16 MB), OR\nmedia_url \u2014 a public URL we download for you.\nNo need to host the file first; just send `media` in the same call.",
                        "maxLength": 16384
                    },
                    "media_url": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "uri",
                        "maxLength": 2048
                    },
                    "latitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "Location (when type=location).",
                        "minimum": -90,
                        "maximum": 90
                    },
                    "longitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": -180,
                        "maximum": 180
                    }
                },
                "required": [
                    "to"
                ],
                "title": "SendMessageRequest"
            },
            "StoreAutoReplyRequest": {
                "type": "object",
                "description": "Create a keyword auto-reply. Scramble reads these rules to document the\nrequest body. Mirrors the input keys the existing\nAutoreplyController::store accepts, exposed under public-facing names. A\n\"custom\" reply carries one or more `replies[]` text variants; a \"flow\"\nreply points at a saved flow_id.",
                "properties": {
                    "keyword": {
                        "type": "string",
                        "description": "Trigger keyword(s). Comma-separated phrases are allowed. Required.",
                        "maxLength": 255
                    },
                    "matching_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "How the inbound message is matched against the keyword. Defaults to exact.",
                        "enum": [
                            "fuzzy",
                            "exact",
                            "contains"
                        ]
                    },
                    "fuzzy_similarity": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Fuzzy match threshold 0-100 (only used when matching_method=fuzzy).",
                        "minimum": 0,
                        "maximum": 100
                    },
                    "device_id": {
                        "type": "string",
                        "description": "Sending device id. Required."
                    },
                    "status": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the rule is active. Defaults to true."
                    },
                    "reply_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reply kind: \"custom\" (text variants) or \"flow\" (a saved flow). Defaults to custom.",
                        "enum": [
                            "custom",
                            "flow"
                        ]
                    },
                    "flow_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Flow id to run (required when reply_type=flow).\nScope to the caller's workspace so an auto-reply can't reference\nanother tenant's flow (was a bare `integer` with no ownership)."
                    },
                    "replies": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Reply text variants (for reply_type=custom). At least one required for custom.",
                        "items": {
                            "type": "string",
                            "maxLength": 4096
                        }
                    }
                },
                "required": [
                    "keyword",
                    "device_id"
                ],
                "title": "StoreAutoReplyRequest"
            },
            "StoreBroadcastRequest": {
                "type": "object",
                "description": "Create a broadcast \u2014 send one template to a list of contacts and\/or a\ncontact group. Scramble reads these rules to document the request body.\n\nMirrors the input keys the existing BroadcastsController::store accepts\n(broadcast_name \/ template_id \/ contacts[] \/ groups[] \/ device_id \/\nschedule_type+send_date+send_time \/ timezone), exposed under public-facing\nnames. At least one of `recipients` or `group_id` is required; provide\n`schedule_at` to schedule for later, omit it to send now.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Broadcast label shown in the dashboard. Required.",
                        "maxLength": 255
                    },
                    "template_id": {
                        "type": "integer",
                        "description": "Approved WaTemplate id to send to every recipient. Required."
                    },
                    "group_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Contact-group id \u2014 every member is added as a recipient."
                    },
                    "device_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Sending device id (optional \u2014 defaults to the workspace's primary device)."
                    },
                    "schedule_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "When to send \u2014 ISO 8601 \/ parseable datetime. Omit to send immediately.",
                        "maxLength": 64
                    },
                    "timezone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "IANA timezone for schedule_at (e.g. Asia\/Kolkata). Defaults to UTC.",
                        "maxLength": 64
                    },
                    "recipients": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Recipient contact ids. Required unless `group_id` is given.",
                        "items": {
                            "type": "integer"
                        }
                    }
                },
                "required": [
                    "name",
                    "template_id"
                ],
                "title": "StoreBroadcastRequest"
            },
            "StoreCampaignRequest": {
                "type": "object",
                "description": "Create a campaign \u2014 a multi-recipient send (template, custom message or\nflow) with optional A\/B testing. Scramble reads these rules to document the\nrequest body.\n\nMirrors the input keys the existing App\\CampaignController::store accepts\n(campaign_name \/ device_id \/ campaign_type \/ schedule_type \/ template_id(s) \/\nflow_id \/ custom_message \/ send_date+send_time \/ timezone \/ ab_* \/ contacts),\nexposed under public-facing names. Recipients are supplied as a list of\nphone numbers in international format.",
                "properties": {
                    "campaign_name": {
                        "type": "string",
                        "description": "Campaign label shown in the dashboard. Required.",
                        "maxLength": 255
                    },
                    "device_id": {
                        "type": "string",
                        "description": "Sending device \u2014 the device's phone number or id. Required."
                    },
                    "campaign_type": {
                        "type": "string",
                        "description": "What the campaign sends. Required.",
                        "enum": [
                            "custom",
                            "template",
                            "flow"
                        ]
                    },
                    "schedule_type": {
                        "type": "string",
                        "description": "When to send: now, later (needs send_date+send_time), or recurring. Required.",
                        "enum": [
                            "now",
                            "later",
                            "recurring"
                        ]
                    },
                    "template_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "WaTemplate id (required for non-A\/B template campaigns)."
                    },
                    "template_id_a": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "A\/B testing: the two competing WaTemplate ids."
                    },
                    "template_id_b": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "flow_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Flow id (required for flow campaigns)."
                    },
                    "custom_message": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text message body (required for custom campaigns).",
                        "maxLength": 4096
                    },
                    "send_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time",
                        "description": "Date to send on (Y-m-d) \u2014 required when schedule_type=later."
                    },
                    "send_time": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Time to send at (HH:MM) \u2014 required when schedule_type=later.",
                        "maxLength": 16
                    },
                    "timezone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "IANA timezone for send_date\/send_time. Defaults to UTC.",
                        "maxLength": 64
                    },
                    "ab_testing": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Enable A\/B testing (template campaigns only)."
                    },
                    "ab_split": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Percentage of recipients sent variant A (10-90). Defaults to 50.",
                        "minimum": 10,
                        "maximum": 90
                    },
                    "contacts": {
                        "type": "array",
                        "description": "Recipient phone numbers in international format. At least one required.",
                        "items": {
                            "type": "string",
                            "maxLength": 32
                        },
                        "minItems": 1
                    }
                },
                "required": [
                    "campaign_name",
                    "device_id",
                    "campaign_type",
                    "schedule_type",
                    "contacts"
                ],
                "title": "StoreCampaignRequest"
            },
            "StoreContactGroupRequest": {
                "type": "object",
                "description": "Create a contact group in the current workspace. Scramble reads these rules\nto document the request body. Mirrors ContactsController::groupStore.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Group name. Required.",
                        "maxLength": 191
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional note\/description for the group.",
                        "maxLength": 500
                    },
                    "color": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional UI colour (hex or token, e.g. #2563eb).",
                        "maxLength": 32
                    }
                },
                "required": [
                    "name"
                ],
                "title": "StoreContactGroupRequest"
            },
            "StoreContactRequest": {
                "type": "object",
                "description": "Create a contact in the current workspace. Scramble reads these rules to\ndocument the request body. Mirrors the validation in the existing\nContactsController::store.",
                "properties": {
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Contact's full display name. Required when first_name is omitted.",
                        "maxLength": 191
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional name parts. Combined into `name` when `name` is blank.",
                        "maxLength": 191
                    },
                    "middle_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 191
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 191
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional salutation\/title (e.g. Mr, Dr).",
                        "maxLength": 50
                    },
                    "phone": {
                        "type": "string",
                        "description": "Phone number in international format (digits, E.164). Required.",
                        "maxLength": 32
                    },
                    "country_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Country dial code (e.g. +91). Prefixed onto the phone if missing.",
                        "maxLength": 10
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "description": "Optional email address.",
                        "maxLength": 191
                    },
                    "language": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional preferred language \/ locale.",
                        "maxLength": 80
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional postal address.",
                        "maxLength": 1000
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional free-text note attached to the contact.",
                        "maxLength": 2000
                    },
                    "attributes": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Free-form key\/value attributes stored against the contact.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "is_unsubscribed": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the contact has opted out of messages. Defaults to false."
                    },
                    "group_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Group ids the contact belongs to. Each must exist.",
                        "items": {
                            "type": "integer",
                            "description": "Scope the existence check to the caller's workspace so a foreign\ngroup id is rejected (was a global `exists` \u2192 cross-tenant ref)."
                        }
                    }
                },
                "required": [
                    "phone"
                ],
                "title": "StoreContactRequest"
            },
            "StoreScheduledRequest": {
                "type": "object",
                "description": "Schedule a WhatsApp send for later. Scramble reads these rules to document\nthe request body. Mirrors the input keys the existing\nQueueController::scheduleMessage accepts (name \/ message \/ template_id \/\nrecipients \/ send_at \/ timezone \/ device_id), exposed under public-facing\nnames. A template OR a message body is required.",
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "Schedule label. Required.",
                        "maxLength": 255
                    },
                    "message": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Body text (required unless a template_id is given). Max 4096 chars.",
                        "maxLength": 4096
                    },
                    "template_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "WaTemplate id to send instead of free text (optional)."
                    },
                    "device_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Sending device id (optional \u2014 defaults to the workspace's connected device)."
                    },
                    "run_at": {
                        "type": "string",
                        "description": "When to send \u2014 ISO 8601 \/ parseable datetime interpreted in `timezone`. Required.",
                        "maxLength": 64
                    },
                    "timezone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "IANA timezone for run_at (e.g. Asia\/Kolkata). Defaults to the workspace timezone.",
                        "maxLength": 64
                    },
                    "recipients": {
                        "type": "array",
                        "description": "Recipient phone numbers in international format. At least one required.",
                        "items": {
                            "type": "string",
                            "maxLength": 32
                        },
                        "minItems": 1
                    }
                },
                "required": [
                    "name",
                    "run_at",
                    "recipients"
                ],
                "title": "StoreScheduledRequest"
            },
            "StoreTemplateRequest": {
                "type": "object",
                "description": "Create a WhatsApp message template. Scramble reads these rules to document\nthe request body. Mirrors the existing TemplateController::store validation.",
                "properties": {
                    "template_name": {
                        "type": "string",
                        "description": "Template name. Required.",
                        "maxLength": 191
                    },
                    "template_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Template type. Defaults to \"standard\".",
                        "enum": [
                            "standard",
                            "carousel",
                            "media",
                            "auth"
                        ]
                    },
                    "category": {
                        "type": "string",
                        "description": "Category \u2014 Meta numeric id (1\/2\/3), meta slug, or industry bucket. Required."
                    },
                    "header": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional header text (max 255 chars).",
                        "maxLength": 255
                    },
                    "template_body": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Body text (required for standard templates, max 4096 chars).",
                        "maxLength": 4096
                    },
                    "footer": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional footer text (max 255 chars).",
                        "maxLength": 255
                    },
                    "language": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Language code (e.g. en_US). Defaults to en_US.",
                        "maxLength": 16
                    },
                    "buttons": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Buttons \u2014 CTA \/ quick-reply array (or parallel-array form)."
                    },
                    "quick_replies": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Quick-reply buttons (folded into buttons[])."
                    },
                    "carousel_data": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Carousel cards payload (for carousel templates)."
                    },
                    "latitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "LOCATION header \u2014 send a map pin. Provide latitude + longitude\n(both required together) with an optional name + address.",
                        "minimum": -90,
                        "maximum": 90
                    },
                    "longitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": -180,
                        "maximum": 180
                    },
                    "location_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 191
                    },
                    "location_address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    }
                },
                "required": [
                    "template_name",
                    "category"
                ],
                "title": "StoreTemplateRequest"
            },
            "StoreWebhookRequest": {
                "type": "object",
                "description": "Register an outbound webhook endpoint for the current workspace. Scramble\nreads these rules to document the request body. Mirrors the validation in\nthe in-app WebhooksController::store.\n\nThe platform POSTs a JSON envelope to the registered `url` whenever a\nsubscribed event fires. When a signing `secret` is configured the request\ncarries an `X-WA Orbit-Signature` header (HMAC-SHA256 of the body).",
                "properties": {
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Public HTTPS endpoint the platform POSTs events to. Required.",
                        "maxLength": 2048
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional friendly label shown in the dashboard.",
                        "maxLength": 191
                    },
                    "secret": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional HMAC signing secret. When set, deliveries carry an\nX-WA Orbit-Signature header so receivers can verify authenticity.",
                        "maxLength": 191
                    },
                    "active": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the endpoint is active and should receive events.\nDefaults to true."
                    },
                    "events": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Event names to subscribe to. Omit (or pass [\"*\"]) to receive all.\nSupported events fired by the system:\nmessage_received                 \u2014 inbound message received\nmessage_sent                     \u2014 outbound message sent\nmessage_delivered                \u2014 outbound message delivered\nmessage_read                     \u2014 outbound message read\nmessage_failed                   \u2014 outbound message failed\nbroadcast_created                \u2014 broadcast created\nbroadcast_status_updated         \u2014 broadcast status changed\nbroadcast_message_status_updated \u2014 per-recipient broadcast status changed\ncampaign_created                 \u2014 campaign created\ncampaign_status_updated          \u2014 campaign status changed\ncampaign_contact_status_updated  \u2014 per-contact campaign status changed\ncampaign_contact_clicked         \u2014 campaign contact clicked a link\ncampaign_contact_replied         \u2014 campaign contact replied\ncontact_opt_in                   \u2014 contact opted in\ncontact_updated                  \u2014 contact updated\ndevice_status_updated            \u2014 device (number) status changed\n\"*\"                              \u2014 subscribe to every event",
                        "items": {
                            "type": "string",
                            "maxLength": 64
                        }
                    }
                },
                "required": [
                    "url"
                ],
                "title": "StoreWebhookRequest"
            },
            "UpdateAutoReplyRequest": {
                "type": "object",
                "description": "Update a keyword auto-reply. Scramble reads these rules to document the\nrequest body. Same shape as StoreAutoReplyRequest \u2014 the underlying\nAutoreplyController::update replaces the rule's settings and appends any new\n`replies[]` text variants.",
                "properties": {
                    "keyword": {
                        "type": "string",
                        "description": "Trigger keyword(s). Comma-separated phrases are allowed. Required.",
                        "maxLength": 255
                    },
                    "matching_method": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "How the inbound message is matched against the keyword. Defaults to exact.",
                        "enum": [
                            "fuzzy",
                            "exact",
                            "contains"
                        ]
                    },
                    "fuzzy_similarity": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Fuzzy match threshold 0-100 (only used when matching_method=fuzzy).",
                        "minimum": 0,
                        "maximum": 100
                    },
                    "device_id": {
                        "type": "string",
                        "description": "Sending device id. Required."
                    },
                    "status": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the rule is active. Defaults to true."
                    },
                    "reply_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Reply kind: \"custom\" (text variants) or \"flow\" (a saved flow). Defaults to custom.",
                        "enum": [
                            "custom",
                            "flow"
                        ]
                    },
                    "flow_id": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "Flow id to run (required when reply_type=flow).\nScope to the caller's workspace so an auto-reply can't reference\nanother tenant's flow (was a bare `integer` with no ownership)."
                    },
                    "replies": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Reply text variants (for reply_type=custom). At least one required for custom.",
                        "items": {
                            "type": "string",
                            "maxLength": 4096
                        }
                    }
                },
                "required": [
                    "keyword",
                    "device_id"
                ],
                "title": "UpdateAutoReplyRequest"
            },
            "UpdateContactRequest": {
                "type": "object",
                "description": "Update an existing contact in the current workspace. Every field is\noptional \u2014 only the keys present in the request body are changed. Scramble\nreads these rules to document the request body.",
                "properties": {
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Contact's full display name.",
                        "maxLength": 191
                    },
                    "first_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional name parts.",
                        "maxLength": 191
                    },
                    "middle_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 191
                    },
                    "last_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 191
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional salutation\/title (e.g. Mr, Dr).",
                        "maxLength": 50
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Phone number in international format (digits, E.164).",
                        "maxLength": 32
                    },
                    "country_code": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Country dial code (e.g. +91). Prefixed onto the phone if missing.",
                        "maxLength": 10
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "description": "Email address.",
                        "maxLength": 191
                    },
                    "language": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Preferred language \/ locale.",
                        "maxLength": 80
                    },
                    "address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Postal address.",
                        "maxLength": 1000
                    },
                    "note": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Free-text note attached to the contact.",
                        "maxLength": 2000
                    },
                    "attributes": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Free-form key\/value attributes stored against the contact.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "is_unsubscribed": {
                        "type": [
                            "boolean",
                            "null"
                        ],
                        "description": "Whether the contact has opted out of messages."
                    },
                    "group_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Group ids the contact belongs to (replaces the existing set).",
                        "items": {
                            "type": "integer",
                            "description": "Scope the existence check to the caller's workspace so a foreign\ngroup id is rejected (was a global `exists` \u2192 cross-tenant ref)."
                        }
                    }
                },
                "title": "UpdateContactRequest"
            },
            "UpdateTemplateRequest": {
                "type": "object",
                "description": "Update a WhatsApp message template. Scramble reads these rules to document\nthe request body. Mirrors the existing TemplateController::update validation.",
                "properties": {
                    "template_name": {
                        "type": "string",
                        "description": "Template name. Required.",
                        "maxLength": 191
                    },
                    "template_type": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Template type. Defaults to the existing value.",
                        "enum": [
                            "standard",
                            "carousel",
                            "media",
                            "auth"
                        ]
                    },
                    "category": {
                        "type": "string",
                        "description": "Category \u2014 Meta numeric id (1\/2\/3), meta slug, or industry bucket. Required."
                    },
                    "header": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional header text (max 255 chars).",
                        "maxLength": 255
                    },
                    "template_body": {
                        "type": "string",
                        "description": "Body text. Required (max 4096 chars).",
                        "maxLength": 4096
                    },
                    "footer": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional footer text (max 255 chars).",
                        "maxLength": 255
                    },
                    "language": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Language code (e.g. en_US). Defaults to the existing value.",
                        "maxLength": 16
                    },
                    "buttons": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Buttons \u2014 CTA \/ quick-reply array (or parallel-array form)."
                    },
                    "quick_replies": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Quick-reply buttons (folded into buttons[])."
                    },
                    "carousel_data": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Carousel cards payload (for carousel templates)."
                    },
                    "latitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "LOCATION header \u2014 send a map pin. Provide latitude + longitude\n(both required together) with an optional name + address.",
                        "minimum": -90,
                        "maximum": 90
                    },
                    "longitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": -180,
                        "maximum": 180
                    },
                    "location_name": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 191
                    },
                    "location_address": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    }
                },
                "required": [
                    "template_name",
                    "category",
                    "template_body"
                ],
                "title": "UpdateTemplateRequest"
            }
        },
        "responses": {
            "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"
                            ]
                        }
                    }
                }
            }
        }
    }
}