{
    "schemes": [
        "https"
    ],
    "swagger": "2.0",
    "info": {
        "description": "Send and receive SMS through user-linked Android devices.\nAuthenticate with `X-API-Key: atx_...` (preferred for integrations)\nOR `Authorization: Bearer \u003cjwt\u003e`. Generate API keys at\nhttps://androidtexter.com/dashboard/settings/api-keys.",
        "title": "Android Texter API",
        "termsOfService": "https://androidtexter.com/terms",
        "contact": {
            "name": "Android Texter Support",
            "email": "support@androidtexter.com"
        },
        "license": {
            "name": "Proprietary"
        },
        "version": "1.0.0"
    },
    "host": "androidtexter.com",
    "basePath": "/api",
    "paths": {
        "/api/me/attribution": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "tags": [
                    "account"
                ],
                "summary": "Report signup attribution",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/me/heard-from": {
            "get": {
                "tags": [
                    "account"
                ],
                "summary": "How the customer heard about us",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "tags": [
                    "account"
                ],
                "summary": "Answer \"How did you hear about us?\"",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/api/onboarding": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account"
                ],
                "summary": "First-run help state",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "account"
                ],
                "summary": "Change first-run help choices",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/contacts": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Paginated list of contacts with optional name/phone search and tag filter.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "List contacts",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Substring match against name or phone",
                        "name": "search",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Filter to contacts carrying this tag",
                        "name": "tag",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page, default 1",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "Page size, default 50",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ contacts: [...], total, page }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Upserts by phone: if a contact with this phone already exists, it's updated. Tags are merged. Use for \"Zapier add-to-contacts\" style integrations.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "contacts"
                ],
                "summary": "Create or upsert a contact",
                "parameters": [
                    {
                        "description": "Contact fields (phone required)",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.ContactRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/devices/{id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns details for a single device by ID.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "devices"
                ],
                "summary": "Get one device",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Device ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ device: {...} }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/me": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns the calling user's profile, subscription tier, today's usage, and device count. Cheap auth-test endpoint for integrations.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "auth"
                ],
                "summary": "Current user",
                "responses": {
                    "200": {
                        "description": "{ user, subscription, usage_today, ... }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Paginated messages across all paired devices in both directions, newest first. A message with a picture or video attached carries media_url (a signed, ready-to-fetch HTTPS link, no auth needed) and media_type alongside the text.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List all messages",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Page size, 1-100, default 50",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page, default 1",
                        "name": "page",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageListResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/broadcast": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Sends the same message to up to 500 recipients. The body supports per-recipient personalization tokens ({{first_name}}, {{last_name}}, {{full_name}}, {{name}}, {{company}}, {{city}}, {{state}}) resolved from the contact row; use {{first_name|there}} for a fallback. device_mode is \"auto\" (first online device, default), \"specific\" (requires device_id) or \"round-robin\". Responds with sent and failed counts and a per-recipient results array of {phone, message_id, status, device_id, error}.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Send a broadcast",
                "parameters": [
                    {
                        "description": "{phones: []string (max 500), message: string (max 1600), media_url?: string, device_id?: string, device_mode?: auto|specific|round-robin}",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "object"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{sent, failed, results: [{phone, message_id, status, device_id, error}]}",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/conversations": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "The conversation list, newest activity first. `view` selects a folder: `inbox` (someone has replied), `outbox` (nothing has ever come back), `archived`, `spam`, or `all` (everything except archived and spam). The older `filter` parameter still works unchanged: `inbox` (default) is everything except spam, `spam` is only spam, `all` is everything including spam.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List conversations",
                "parameters": [
                    {
                        "type": "string",
                        "description": "inbox | outbox | archived | spam | all",
                        "name": "view",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Legacy: inbox | spam | all",
                        "name": "filter",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-2000, default 50",
                        "name": "limit",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ conversations: [...] }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/messages/conversations/archive": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Puts a conversation in the Archived folder, or takes it out again. Archiving only affects which folder the conversation appears in: notifications are unchanged, linked phones are not told, and the conversation is still returned by `view=all`. An incoming message un-archives it automatically. Identify the conversation by `thread_ref`, by `thread_id`, or by `phone`.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Archive or unarchive a conversation",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Conversation id, as returned by /messages/conversations",
                        "name": "thread_ref",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phone number, if the conversation id is not known",
                        "name": "phone",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phone-side thread id, if the conversation id is not known",
                        "name": "thread_id",
                        "in": "query"
                    },
                    {
                        "type": "boolean",
                        "description": "true to archive (the default), false to unarchive",
                        "name": "archived",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ success, thread_ref, archived }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "no such conversation",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/conversations/archived": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Every archived conversation, as identities only: the member phone numbers, the handset thread id when one is known, and when it was archived. The mobile app reconciles its local archive flags against this, the same way it reconciles spam against `/spam/threads`. Unlike `view=archived` this is not capped and does include conversations that are also flagged as spam.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List archived conversations",
                "responses": {
                    "200": {
                        "description": "{ threads: [{ phone, thread_id, archived_at }] }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/conversations/counts": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "How many conversations are in each folder: inbox, outbox, archived, spam, and all. A conversation whose only message is a scheduled send that has not gone yet is in none of them, the same as in the list itself.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Conversation counts per view",
                "responses": {
                    "200": {
                        "description": "{ counts: { all, inbox, outbox, archived, spam } }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/messages/received": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Paginated inbound messages across all paired devices, newest first. A message with a picture or video attached carries media_url (a signed, ready-to-fetch HTTPS link, no auth needed) and media_type alongside the text. Intended for polling triggers.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List received messages",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Page size, 1-100, default 50",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page, default 1",
                        "name": "page",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageListResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/scheduled": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Every message of yours that is still waiting to be sent at a future time, soonest first. A message that has already fired, been cancelled, or expired is not listed.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List scheduled messages",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ScheduledMessagesResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/scheduled/{id}": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Calls off a message that has not gone out yet. The message stays on record with scheduler_status=cancelled rather than being deleted. Only the owner of the message can cancel it.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Cancel a scheduled message",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Message id returned by the send or list call",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageActionResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "no pending scheduled message with that id for this user",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/search": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Full-text search over the body of every message on the account, inbound and outbound, newest first. A matching picture message carries media_url (a signed, ready-to-fetch HTTPS link, no auth needed) and media_type alongside the text.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Search messages",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Search text, matched against the message body",
                        "name": "q",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, 1-100, default 50",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page, default 1",
                        "name": "page",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageSearchResponse"
                        }
                    },
                    "400": {
                        "description": "q is missing",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/sent": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Paginated outbound messages across all paired devices, newest first. A message with a picture or video attached carries media_url (a signed, ready-to-fetch HTTPS link, no auth needed) and media_type alongside the text.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "List sent messages",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "Page size, 1-100, default 50",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page, default 1",
                        "name": "page",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageListResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/messages/thread": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "The same conversation the history endpoint returns, addressed by query parameter so a \"+\" in the number needs no URL encoding, and with a page cap of 5000 for loading a whole thread at once. A message with a picture or video attached carries media_url (a signed, ready-to-fetch HTTPS link, no auth needed) and media_type alongside the text.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Conversation by phone, as a query parameter",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Phone number, any reasonable format. A group conversation is its members comma-joined.",
                        "name": "phone",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, 1-5000, default 200",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page, default 1",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group conversations only: the thread_id from an inbound message.",
                        "name": "thread_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "The thread_ref from a message. Preferred over thread_id and phone when known.",
                        "name": "thread_ref",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ThreadResponse"
                        }
                    },
                    "400": {
                        "description": "phone is missing",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quick-replies": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quick-replies"
                ],
                "summary": "List quick replies",
                "responses": {
                    "200": {
                        "description": "{ quick_replies: [QuickReplyResponse, ...] }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Shortcuts must be unique per user. Use the shortcut as a `/shortcut` in the in-app composer to expand the body.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quick-replies"
                ],
                "summary": "Create a quick reply",
                "parameters": [
                    {
                        "description": "Shortcut, title, body",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateQuickReplyRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "{ quick_reply: QuickReplyResponse }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "shortcut already exists",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/quick-replies/{id}": {
            "put": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quick-replies"
                ],
                "summary": "Update a quick reply",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Quick reply ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Updated shortcut, title, body",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.UpdateQuickReplyRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "quick-replies"
                ],
                "summary": "Delete a quick reply",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Quick reply ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ success: true }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    }
                }
            }
        },
        "/spam/flag": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Hides the thread from the inbox and suppresses notifications. When the user has enabled `default_spam_live_mode`, this ALSO starts the AI evidence-collection agent (response field `engaged` will be true).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "spam"
                ],
                "summary": "Flag a phone as spam",
                "parameters": [
                    {
                        "description": "Phone number to flag",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.FlagSpamRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FlagSpamResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "rate limit",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/spam/threads": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns every phone number the calling user has flagged as spam, newest-first. Used by the mobile app to reconcile local state.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "spam"
                ],
                "summary": "List spam-flagged phones",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SpamThreadsResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/spam/unflag": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Removes a thread from the spam folder. Any active AI engagement on this phone is left as-is.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "spam"
                ],
                "summary": "Unflag a phone (remove from spam)",
                "parameters": [
                    {
                        "description": "Phone number to unflag",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.FlagSpamRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.FlagSpamResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/devices": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns every Android device linked to the calling user's account, including online/offline status and the last-seen timestamp.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "devices"
                ],
                "summary": "List linked Android devices",
                "responses": {
                    "200": {
                        "description": "{ devices: [DeviceSummary, ...] }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/messages/history/{phone}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Paginated message history (inbound + outbound) with one specific phone number. Newest-first. Phone is normalized server-side, so any reasonable format works. A message with a picture or video attached carries media_url (a signed, ready-to-fetch HTTPS link, no auth needed) and media_type alongside the text, so an assistant reading a conversation can fetch the image itself.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Conversation history for one phone",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Phone number (e.g. +15551234567)",
                        "name": "phone",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "Page size, 1-100, default 50",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "1-indexed page number, default 1",
                        "name": "page",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Group conversations only: the thread_id from an inbound message. Returns that group's messages instead of the one-to-one thread with phone.",
                        "name": "thread_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "The thread_ref from a message. Preferred over thread_id when both are known.",
                        "name": "thread_ref",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.ConversationHistoryResponse"
                        }
                    },
                    "400": {
                        "description": "phone is missing",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/messages/send": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Queues a message for the user's linked Android device. If `device_id` is omitted, the first online device is selected. Include `media_url` to send MMS. Include `scheduled_at` (ISO 8601) to schedule for later. Free-tier users are capped at the daily limit (HTTP 429 if exceeded).",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Send an SMS or MMS",
                "parameters": [
                    {
                        "description": "Recipient phone, body, and optional device / media / schedule",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.SendMessageRequest"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.SendMessageResponse"
                        }
                    },
                    "400": {
                        "description": "validation failure (missing field, body \u003e 1600 chars)",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "missing or invalid auth",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "rate limit or free-tier daily cap",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "no online device available",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/messages/status/{id}": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns the current status (queued/sent/delivered/failed) for a previously-sent message.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Get message delivery status",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Message ID returned by /messages/send",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/handlers.MessageStatusResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/messages/thread": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Permanently deletes a conversation and all of its messages for this account, and tells every linked phone to delete its own copy (by push, and by the phone's next heartbeat if the push is lost). Identify the conversation by `thread_ref`, by `thread_id`, or by `phone`. Deleting is not reversible and a repeat delete of the same conversation returns 404.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "messages"
                ],
                "summary": "Delete a conversation",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Conversation id, as returned by /messages/conversations",
                        "name": "thread_ref",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phone number, if the conversation id is not known",
                        "name": "phone",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "Phone-side thread id, if the conversation id is not known",
                        "name": "thread_id",
                        "in": "query"
                    },
                    {
                        "type": "string",
                        "description": "The phone that already deleted its own copy; it is not told to delete it again",
                        "name": "device_id",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ success, thread_ref, messages_deleted, devices_notified, devices_pending_update }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "no such conversation, or already deleted",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/webhooks": {
            "post": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Creates an outbound webhook subscription. Defaults to subscribing to `message.received` and `message.sent` if `events` is omitted. The `secret` in the response is shown ONCE, store it and use it to verify HMAC signatures on incoming webhook deliveries.",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "webhooks"
                ],
                "summary": "Register a webhook",
                "parameters": [
                    {
                        "description": "Webhook URL and subscribed event names",
                        "name": "request",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/handlers.CreateWebhookRequest"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "{ webhook: {...}, secret, message }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/v1/webhooks/{id}": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "webhooks"
                ],
                "summary": "Delete a webhook",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Webhook ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ success: true }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/webhooks": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Returns every webhook subscription belonging to the calling user.",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "webhooks"
                ],
                "summary": "List webhooks",
                "responses": {
                    "200": {
                        "description": "{ webhooks: [...] }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/webhooks/{id}": {
            "delete": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "webhooks"
                ],
                "summary": "Delete a webhook",
                "parameters": [
                    {
                        "type": "string",
                        "description": "Webhook ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ success: true }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "handlers.ContactRequest": {
            "type": "object",
            "required": [
                "phone"
            ],
            "properties": {
                "company": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "notes": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "tags": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "handlers.ConversationHistoryResponse": {
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer",
                    "example": 50
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.Message"
                    }
                },
                "page": {
                    "type": "integer",
                    "example": 1
                },
                "phone": {
                    "description": "The phone as normalized server-side, which is the form the messages\ncarry whatever format was asked for.",
                    "type": "string",
                    "example": "+15551234567"
                },
                "thread_id": {
                    "description": "Echoed back as supplied; empty when the request did not send one.",
                    "type": "string",
                    "example": ""
                },
                "thread_ref": {
                    "description": "The conversation these messages belong to. Prefer it over phone or\nthread_id on the next page request.",
                    "type": "string",
                    "example": "b50615da-0000-4000-8000-000000000000"
                }
            }
        },
        "handlers.CreateQuickReplyRequest": {
            "type": "object",
            "required": [
                "body",
                "shortcut",
                "title"
            ],
            "properties": {
                "body": {
                    "type": "string"
                },
                "shortcut": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                }
            }
        },
        "handlers.CreateWebhookRequest": {
            "type": "object",
            "required": [
                "url"
            ],
            "properties": {
                "events": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "handlers.ErrorResponse": {
            "type": "object",
            "properties": {
                "error": {
                    "description": "Error message describing what went wrong.",
                    "type": "string",
                    "example": "phone is required"
                }
            }
        },
        "handlers.FlagSpamRequest": {
            "type": "object",
            "required": [
                "phone"
            ],
            "properties": {
                "country": {
                    "description": "Optional ISO 3166-1 alpha-2 country a local-format phone is read in.\nOmitted means the country of the SIM sending it.",
                    "type": "string",
                    "example": "GB"
                },
                "phone": {
                    "type": "string",
                    "example": "+15551234567"
                }
            }
        },
        "handlers.FlagSpamResponse": {
            "type": "object",
            "properties": {
                "engaged": {
                    "type": "boolean",
                    "example": false
                },
                "flagged": {
                    "type": "boolean",
                    "example": true
                },
                "phone": {
                    "type": "string",
                    "example": "+15551234567"
                }
            }
        },
        "handlers.Message": {
            "type": "object",
            "properties": {
                "api_key_id": {
                    "description": "The API key that sent this message, for outbound messages sent\nthrough the API. Absent for inbound and for dashboard sends.",
                    "type": "string",
                    "example": "33333333-4444-4555-8666-777777777777"
                },
                "body": {
                    "description": "The text. A picture message sent from a handset with no caption\ncarries the placeholder the phone's messaging app supplies, commonly\n\"Image Attached\", so an empty-looking body with a media_url is a\npicture, not an empty message.",
                    "type": "string",
                    "example": "Here is the photo"
                },
                "created_at": {
                    "type": "string",
                    "example": "2026-11-14T17:30:47Z"
                },
                "device_id": {
                    "type": "string",
                    "example": "99999999-8888-4777-8666-555555555555"
                },
                "direction": {
                    "type": "string",
                    "enum": [
                        "inbound",
                        "outbound"
                    ],
                    "example": "inbound"
                },
                "id": {
                    "type": "string",
                    "example": "11111111-2222-4333-8444-555555555555"
                },
                "media_type": {
                    "description": "MIME type of the attachment, as the sending phone reported it.\nPresent whenever media_url is.",
                    "type": "string",
                    "example": "image/jpeg"
                },
                "media_url": {
                    "description": "Signed, expiring, absolute HTTPS link to the attached picture or\nvideo, present only when the message has an attachment. Fetch it as\nit stands: it needs no API key and no other header, which is what\nlets an assistant or a browser read the image directly. The signature\nis good for 7 days from the moment the message was read; read the\nmessage again for a fresh link. A media URL you supplied yourself when\nsending an MMS is handed back unchanged.",
                    "type": "string",
                    "example": "https://androidtexter.com/api/media/0123456789abcdef0123456789abcdef.jpg?e=1700000000\u0026s=0000000000000000000000000000000000000000"
                },
                "participants": {
                    "description": "Every number in a group conversation, E.164. Absent on a direct one.",
                    "type": "array",
                    "items": {
                        "type": "string"
                    },
                    "example": [
                        "+15551234567",
                        "+15559876543"
                    ]
                },
                "phone": {
                    "description": "The other party's number, E.164. Sender on an inbound message,\nrecipient on an outbound one.",
                    "type": "string",
                    "example": "+15551234567"
                },
                "scheduled_at": {
                    "description": "When a future-dated send is due. Absent on a message that was sent\nimmediately.",
                    "type": "string",
                    "example": "2026-06-01T10:30:00Z"
                },
                "scheduler_status": {
                    "description": "\"none\" for an ordinary message; see ScheduledMessage for the rest.",
                    "type": "string",
                    "enum": [
                        "none",
                        "pending",
                        "fired",
                        "cancelled",
                        "expired"
                    ],
                    "example": "none"
                },
                "sim_label": {
                    "type": "string",
                    "example": "Verizon"
                },
                "sim_slot": {
                    "description": "Which SIM on a dual-SIM phone carried the message: slot 0 is \"SIM 1\".\nAbsent when the phone has one SIM or did not report.",
                    "type": "integer",
                    "example": 0
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "queued",
                        "sent",
                        "delivered",
                        "failed"
                    ],
                    "example": "delivered"
                },
                "thread_id": {
                    "description": "The phone's own thread id. Pass it back to the history endpoint to\nread a group conversation.",
                    "type": "string",
                    "example": "1943"
                },
                "thread_ref": {
                    "description": "This server's id for the conversation, and the handle the history and\nthread endpoints prefer over thread_id or phone.",
                    "type": "string",
                    "example": "b50615da-0000-4000-8000-000000000000"
                },
                "thread_type": {
                    "description": "\"group\" when more than two numbers are in the conversation.",
                    "type": "string",
                    "enum": [
                        "direct",
                        "group"
                    ],
                    "example": "direct"
                },
                "user_id": {
                    "type": "string",
                    "example": "aaaaaaaa-bbbb-4ccc-8ddd-eeeeeeeeeeee"
                }
            }
        },
        "handlers.MessageActionResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string",
                    "example": "Scheduled message cancelled"
                }
            }
        },
        "handlers.MessageListResponse": {
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer",
                    "example": 50
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.Message"
                    }
                },
                "page": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "handlers.MessageSearchResponse": {
            "type": "object",
            "properties": {
                "messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.Message"
                    }
                },
                "page": {
                    "type": "integer",
                    "example": 1
                },
                "query": {
                    "type": "string",
                    "example": "invoice"
                },
                "total": {
                    "type": "integer",
                    "example": 137
                }
            }
        },
        "handlers.MessageStatusResponse": {
            "type": "object",
            "properties": {
                "body": {
                    "type": "string",
                    "example": "Hello from Android Texter"
                },
                "delivered_at": {
                    "type": "string",
                    "example": "2026-05-12T14:35:51Z"
                },
                "error_reason": {
                    "type": "string"
                },
                "id": {
                    "type": "string",
                    "example": "msg_018f3b2c"
                },
                "phone": {
                    "type": "string",
                    "example": "+15551234567"
                },
                "sent_at": {
                    "type": "string",
                    "example": "2026-05-12T14:35:48Z"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "queued",
                        "sent",
                        "failed"
                    ],
                    "example": "sent"
                }
            }
        },
        "handlers.ScheduledMessage": {
            "type": "object",
            "properties": {
                "body": {
                    "type": "string",
                    "example": "Reminder: your appointment is at 3pm"
                },
                "created_at": {
                    "type": "string",
                    "example": "2026-05-12T14:00:00Z"
                },
                "device_id": {
                    "type": "string",
                    "example": "dev_42a1f3"
                },
                "direction": {
                    "type": "string",
                    "example": "outbound"
                },
                "id": {
                    "type": "string",
                    "example": "msg_018f3b2c"
                },
                "media_url": {
                    "type": "string",
                    "example": "https://example.com/flyer.jpg"
                },
                "phone": {
                    "type": "string",
                    "example": "+15551234567"
                },
                "scheduled_at": {
                    "type": "string",
                    "example": "2026-06-01T10:30:00Z"
                },
                "scheduler_status": {
                    "type": "string",
                    "enum": [
                        "pending",
                        "fired",
                        "cancelled",
                        "expired"
                    ],
                    "example": "pending"
                },
                "status": {
                    "type": "string",
                    "enum": [
                        "queued",
                        "cancelled"
                    ],
                    "example": "queued"
                }
            }
        },
        "handlers.ScheduledMessagesResponse": {
            "type": "object",
            "properties": {
                "scheduled_messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.ScheduledMessage"
                    }
                }
            }
        },
        "handlers.SendMessageRequest": {
            "type": "object",
            "required": [
                "message",
                "phone"
            ],
            "properties": {
                "country": {
                    "description": "Optional ISO 3166-1 alpha-2 country a local-format `phone` is read in,\nfor integrations that text abroad from a list of local numbers.\nOmitted means the country of the SIM sending it. Ignored when `phone`\nalready carries a country code.",
                    "type": "string"
                },
                "device_id": {
                    "description": "optional, auto-selects if empty",
                    "type": "string"
                },
                "media_url": {
                    "description": "optional, makes this an MMS",
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                },
                "scheduled_at": {
                    "description": "optional ISO 8601 timestamp for scheduled send",
                    "type": "string"
                },
                "sim_slot": {
                    "description": "Optional, dual-SIM phones only: which SIM to send from, 0 for \"SIM 1\".\nOmitted means the phone decides: the SIM chosen for that conversation,\nelse the SIM the recipient last texted, else the phone's default.",
                    "type": "integer"
                },
                "thread_id": {
                    "description": "optional; joins an existing group thread",
                    "type": "string"
                }
            }
        },
        "handlers.SendMessageResponse": {
            "type": "object",
            "properties": {
                "device_id": {
                    "type": "string",
                    "example": "dev_42a1f3"
                },
                "device_name": {
                    "type": "string",
                    "example": "Pixel 8"
                },
                "message": {
                    "type": "string",
                    "example": "Message queued for sending on Pixel 8"
                },
                "message_id": {
                    "type": "string",
                    "example": "msg_018f3b2c"
                },
                "phone_number": {
                    "type": "string",
                    "example": "+15551234567"
                },
                "scheduled_at": {
                    "type": "string",
                    "example": "2026-06-01T10:30:00Z"
                },
                "scheduler_status": {
                    "type": "string",
                    "example": "pending"
                },
                "status": {
                    "type": "integer",
                    "example": 200
                }
            }
        },
        "handlers.SpamThread": {
            "type": "object",
            "properties": {
                "flagged_at": {
                    "type": "string",
                    "example": "2026-05-12T14:00:00Z"
                },
                "phone": {
                    "type": "string",
                    "example": "+15551234567"
                }
            }
        },
        "handlers.SpamThreadsResponse": {
            "type": "object",
            "properties": {
                "threads": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.SpamThread"
                    }
                }
            }
        },
        "handlers.ThreadResponse": {
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer",
                    "example": 200
                },
                "messages": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/handlers.Message"
                    }
                },
                "page": {
                    "type": "integer",
                    "example": 1
                },
                "phone": {
                    "type": "string",
                    "example": "+15551234567"
                },
                "preferred_sim_slot": {
                    "description": "Which SIM replies in this conversation go out on, if one was chosen.\nNull when none was, or on a single-SIM phone.",
                    "type": "integer",
                    "example": 0
                },
                "thread_ref": {
                    "type": "string",
                    "example": "b50615da-0000-4000-8000-000000000000"
                }
            }
        },
        "handlers.UpdateQuickReplyRequest": {
            "type": "object",
            "required": [
                "body",
                "shortcut",
                "title"
            ],
            "properties": {
                "body": {
                    "type": "string"
                },
                "shortcut": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "ApiKeyAuth": {
            "description": "User-scoped API key from /dashboard/settings/api-keys",
            "type": "apiKey",
            "name": "X-API-Key",
            "in": "header"
        },
        "BearerAuth": {
            "description": "JWT access token, prefixed with \"Bearer \"",
            "type": "apiKey",
            "name": "Authorization",
            "in": "header"
        }
    }
}