{
    "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": {
        "/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/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/received": {
            "get": {
                "security": [
                    {
                        "ApiKeyAuth": []
                    },
                    {
                        "BearerAuth": []
                    }
                ],
                "description": "Paginated inbound messages across all paired devices, newest first. Each message carries phone (sender), body, direction, device_id, media_url, thread_id, thread_type, thread_ref and created_at. 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": "{messages: [Message], page, limit}",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "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"
                        }
                    }
                }
            }
        },
        "/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.",
                "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"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "{ messages: [...], page, limit, phone }",
                        "schema": {
                            "type": "object",
                            "additionalProperties": true
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/handlers.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "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/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.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.MessageActionResponse": {
            "type": "object",
            "properties": {
                "message": {
                    "type": "string",
                    "example": "Scheduled message cancelled"
                }
            }
        },
        "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.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"
        }
    }
}