{
    "openapi": "3.1.0",
    "info": {
        "title": "Airbox API",
        "version": "1",
        "description": "WhatsApp and Instagram messaging API for businesses in Kazakhstan and the CIS: messages, files and statuses through one REST API with signed webhooks."
    },
    "servers": [
        {
            "url": "https://crm.fintelligence.kz/api"
        }
    ],
    "security": [
        {
            "bearer": []
        }
    ],
    "paths": {
        "/v1/messages": {
            "post": {
                "operationId": "sendMessage",
                "tags": [
                    "messages"
                ],
                "summary": "Send a message",
                "description": "One endpoint for every kind of message: text, a template, a photo or a voice note. Each example below is one kind.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 255,
                            "pattern": "\\S"
                        },
                        "example": "order-1042",
                        "description": "Makes a retry safe: the same key with the same body within 24 hours returns the first response and sends nothing again. Use an id of your own for the message, for example the order number. Up to 255 characters, not blank."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "maxLength": 32,
                                        "description": "The customer: an E.164 number on WhatsApp, or the `from` of their message on Instagram. Up to 32 characters."
                                    },
                                    "channel": {
                                        "type": "string",
                                        "enum": [
                                            "whatsapp",
                                            "instagram",
                                            "auto"
                                        ],
                                        "description": "`whatsapp`, `instagram`, or `auto` for the channel the customer last wrote on."
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "text",
                                            "template",
                                            "voice",
                                            "audio",
                                            "image",
                                            "video"
                                        ],
                                        "description": "`text`, `template`, `voice`, `audio`, `image` or `video`. The message itself goes in the field of the same name."
                                    },
                                    "text": {
                                        "type": "object",
                                        "properties": {
                                            "body": {
                                                "type": "string",
                                                "maxLength": 4096,
                                                "description": "The text, up to 4,096 characters."
                                            }
                                        },
                                        "required": [
                                            "body"
                                        ]
                                    },
                                    "template": {
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "maxLength": 512,
                                                "description": "The template's name, as `GET /v1/templates` lists it. Up to 512 characters."
                                            },
                                            "language": {
                                                "type": "string",
                                                "maxLength": 15,
                                                "description": "The template's language code, as `GET /v1/templates` lists it. Up to 15 characters."
                                            },
                                            "parameters": {
                                                "oneOf": [
                                                    {
                                                        "type": "array",
                                                        "maxItems": 100,
                                                        "items": {
                                                            "type": "string",
                                                            "maxLength": 1024
                                                        }
                                                    },
                                                    {
                                                        "type": "object",
                                                        "maxProperties": 100,
                                                        "additionalProperties": {
                                                            "type": "string",
                                                            "maxLength": 1024
                                                        }
                                                    }
                                                ],
                                                "description": "The values for the template's placeholders in their order, or an object by name for named placeholders. Up to 100 strings of up to 1,024 characters."
                                            }
                                        },
                                        "required": [
                                            "name",
                                            "language"
                                        ]
                                    },
                                    "voice": {
                                        "type": "object",
                                        "properties": {
                                            "media_id": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "description": "The `id` of a file uploaded with `POST /v1/media`, on WhatsApp, up to 64 characters. Give this or `voice.url`."
                                            },
                                            "url": {
                                                "type": "string",
                                                "maxLength": 2048,
                                                "format": "uri",
                                                "pattern": "^https://",
                                                "description": "An https link to the file, up to 2,048 characters. Give this or `voice.media_id`."
                                            }
                                        },
                                        "oneOf": [
                                            {
                                                "required": [
                                                    "media_id"
                                                ]
                                            },
                                            {
                                                "required": [
                                                    "url"
                                                ]
                                            }
                                        ]
                                    },
                                    "audio": {
                                        "type": "object",
                                        "properties": {
                                            "media_id": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "description": "The `id` of a file uploaded with `POST /v1/media`, on WhatsApp, up to 64 characters. Give this or `audio.url`."
                                            },
                                            "url": {
                                                "type": "string",
                                                "maxLength": 2048,
                                                "format": "uri",
                                                "pattern": "^https://",
                                                "description": "An https link to the file, up to 2,048 characters. Give this or `audio.media_id`."
                                            }
                                        },
                                        "oneOf": [
                                            {
                                                "required": [
                                                    "media_id"
                                                ]
                                            },
                                            {
                                                "required": [
                                                    "url"
                                                ]
                                            }
                                        ]
                                    },
                                    "image": {
                                        "type": "object",
                                        "properties": {
                                            "media_id": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "description": "The `id` of a file uploaded with `POST /v1/media`, on WhatsApp, up to 64 characters. Give this or `image.url`."
                                            },
                                            "url": {
                                                "type": "string",
                                                "maxLength": 2048,
                                                "format": "uri",
                                                "pattern": "^https://",
                                                "description": "An https link to the file, up to 2,048 characters. Give this or `image.media_id`."
                                            },
                                            "caption": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 1024,
                                                "description": "A caption under the file, up to 1,024 characters."
                                            }
                                        },
                                        "oneOf": [
                                            {
                                                "required": [
                                                    "media_id"
                                                ]
                                            },
                                            {
                                                "required": [
                                                    "url"
                                                ]
                                            }
                                        ]
                                    },
                                    "video": {
                                        "type": "object",
                                        "properties": {
                                            "media_id": {
                                                "type": "string",
                                                "maxLength": 64,
                                                "description": "The `id` of a file uploaded with `POST /v1/media`, on WhatsApp, up to 64 characters. Give this or `video.url`."
                                            },
                                            "url": {
                                                "type": "string",
                                                "maxLength": 2048,
                                                "format": "uri",
                                                "pattern": "^https://",
                                                "description": "An https link to the file, up to 2,048 characters. Give this or `video.media_id`."
                                            },
                                            "caption": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "maxLength": 1024,
                                                "description": "A caption under the file, up to 1,024 characters."
                                            }
                                        },
                                        "oneOf": [
                                            {
                                                "required": [
                                                    "media_id"
                                                ]
                                            },
                                            {
                                                "required": [
                                                    "url"
                                                ]
                                            }
                                        ]
                                    }
                                },
                                "required": [
                                    "to",
                                    "channel",
                                    "type"
                                ],
                                "allOf": [
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "text"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ]
                                        },
                                        "then": {
                                            "required": [
                                                "text"
                                            ]
                                        }
                                    },
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "template"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ]
                                        },
                                        "then": {
                                            "required": [
                                                "template"
                                            ]
                                        }
                                    },
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "voice"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ]
                                        },
                                        "then": {
                                            "required": [
                                                "voice"
                                            ]
                                        }
                                    },
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "audio"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ]
                                        },
                                        "then": {
                                            "required": [
                                                "audio"
                                            ]
                                        }
                                    },
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "image"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ]
                                        },
                                        "then": {
                                            "required": [
                                                "image"
                                            ]
                                        }
                                    },
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "video"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ]
                                        },
                                        "then": {
                                            "required": [
                                                "video"
                                            ]
                                        }
                                    }
                                ]
                            },
                            "examples": {
                                "send_text": {
                                    "summary": "Send text",
                                    "value": {
                                        "to": "+77011234567",
                                        "channel": "whatsapp",
                                        "type": "text",
                                        "text": {
                                            "body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
                                        }
                                    }
                                },
                                "send_template": {
                                    "summary": "Send a template",
                                    "value": {
                                        "to": "+77011234567",
                                        "channel": "whatsapp",
                                        "type": "template",
                                        "template": {
                                            "name": "order_ready",
                                            "language": "ru",
                                            "parameters": [
                                                "Asel",
                                                "1042"
                                            ]
                                        }
                                    }
                                },
                                "send_voice": {
                                    "summary": "Send a voice note",
                                    "value": {
                                        "to": "+77011234567",
                                        "channel": "whatsapp",
                                        "type": "voice",
                                        "voice": {
                                            "media_id": "med_0199c5e2-5c18-7a3f-9d2e-1b0c4a6e8f72"
                                        }
                                    }
                                },
                                "send_image": {
                                    "summary": "Send a photo",
                                    "value": {
                                        "to": "+77011234567",
                                        "channel": "whatsapp",
                                        "type": "image",
                                        "image": {
                                            "url": "https://shop.example.kz/orders/1042.jpg",
                                            "caption": "Your order #1042 is packed"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Accepted",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/Idempotent-Replayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Message"
                                },
                                "examples": {
                                    "send_text": {
                                        "summary": "Send text",
                                        "value": {
                                            "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                            "to": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "type": "text",
                                            "text": {
                                                "body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
                                            },
                                            "status": "sent",
                                            "error": null,
                                            "sent_by": "api",
                                            "created_at": "2026-10-09T09:30:00+00:00",
                                            "sent_at": "2026-10-09T09:30:00+00:00",
                                            "delivered_at": null,
                                            "read_at": null
                                        }
                                    },
                                    "send_template": {
                                        "summary": "Send a template",
                                        "value": {
                                            "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                            "to": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "type": "template",
                                            "template": {
                                                "name": "order_ready",
                                                "language": "ru",
                                                "parameters": [
                                                    "Asel",
                                                    "1042"
                                                ]
                                            },
                                            "status": "sent",
                                            "error": null,
                                            "sent_by": "api",
                                            "created_at": "2026-10-09T09:30:00+00:00",
                                            "sent_at": "2026-10-09T09:30:00+00:00",
                                            "delivered_at": null,
                                            "read_at": null
                                        }
                                    },
                                    "send_voice": {
                                        "summary": "Send a voice note",
                                        "value": {
                                            "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                            "to": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "type": "voice",
                                            "voice": {
                                                "media_id": "med_0199c5e2-5c18-7a3f-9d2e-1b0c4a6e8f72"
                                            },
                                            "status": "sent",
                                            "error": null,
                                            "sent_by": "api",
                                            "created_at": "2026-10-09T09:30:00+00:00",
                                            "sent_at": "2026-10-09T09:30:00+00:00",
                                            "delivered_at": null,
                                            "read_at": null
                                        }
                                    },
                                    "send_image": {
                                        "summary": "Send a photo",
                                        "value": {
                                            "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                            "to": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "type": "image",
                                            "image": {
                                                "url": "https://shop.example.kz/orders/1042.jpg",
                                                "caption": "Your order #1042 is packed"
                                            },
                                            "status": "sent",
                                            "error": null,
                                            "sent_by": "api",
                                            "created_at": "2026-10-09T09:30:00+00:00",
                                            "sent_at": "2026-10-09T09:30:00+00:00",
                                            "delivered_at": null,
                                            "read_at": null
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "Accepted and waiting its turn within Meta's limits, with status `queued`. It goes on its own.",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "Idempotent-Replayed": {
                                "$ref": "#/components/headers/Idempotent-Replayed"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Message"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/media": {
            "post": {
                "operationId": "uploadMedia",
                "tags": [
                    "media"
                ],
                "summary": "Upload a file",
                "description": "A file to send: multipart, the file in `file` and the channel it goes on in `channel`: `whatsapp`. Instagram takes no uploads, only links. The response's `id` is the `media_id` a send names, valid until `expires_at`, 30 days on WhatsApp. The channel keeps the file, and we keep only its id. WhatsApp takes a photo as JPEG or PNG up to 5 MB, a video as MP4 or 3GP (H.264 and AAC) up to 16 MB, and audio as AAC, AMR, MP3, M4A or OGG (Opus, mono) up to 16 MB. With a test key the file is checked and stays on the simulator.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "The file. A photo as JPEG or PNG up to 5 MB, a video as MP4 or 3GP and audio as AAC, AMR, MP3, M4A or OGG, each up to 16 MB."
                                    },
                                    "channel": {
                                        "type": "string",
                                        "enum": [
                                            "whatsapp",
                                            "instagram"
                                        ],
                                        "description": "The channel the file goes on: `whatsapp`. Instagram takes files only by link."
                                    }
                                },
                                "required": [
                                    "file",
                                    "channel"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Accepted",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Media"
                                },
                                "examples": {
                                    "upload_media": {
                                        "summary": "Upload a file",
                                        "value": {
                                            "id": "med_0199c5e2-5c18-7a3f-9d2e-1b0c4a6e8f72",
                                            "channel": "whatsapp",
                                            "mime_type": "audio/ogg",
                                            "size": 14695,
                                            "expires_at": "2026-11-08T09:30:00+00:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/messages/{id}": {
            "get": {
                "operationId": "getMessage",
                "tags": [
                    "messages"
                ],
                "summary": "Retrieve a message",
                "description": "A message of the workspace by id: its status, and the reason's code if it did not go.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                        "description": "The message's `id`, from the response to the send or from a webhook event."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Message"
                                },
                                "examples": {
                                    "get_message": {
                                        "summary": "Retrieve a message",
                                        "value": {
                                            "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                            "to": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "type": "text",
                                            "text": {
                                                "body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
                                            },
                                            "status": "delivered",
                                            "error": null,
                                            "sent_by": "api",
                                            "created_at": "2026-10-09T09:30:00+00:00",
                                            "sent_at": "2026-10-09T09:30:00+00:00",
                                            "delivered_at": "2026-10-09T09:30:02+00:00",
                                            "read_at": null
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/media/{id}": {
            "get": {
                "operationId": "downloadMedia",
                "tags": [
                    "media"
                ],
                "summary": "Download a file",
                "description": "A file a customer sent, by the `media_id` from `message.received`. The response is the file itself, its type in `Content-Type`. We read the file from the channel while you download it and keep no copy, so the channel decides how long it lasts: until `expires_at`, 7 days on WhatsApp, and after that the response is 410 `media_expired`. With a test key it is a sample file.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "med_0199c5e2-6a2a-7b41-8e0d-2f1c3a4b5d6f",
                        "description": "The file's `media_id` from an incoming message, starting with `med_`."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Download a file",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            },
                            "Content-Length": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "14695"
                            },
                            "Content-Disposition": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "attachment; filename=\"med_0199c5e2-6a2a-7b41-8e0d-2f1c3a4b5d6f.ogg\""
                            },
                            "Cache-Control": {
                                "schema": {
                                    "type": "string"
                                },
                                "example": "no-store"
                            }
                        },
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/templates": {
            "get": {
                "operationId": "listTemplates",
                "tags": [
                    "templates"
                ],
                "summary": "List templates",
                "description": "The number's approved templates: name, language, category and placeholders in order.",
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Template"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "templates": {
                                        "summary": "List templates",
                                        "value": {
                                            "data": [
                                                {
                                                    "name": "order_ready",
                                                    "language": "ru",
                                                    "category": "utility",
                                                    "parameters": [
                                                        "1",
                                                        "2"
                                                    ],
                                                    "body": "Hello, {{1}}! Your order #{{2}} is ready."
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "x-channel": "whatsapp"
            }
        },
        "/v1/contacts": {
            "get": {
                "operationId": "listContacts",
                "tags": [
                    "contacts"
                ],
                "summary": "List contacts",
                "description": "The customers you have dealt with, newest first: those who wrote, were written to or gave consent, on the connected channels with a live key and on the simulator with a test key. With `phone`, only the contact with that number, to find their `id` and whether you may write to them. A page has up to `limit` contacts, and while `has_more` is `true`, the next page comes with the last contact's `id` in `after`.",
                "parameters": [
                    {
                        "name": "phone",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "maxLength": 32
                        },
                        "example": "+77011234567",
                        "description": "Only the contact with this number, in E.164, with or without the `+`. The list then has one contact or none."
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        },
                        "description": "How many items a page has, from 1 to 100, 20 by default."
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The `id` of the last contact on the page before, for the next page."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "has_more"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Contact"
                                            }
                                        },
                                        "has_more": {
                                            "type": "boolean",
                                            "description": "Whether more items follow. Ask for them with the last item's `id` in `after`."
                                        }
                                    }
                                },
                                "examples": {
                                    "list_contacts": {
                                        "summary": "List contacts",
                                        "value": {
                                            "data": [
                                                {
                                                    "id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                                    "name": "Asel",
                                                    "phone": "+77011234567",
                                                    "instagram_id": null,
                                                    "channel": "whatsapp",
                                                    "free_text_until": "2026-10-10T09:28:00+00:00",
                                                    "consent": true,
                                                    "opted_out": false,
                                                    "last_message_at": "2026-10-09T09:30:00+00:00",
                                                    "created_at": "2026-09-14T11:05:00+00:00"
                                                }
                                            ],
                                            "has_more": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/contacts/{id}": {
            "get": {
                "operationId": "getContact",
                "tags": [
                    "contacts"
                ],
                "summary": "Retrieve a contact",
                "description": "A contact by `id`: how to reach them, the channel they last wrote on and until when free text may answer them there, whether they agreed to templates and whether they asked not to be written to.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                        "description": "The contact's `id`, as `GET /v1/contacts` or a message's `contact_id` gives it."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Contact"
                                },
                                "examples": {
                                    "get_contact": {
                                        "summary": "Retrieve a contact",
                                        "value": {
                                            "id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "name": "Asel",
                                            "phone": "+77011234567",
                                            "instagram_id": null,
                                            "channel": "whatsapp",
                                            "free_text_until": "2026-10-10T09:28:00+00:00",
                                            "consent": true,
                                            "opted_out": false,
                                            "last_message_at": "2026-10-09T09:30:00+00:00",
                                            "created_at": "2026-09-14T11:05:00+00:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/contacts/{id}/messages": {
            "get": {
                "operationId": "listContactMessages",
                "tags": [
                    "contacts"
                ],
                "summary": "List messages",
                "description": "The conversation with a contact, newest first: what they wrote, as `message.received` brings it, and what went to them, as `GET /v1/messages/{id}` shows it, each with its `direction`, `inbound` or `outbound`. A test key sees only the simulator's messages, a live key all the others. A page has up to `limit` messages, and while `has_more` is `true`, the next page comes with the last message's `id` in `after`.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                        "description": "The contact's `id`, as `GET /v1/contacts` or a message's `contact_id` gives it."
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        },
                        "example": 50,
                        "description": "How many items a page has, from 1 to 100, 20 by default."
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "description": "The `id` of the last message on the page before, for the next page."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data",
                                        "has_more"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ConversationMessage"
                                            }
                                        },
                                        "has_more": {
                                            "type": "boolean",
                                            "description": "Whether more items follow. Ask for them with the last item's `id` in `after`."
                                        }
                                    }
                                },
                                "examples": {
                                    "list_contact_messages": {
                                        "summary": "List messages",
                                        "value": {
                                            "data": [
                                                {
                                                    "direction": "outbound",
                                                    "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                                    "to": "+77011234567",
                                                    "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                                    "channel": "whatsapp",
                                                    "type": "text",
                                                    "text": {
                                                        "body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
                                                    },
                                                    "status": "read",
                                                    "error": null,
                                                    "sent_by": "api",
                                                    "created_at": "2026-10-09T09:30:00+00:00",
                                                    "sent_at": "2026-10-09T09:30:00+00:00",
                                                    "delivered_at": "2026-10-09T09:30:02+00:00",
                                                    "read_at": "2026-10-09T09:31:15+00:00"
                                                },
                                                {
                                                    "direction": "inbound",
                                                    "id": "0199c5e2-6a29-7b40-8e0d-2f1c3a4b5d6e",
                                                    "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                                    "from": "+77011234567",
                                                    "name": "Asel",
                                                    "channel": "whatsapp",
                                                    "type": "text",
                                                    "text": {
                                                        "body": "Hello! When will my order be ready?"
                                                    },
                                                    "received_at": "2026-10-09T09:28:00+00:00",
                                                    "free_text_until": "2026-10-10T09:28:00+00:00"
                                                }
                                            ],
                                            "has_more": false
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/v1/contacts/{phone}/consent": {
            "post": {
                "operationId": "grantConsent",
                "tags": [
                    "contacts"
                ],
                "summary": "Record consent",
                "description": "The customer agreed to receive WhatsApp messages, and a template to their number passes the check. Record consent only when the customer really gave it.",
                "parameters": [
                    {
                        "name": "phone",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "+77011234567",
                        "description": "The customer's number in E.164, with or without the `+`."
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Accepted",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Consent"
                                },
                                "examples": {
                                    "consent_grant": {
                                        "summary": "Record consent",
                                        "value": {
                                            "phone": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "granted": true,
                                            "recorded_at": "2026-10-09T09:30:00+00:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "x-channel": "whatsapp"
            },
            "delete": {
                "operationId": "withdrawConsent",
                "tags": [
                    "contacts"
                ],
                "summary": "Withdraw consent",
                "description": "The customer no longer wants messages, and templates to their number fail the check again.",
                "parameters": [
                    {
                        "name": "phone",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "example": "+77011234567",
                        "description": "The customer's number in E.164, with or without the `+`."
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Consent"
                                },
                                "examples": {
                                    "consent_withdraw": {
                                        "summary": "Withdraw consent",
                                        "value": {
                                            "phone": "+77011234567",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "channel": "whatsapp",
                                            "granted": false,
                                            "recorded_at": "2026-10-09T09:30:00+00:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "x-channel": "whatsapp"
            }
        },
        "/v1/test/inbound": {
            "post": {
                "operationId": "testInbound",
                "tags": [
                    "test"
                ],
                "summary": "Write as a customer",
                "description": "Test keys only. A made-up customer writes on the simulator: the `message.received` webhook arrives, and until its `free_text_until` you can answer this number with text. With `type` `voice`, `audio`, `image` or `video` instead of `text`, the customer sends a sample file, a photo or a video with the caption from `caption`, which `GET /v1/media/{id}` downloads.\n\nTest key only",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "from": {
                                        "type": "string",
                                        "maxLength": 32,
                                        "description": "The made-up customer's number in E.164, up to 32 characters."
                                    },
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "text",
                                            "voice",
                                            "audio",
                                            "image",
                                            "video"
                                        ],
                                        "default": "text",
                                        "description": "`text` when left out, or `voice`, `audio`, `image` or `video` for a sample file."
                                    },
                                    "text": {
                                        "type": "object",
                                        "properties": {
                                            "body": {
                                                "type": "string",
                                                "maxLength": 4096,
                                                "description": "What the customer writes, up to 4,096 characters. Required unless `type` names a file."
                                            }
                                        },
                                        "required": [
                                            "body"
                                        ]
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 120,
                                        "description": "The customer's name, up to 120 characters, or `null`."
                                    },
                                    "caption": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 1024,
                                        "description": "A caption for a sample photo or video, up to 1,024 characters, or `null`."
                                    }
                                },
                                "required": [
                                    "from"
                                ],
                                "allOf": [
                                    {
                                        "if": {
                                            "properties": {
                                                "type": {
                                                    "const": "text"
                                                }
                                            }
                                        },
                                        "then": {
                                            "required": [
                                                "text"
                                            ]
                                        }
                                    }
                                ]
                            },
                            "examples": {
                                "test_inbound": {
                                    "summary": "Write as a customer",
                                    "value": {
                                        "from": "+77011234567",
                                        "text": {
                                            "body": "Hello! When will my order be ready?"
                                        },
                                        "name": "Asel"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Accepted",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Inbound"
                                },
                                "examples": {
                                    "test_inbound": {
                                        "summary": "Write as a customer",
                                        "value": {
                                            "id": "0199c5e2-6a29-7b40-8e0d-2f1c3a4b5d6e",
                                            "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                            "from": "+77011234567",
                                            "name": "Asel",
                                            "channel": "simulator",
                                            "type": "text",
                                            "text": {
                                                "body": "Hello! When will my order be ready?"
                                            },
                                            "received_at": "2026-10-09T09:30:00+00:00",
                                            "free_text_until": "2026-10-10T09:30:00+00:00"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                },
                "x-test-only": true
            }
        },
        "/v1/channels": {
            "get": {
                "operationId": "listChannels",
                "tags": [
                    "channels"
                ],
                "summary": "List channels",
                "description": "What the workspace has connected. Every channel has the same fields: its status (`connected`, `pending`, `disconnected` or `not_connected`), where a send naming it goes with this key, the account with its address, name and chat link, quality, limits in numbers, the channel's rules, alerts, and whether the number is shared with the WhatsApp Business app. What a channel lacks or what is not known yet comes as `null`, an empty list or `false`.",
                "responses": {
                    "200": {
                        "description": "Found",
                        "headers": {
                            "X-Request-Id": {
                                "$ref": "#/components/headers/X-Request-Id"
                            },
                            "X-RateLimit-Limit": {
                                "$ref": "#/components/headers/X-RateLimit-Limit"
                            },
                            "X-RateLimit-Remaining": {
                                "$ref": "#/components/headers/X-RateLimit-Remaining"
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/ChannelState"
                                            }
                                        }
                                    }
                                },
                                "examples": {
                                    "channels": {
                                        "summary": "List channels",
                                        "value": {
                                            "data": [
                                                {
                                                    "channel": "whatsapp",
                                                    "status": "connected",
                                                    "sends_to": "whatsapp",
                                                    "account": {
                                                        "address": "+7 727 355 00 00",
                                                        "name": "Zerno Coffee",
                                                        "url": "https://wa.me/77273550000"
                                                    },
                                                    "quality": "high",
                                                    "limits": {
                                                        "new_customers_per_day": 2000,
                                                        "messages_per_second": 80
                                                    },
                                                    "rules": {
                                                        "free_text_window_hours": 24,
                                                        "templates": true,
                                                        "receipts": [
                                                            "delivered",
                                                            "read"
                                                        ]
                                                    },
                                                    "alerts": [],
                                                    "whatsapp": {
                                                        "shared_with_phone_app": false
                                                    }
                                                },
                                                {
                                                    "channel": "instagram",
                                                    "status": "not_connected",
                                                    "sends_to": null,
                                                    "account": null,
                                                    "quality": null,
                                                    "limits": {
                                                        "new_customers_per_day": null,
                                                        "messages_per_second": null
                                                    },
                                                    "rules": {
                                                        "free_text_window_hours": 24,
                                                        "templates": false,
                                                        "receipts": [
                                                            "read"
                                                        ]
                                                    },
                                                    "alerts": [],
                                                    "instagram": null
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        }
    },
    "webhooks": {
        "message.received": {
            "post": {
                "summary": "message.received",
                "description": "A customer wrote to you on any connected channel, or, in test mode, through `POST /v1/test/inbound`. `data` holds the channel, the customer's address on it (`from`), the contact, the name, the text or a file, and the time. You may reply with free text until `free_text_until`, and `null` there means the channel has no such window.",
                "parameters": [
                    {
                        "name": "webhook-id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The event's id, the same on every retry. Drop an event whose id you already took."
                    },
                    {
                        "name": "webhook-timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "When it was sent, in Unix seconds. Reject an event more than 5 minutes off your clock."
                    },
                    {
                        "name": "webhook-signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "One or more signatures, separated by spaces: `v1,` and the base64 HMAC-SHA256 of `webhook-id.webhook-timestamp.body`."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "timestamp",
                                    "workspace",
                                    "data"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "message.received"
                                    },
                                    "timestamp": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "workspace": {
                                        "$ref": "#/components/schemas/Workspace"
                                    },
                                    "data": {
                                        "$ref": "#/components/schemas/Inbound"
                                    }
                                }
                            },
                            "example": {
                                "type": "message.received",
                                "timestamp": "2026-10-09T09:30:00+00:00",
                                "workspace": {
                                    "id": "0199c5e2-0d4b-7e21-a3f6-8c2b1e7d9a40",
                                    "name": "Smile Clinic"
                                },
                                "data": {
                                    "id": "0199c5e2-6a29-7b40-8e0d-2f1c3a4b5d6e",
                                    "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                    "from": "+77011234567",
                                    "name": "Asel",
                                    "channel": "whatsapp",
                                    "type": "text",
                                    "text": {
                                        "body": "Hello! When will my order be ready?"
                                    },
                                    "received_at": "2026-10-09T09:30:00+00:00",
                                    "free_text_until": "2026-10-10T09:30:00+00:00"
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Answer 2xx within 5 seconds. After any other answer, or none, the event comes again."
                    }
                }
            }
        },
        "message.status": {
            "post": {
                "summary": "message.status",
                "description": "A message of the workspace changed status: it was handed to the channel (`sent`), delivered (`delivered`), read (`read`) or not sent (`failed`, the reason in `error.code`). Not every channel reports delivery and reading, and `rules.receipts` in `GET /v1/channels` says which do. `data` holds the whole message, as `GET /v1/messages/{id}` returns it. It comes for every message of the workspace, not only those sent through the API: `sent_by` tells who sent it.",
                "parameters": [
                    {
                        "name": "webhook-id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The event's id, the same on every retry. Drop an event whose id you already took."
                    },
                    {
                        "name": "webhook-timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "When it was sent, in Unix seconds. Reject an event more than 5 minutes off your clock."
                    },
                    {
                        "name": "webhook-signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "One or more signatures, separated by spaces: `v1,` and the base64 HMAC-SHA256 of `webhook-id.webhook-timestamp.body`."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "timestamp",
                                    "workspace",
                                    "data"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "message.status"
                                    },
                                    "timestamp": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "workspace": {
                                        "$ref": "#/components/schemas/Workspace"
                                    },
                                    "data": {
                                        "$ref": "#/components/schemas/Message"
                                    }
                                }
                            },
                            "example": {
                                "type": "message.status",
                                "timestamp": "2026-10-09T09:30:00+00:00",
                                "workspace": {
                                    "id": "0199c5e2-0d4b-7e21-a3f6-8c2b1e7d9a40",
                                    "name": "Smile Clinic"
                                },
                                "data": {
                                    "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                    "to": "+77011234567",
                                    "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                    "channel": "whatsapp",
                                    "type": "text",
                                    "text": {
                                        "body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
                                    },
                                    "status": "delivered",
                                    "error": null,
                                    "sent_by": "api",
                                    "created_at": "2026-10-09T09:30:00+00:00",
                                    "sent_at": "2026-10-09T09:30:00+00:00",
                                    "delivered_at": "2026-10-09T09:30:02+00:00",
                                    "read_at": null
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Answer 2xx within 5 seconds. After any other answer, or none, the event comes again."
                    }
                }
            }
        },
        "message.refused": {
            "post": {
                "summary": "message.refused",
                "description": "A message of the workspace will not go: the checks did not let it through, for example with no consent from the customer or the window closed, or a person dismissed the draft or a newer one replaced it. `data` is the whole message as `GET /v1/messages/{id}` returns it, the reason in `error`. For a send through the API the same reason also comes in the response to the request.",
                "parameters": [
                    {
                        "name": "webhook-id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The event's id, the same on every retry. Drop an event whose id you already took."
                    },
                    {
                        "name": "webhook-timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "When it was sent, in Unix seconds. Reject an event more than 5 minutes off your clock."
                    },
                    {
                        "name": "webhook-signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "One or more signatures, separated by spaces: `v1,` and the base64 HMAC-SHA256 of `webhook-id.webhook-timestamp.body`."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "timestamp",
                                    "workspace",
                                    "data"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "message.refused"
                                    },
                                    "timestamp": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "workspace": {
                                        "$ref": "#/components/schemas/Workspace"
                                    },
                                    "data": {
                                        "$ref": "#/components/schemas/Message"
                                    }
                                }
                            },
                            "example": {
                                "type": "message.refused",
                                "timestamp": "2026-10-09T09:30:00+00:00",
                                "workspace": {
                                    "id": "0199c5e2-0d4b-7e21-a3f6-8c2b1e7d9a40",
                                    "name": "Smile Clinic"
                                },
                                "data": {
                                    "id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                    "to": "+77011234567",
                                    "contact_id": "0199c5e2-1f0a-7a42-8d1e-5b7c9a2e4f10",
                                    "channel": "whatsapp",
                                    "type": "text",
                                    "text": {
                                        "body": "Hello! Your order #1042 is ready, and you can pick it up today until 8 pm."
                                    },
                                    "status": "refused",
                                    "error": {
                                        "code": "no_consent",
                                        "message": "The customer has not agreed to hear from you. Once they agree, record it with POST /v1/contacts/{phone}/consent."
                                    },
                                    "sent_by": "api",
                                    "created_at": "2026-10-09T09:30:00+00:00",
                                    "sent_at": null,
                                    "delivered_at": null,
                                    "read_at": null
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Answer 2xx within 5 seconds. After any other answer, or none, the event comes again."
                    }
                }
            }
        },
        "channel.updated": {
            "post": {
                "summary": "channel.updated",
                "description": "A channel of the workspace was connected or disconnected, Meta disconnected or restored it, or an alert on it came or went, for example when Meta cannot charge for messages. `data` is the whole channel as `GET /v1/channels` returns it for a live key: its state in `status`, alerts in `alerts`.",
                "parameters": [
                    {
                        "name": "webhook-id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The event's id, the same on every retry. Drop an event whose id you already took."
                    },
                    {
                        "name": "webhook-timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "When it was sent, in Unix seconds. Reject an event more than 5 minutes off your clock."
                    },
                    {
                        "name": "webhook-signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "One or more signatures, separated by spaces: `v1,` and the base64 HMAC-SHA256 of `webhook-id.webhook-timestamp.body`."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "timestamp",
                                    "workspace",
                                    "data"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "channel.updated"
                                    },
                                    "timestamp": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "workspace": {
                                        "$ref": "#/components/schemas/Workspace"
                                    },
                                    "data": {
                                        "$ref": "#/components/schemas/ChannelState"
                                    }
                                }
                            },
                            "example": {
                                "type": "channel.updated",
                                "timestamp": "2026-10-09T09:30:00+00:00",
                                "workspace": {
                                    "id": "0199c5e2-0d4b-7e21-a3f6-8c2b1e7d9a40",
                                    "name": "Smile Clinic"
                                },
                                "data": {
                                    "channel": "whatsapp",
                                    "status": "connected",
                                    "sends_to": "whatsapp",
                                    "account": {
                                        "address": "+7 727 355 00 00",
                                        "name": "Zerno Coffee",
                                        "url": "https://wa.me/77273550000"
                                    },
                                    "quality": "high",
                                    "limits": {
                                        "new_customers_per_day": 2000,
                                        "messages_per_second": 80
                                    },
                                    "rules": {
                                        "free_text_window_hours": 24,
                                        "templates": true,
                                        "receipts": [
                                            "delivered",
                                            "read"
                                        ]
                                    },
                                    "alerts": [],
                                    "whatsapp": {
                                        "shared_with_phone_app": false
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Answer 2xx within 5 seconds. After any other answer, or none, the event comes again."
                    }
                }
            }
        },
        "webhook.test": {
            "post": {
                "summary": "webhook.test",
                "description": "A test sent from the workspace's Webhook deliveries page, once. Answer 2xx and ignore it.",
                "parameters": [
                    {
                        "name": "webhook-id",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The event's id, the same on every retry. Drop an event whose id you already took."
                    },
                    {
                        "name": "webhook-timestamp",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "When it was sent, in Unix seconds. Reject an event more than 5 minutes off your clock."
                    },
                    {
                        "name": "webhook-signature",
                        "in": "header",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "One or more signatures, separated by spaces: `v1,` and the base64 HMAC-SHA256 of `webhook-id.webhook-timestamp.body`."
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "timestamp",
                                    "workspace",
                                    "data"
                                ],
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "const": "webhook.test"
                                    },
                                    "timestamp": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "workspace": {
                                        "$ref": "#/components/schemas/Workspace"
                                    },
                                    "data": {
                                        "type": "object",
                                        "required": [
                                            "message"
                                        ],
                                        "properties": {
                                            "message": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            },
                            "example": {
                                "type": "webhook.test",
                                "timestamp": "2026-10-09T09:30:00+00:00",
                                "workspace": {
                                    "id": "0199c5e2-0d4b-7e21-a3f6-8c2b1e7d9a40",
                                    "name": "Smile Clinic"
                                },
                                "data": {
                                    "message": "Checking the webhook address. If this event arrived, everything is set up."
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Answer 2xx within 5 seconds. After any other answer, or none, the event comes again."
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer",
                "description": "Auth: `Authorization: Bearer <key>`"
            }
        },
        "headers": {
            "X-Request-Id": {
                "schema": {
                    "type": "string"
                },
                "description": "The request's id, to quote to support."
            },
            "X-RateLimit-Limit": {
                "schema": {
                    "type": "integer"
                },
                "description": "The requests a minute this key may make, 300 now."
            },
            "X-RateLimit-Remaining": {
                "schema": {
                    "type": "integer"
                },
                "description": "How many requests this key has left this minute."
            },
            "Retry-After": {
                "schema": {
                    "type": "integer"
                },
                "description": "Seconds to wait before the next request."
            },
            "X-RateLimit-Reset": {
                "schema": {
                    "type": "integer"
                },
                "description": "When the limit renews, in Unix time."
            },
            "Idempotent-Replayed": {
                "schema": {
                    "type": "string",
                    "enum": [
                        "true"
                    ]
                },
                "description": "`true` when this is the first response again, for an `Idempotency-Key` already used."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message",
                            "request_id"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "unauthenticated",
                                    "forbidden",
                                    "payment_required",
                                    "integrator_required",
                                    "test_key_required",
                                    "not_found",
                                    "method_not_allowed",
                                    "invalid_request",
                                    "invalid_phone",
                                    "recipient_unknown",
                                    "template_not_found",
                                    "template_parameters",
                                    "template_unsupported",
                                    "media_format",
                                    "media_too_large",
                                    "media_not_found",
                                    "media_expired",
                                    "channel_unresolved",
                                    "idempotency_mismatch",
                                    "idempotency_in_progress",
                                    "rate_limited",
                                    "server_error",
                                    "channel_unavailable",
                                    "outside_window",
                                    "messaging_limit",
                                    "no_consent",
                                    "opted_out",
                                    "made_up_number",
                                    "meta_payment",
                                    "undeliverable",
                                    "media_rejected",
                                    "channel_error"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "message_id": {
                                "type": "string",
                                "description": "The refused message, when the refusal names one."
                            },
                            "param": {
                                "type": "string",
                                "description": "The field or header the error is about, when it names one."
                            },
                            "request_id": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "Message": {
                "type": "object",
                "required": [
                    "id",
                    "to",
                    "contact_id",
                    "channel",
                    "type",
                    "status",
                    "error",
                    "sent_by",
                    "created_at",
                    "sent_at",
                    "delivered_at",
                    "read_at"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "contact_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "channel": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "text",
                            "template",
                            "voice",
                            "audio",
                            "image",
                            "video"
                        ]
                    },
                    "text": {
                        "type": "object",
                        "required": [
                            "body"
                        ],
                        "properties": {
                            "body": {
                                "type": "string"
                            }
                        }
                    },
                    "template": {
                        "type": "object",
                        "required": [
                            "name",
                            "language",
                            "parameters"
                        ],
                        "properties": {
                            "name": {
                                "type": "string"
                            },
                            "language": {
                                "type": "string"
                            },
                            "parameters": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "voice": {
                        "type": "object",
                        "properties": {
                            "media_id": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            },
                            "caption": {
                                "type": "string"
                            }
                        }
                    },
                    "audio": {
                        "type": "object",
                        "properties": {
                            "media_id": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            },
                            "caption": {
                                "type": "string"
                            }
                        }
                    },
                    "image": {
                        "type": "object",
                        "properties": {
                            "media_id": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            },
                            "caption": {
                                "type": "string"
                            }
                        }
                    },
                    "video": {
                        "type": "object",
                        "properties": {
                            "media_id": {
                                "type": "string"
                            },
                            "url": {
                                "type": "string"
                            },
                            "caption": {
                                "type": "string"
                            }
                        }
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued",
                            "sent",
                            "delivered",
                            "read",
                            "failed",
                            "refused"
                        ]
                    },
                    "error": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "enum": [
                                    "unauthenticated",
                                    "forbidden",
                                    "payment_required",
                                    "integrator_required",
                                    "test_key_required",
                                    "not_found",
                                    "method_not_allowed",
                                    "invalid_request",
                                    "invalid_phone",
                                    "recipient_unknown",
                                    "template_not_found",
                                    "template_parameters",
                                    "template_unsupported",
                                    "media_format",
                                    "media_too_large",
                                    "media_not_found",
                                    "media_expired",
                                    "channel_unresolved",
                                    "idempotency_mismatch",
                                    "idempotency_in_progress",
                                    "rate_limited",
                                    "server_error",
                                    "channel_unavailable",
                                    "outside_window",
                                    "messaging_limit",
                                    "no_consent",
                                    "opted_out",
                                    "made_up_number",
                                    "meta_payment",
                                    "undeliverable",
                                    "media_rejected",
                                    "channel_error"
                                ]
                            },
                            "message": {
                                "type": "string"
                            }
                        }
                    },
                    "sent_by": {
                        "type": "string"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "sent_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "delivered_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "read_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "Media": {
                "type": "object",
                "required": [
                    "id",
                    "channel",
                    "mime_type",
                    "size",
                    "expires_at"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "channel": {
                        "type": "string"
                    },
                    "mime_type": {
                        "type": "string"
                    },
                    "size": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "expires_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Template": {
                "type": "object",
                "required": [
                    "name",
                    "language",
                    "category",
                    "parameters",
                    "body"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "language": {
                        "type": "string"
                    },
                    "category": {
                        "type": "string"
                    },
                    "parameters": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "body": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "Consent": {
                "type": "object",
                "required": [
                    "phone",
                    "contact_id",
                    "channel",
                    "granted",
                    "recorded_at"
                ],
                "properties": {
                    "phone": {
                        "type": "string"
                    },
                    "contact_id": {
                        "type": "string"
                    },
                    "channel": {
                        "type": "string"
                    },
                    "granted": {
                        "type": "boolean"
                    },
                    "recorded_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "Inbound": {
                "type": "object",
                "required": [
                    "id",
                    "contact_id",
                    "from",
                    "name",
                    "channel",
                    "type",
                    "received_at",
                    "free_text_until"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "contact_id": {
                        "type": "string"
                    },
                    "from": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "channel": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "text",
                            "voice",
                            "audio",
                            "image",
                            "video"
                        ]
                    },
                    "text": {
                        "type": "object",
                        "required": [
                            "body"
                        ],
                        "properties": {
                            "body": {
                                "type": "string"
                            }
                        }
                    },
                    "voice": {
                        "type": "object",
                        "required": [
                            "media_id",
                            "mime_type",
                            "sha256",
                            "expires_at"
                        ],
                        "properties": {
                            "media_id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "mime_type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "sha256": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "expires_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "caption": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "audio": {
                        "type": "object",
                        "required": [
                            "media_id",
                            "mime_type",
                            "sha256",
                            "expires_at"
                        ],
                        "properties": {
                            "media_id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "mime_type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "sha256": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "expires_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "caption": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "image": {
                        "type": "object",
                        "required": [
                            "media_id",
                            "mime_type",
                            "sha256",
                            "expires_at"
                        ],
                        "properties": {
                            "media_id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "mime_type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "sha256": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "expires_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "caption": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "video": {
                        "type": "object",
                        "required": [
                            "media_id",
                            "mime_type",
                            "sha256",
                            "expires_at"
                        ],
                        "properties": {
                            "media_id": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "mime_type": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "sha256": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "expires_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "caption": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "received_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "free_text_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "Contact": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "phone",
                    "instagram_id",
                    "channel",
                    "free_text_until",
                    "consent",
                    "opted_out",
                    "last_message_at",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "name": {
                        "type": "string"
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "instagram_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "channel": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "free_text_until": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "consent": {
                        "type": "boolean"
                    },
                    "opted_out": {
                        "type": "boolean"
                    },
                    "last_message_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "ConversationMessage": {
                "oneOf": [
                    {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Inbound"
                            },
                            {
                                "type": "object",
                                "required": [
                                    "direction"
                                ],
                                "properties": {
                                    "direction": {
                                        "type": "string",
                                        "const": "inbound"
                                    }
                                }
                            }
                        ]
                    },
                    {
                        "allOf": [
                            {
                                "$ref": "#/components/schemas/Message"
                            },
                            {
                                "type": "object",
                                "required": [
                                    "direction"
                                ],
                                "properties": {
                                    "direction": {
                                        "type": "string",
                                        "const": "outbound"
                                    }
                                }
                            }
                        ]
                    }
                ]
            },
            "ChannelState": {
                "type": "object",
                "required": [
                    "channel",
                    "status",
                    "sends_to",
                    "account",
                    "quality",
                    "limits",
                    "rules",
                    "alerts"
                ],
                "properties": {
                    "channel": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "sends_to": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "account": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "address": {
                                "type": "string"
                            },
                            "name": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "url": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "quality": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "limits": {
                        "type": "object",
                        "properties": {
                            "new_customers_per_day": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "messages_per_second": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        }
                    },
                    "rules": {
                        "type": "object",
                        "properties": {
                            "free_text_window_hours": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "templates": {
                                "type": "boolean"
                            },
                            "receipts": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "alerts": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "payment",
                                "restricted",
                                "policy_violation",
                                "disable_scheduled"
                            ]
                        }
                    },
                    "whatsapp": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "shared_with_phone_app": {
                                "type": "boolean"
                            }
                        }
                    },
                    "instagram": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "additionalProperties": true
                    }
                }
            },
            "Workspace": {
                "type": "object",
                "required": [
                    "id",
                    "name"
                ],
                "description": "The workspace the event is about. `id` never changes, `name` is its current name.",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    }
                }
            }
        },
        "responses": {
            "Error": {
                "description": "The request was refused. `code` says why, and `request_id` is what to quote to support.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/X-Request-Id"
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "outside_window",
                                "message": "The customer has not written to you in the last 24 hours, and WhatsApp lets free text through only as a reply. Send an approved template.",
                                "message_id": "0199c5e2-7b3a-7c51-9f0e-3a1d2b4c5e6f",
                                "request_id": "req_01k75q3x8f2m9c4v6b7n1d0e5a"
                            }
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Over the limit of 300 requests a minute for this key. Wait `Retry-After` seconds.",
                "headers": {
                    "X-Request-Id": {
                        "$ref": "#/components/headers/X-Request-Id"
                    },
                    "X-RateLimit-Limit": {
                        "$ref": "#/components/headers/X-RateLimit-Limit"
                    },
                    "X-RateLimit-Remaining": {
                        "$ref": "#/components/headers/X-RateLimit-Remaining"
                    },
                    "Retry-After": {
                        "$ref": "#/components/headers/Retry-After"
                    },
                    "X-RateLimit-Reset": {
                        "$ref": "#/components/headers/X-RateLimit-Reset"
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/Error"
                        },
                        "example": {
                            "error": {
                                "code": "rate_limited",
                                "message": "Too many requests with this key. Try again after as many seconds as the Retry-After header says.",
                                "request_id": "req_01k75q3x8f2m9c4v6b7n1d0e5a"
                            }
                        }
                    }
                }
            }
        }
    }
}
