{
    "openapi": "3.0.3",
    "info": {
        "title": "1Confirmed API",
        "version": "v2",
        "description": "Generated from the 1Confirmed API reference at https://1confirmed.com/developers/api?version=v2. Send Accept: application/json, and your access token as a Bearer token on every protected request."
    },
    "externalDocs": {
        "description": "The API reference",
        "url": "https://1confirmed.com/developers/api?version=v2"
    },
    "servers": [
        {
            "url": "https://1confirmed.com/api/v2"
        }
    ],
    "tags": [
        {
            "name": "Authentication"
        },
        {
            "name": "Resources"
        },
        {
            "name": "Messaging"
        },
        {
            "name": "Broadcasts"
        },
        {
            "name": "Contacts"
        },
        {
            "name": "Account"
        },
        {
            "name": "Saved lists"
        },
        {
            "name": "SMS"
        },
        {
            "name": "Broadcast wizard"
        },
        {
            "name": "Broadcast actions"
        },
        {
            "name": "Calendars"
        },
        {
            "name": "Calendar schedules"
        }
    ],
    "security": [
        {
            "accessToken": []
        }
    ],
    "paths": {
        "/login": {
            "post": {
                "operationId": "login",
                "summary": "Login",
                "description": "Get an access token for an existing account.\n\n- No registration token or turnstile_token is required.\n\n- Phone verification must be complete. External clients must send two_factor_code in the login request when two-factor verification is enabled; an external request without the code fails with HTTP 404.\n\n- Invalid credentials, unverified phone and invalid two-factor codes return HTTP 404 with {success: false, message}. Invalid request fields return 422. Rate limits return 429 with Retry-After in seconds.\n\n- Login limits are shared per client IP across API versions and Shopify login: 1 per second · 5 per minute · 20 per 15 minutes. Successful, failed and invalid attempts count.",
                "tags": [
                    "Authentication"
                ],
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Valid account email address."
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Account password."
                                    },
                                    "two_factor_code": {
                                        "type": "string",
                                        "description": "Exactly 6 characters. Include a valid authenticator code when two-factor verification is enabled."
                                    }
                                },
                                "required": [
                                    "email",
                                    "password"
                                ]
                            },
                            "example": {
                                "email": "you@example.com",
                                "password": "YOUR_PASSWORD"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, name, email, phone, shop_domain, auth_type, language, phone_verified_at, two_factor_enabled, two_factor_verified, first_message_wizard_completed, roles, credit, subscription, cr_account, accounts, token and custom_credit. Login and registration populate data.token. credit contains id and credit; subscription contains price, start_date, end_date, status, is_expired, auto_renewable; cr_account contains id and name. Related records can be null. accounts entries contain id and name; provider identifier fields are omitted in v2. A loaded phone contains id, display_phone_number, is_catalog_visible and is_cart_enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Example response",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "name": "Sam Smith",
                                                "email": "sam@example.com",
                                                "phone": "212600000000",
                                                "shop_domain": null,
                                                "auth_type": null,
                                                "language": "en",
                                                "phone_verified_at": "2026-09-22T10:00:00.000000Z",
                                                "two_factor_enabled": false,
                                                "two_factor_verified": false,
                                                "first_message_wizard_completed": false,
                                                "roles": [
                                                    "client"
                                                ],
                                                "credit": {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000008",
                                                    "credit": 100
                                                },
                                                "subscription": null,
                                                "cr_account": null,
                                                "custom_credit": {},
                                                "accounts": [],
                                                "token": "YOUR_NEW_ACCESS_TOKEN"
                                            },
                                            "message": "Example response message"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · With related account and subscription",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "name": "Sam Smith",
                                                "email": "sam@example.com",
                                                "phone": "212600000000",
                                                "shop_domain": null,
                                                "auth_type": null,
                                                "language": "en",
                                                "phone_verified_at": "2026-09-22T10:00:00.000000Z",
                                                "two_factor_enabled": false,
                                                "two_factor_verified": false,
                                                "first_message_wizard_completed": false,
                                                "roles": [
                                                    "client"
                                                ],
                                                "credit": {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000008",
                                                    "credit": 100
                                                },
                                                "subscription": {
                                                    "price": 100,
                                                    "start_date": "01/09/2026",
                                                    "end_date": "01/10/2026",
                                                    "status": "active",
                                                    "is_expired": false,
                                                    "auto_renewable": false
                                                },
                                                "cr_account": {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000052",
                                                    "name": "Example account"
                                                },
                                                "custom_credit": {},
                                                "accounts": [
                                                    {
                                                        "id": "018f16b6-7696-4ae8-8cf0-000000000053",
                                                        "name": "Example sender"
                                                    }
                                                ],
                                                "token": "YOUR_NEW_ACCESS_TOKEN"
                                            },
                                            "message": "Example response message"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/register": {
            "post": {
                "operationId": "register",
                "summary": "Register",
                "description": "Create an account using your premium account API token, or a registration token issued by an administrator.\n\n- Both token owners must have an active account and a verified phone. Admin approval alone does not make a non-premium account’s normal API token eligible; use the dedicated token issued by the administrator.\n\n- No turnstile_token. The new account must verify its phone before using protected endpoints.\n\n- Missing, invalid, expired, revoked or ineligible tokens return 401. Invalid fields return 422. Registration failures return 404. Rate limits return 429 with Retry-After.\n\n- Registration is limited to 5 attempts per minute and 100 per day per token owner; per-IP limits also apply.",
                "tags": [
                    "Authentication"
                ],
                "security": [
                    {
                        "registrationToken": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "2–50 characters: letters in any script, with spaces, hyphens, apostrophes and dots, starting with a letter. Repeated spaces are collapsed. Prohibited names and unsafe content are rejected."
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Unique email with valid syntax and DNS, maximum 255 characters. Prohibited values are rejected."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Unique, valid international phone number. Formatting is stripped; national numbers are normalized using country_code."
                                    },
                                    "country_code": {
                                        "type": "string",
                                        "description": "Existing two-letter uppercase country code, for example MA."
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "8–255 characters with at least one lowercase letter, one uppercase letter and one digit. Any other character may be used; recognisable SQL injection payloads are rejected."
                                    },
                                    "c_password": {
                                        "type": "string",
                                        "description": "Must match password."
                                    }
                                },
                                "required": [
                                    "name",
                                    "email",
                                    "phone",
                                    "country_code",
                                    "password",
                                    "c_password"
                                ]
                            },
                            "example": {
                                "name": "Sam Smith",
                                "email": "sam@example.com",
                                "phone": "212600000000",
                                "country_code": "MA",
                                "password": "CHANGEme123!",
                                "c_password": "CHANGEme123!"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, name, email, phone, shop_domain, auth_type, language, phone_verified_at, two_factor_enabled, two_factor_verified, first_message_wizard_completed, roles, credit, subscription, cr_account, accounts, token and custom_credit. Login and registration populate data.token. credit contains id and credit; subscription contains price, start_date, end_date, status, is_expired, auto_renewable; cr_account contains id and name. Related records can be null. accounts entries contain id and name; provider identifier fields are omitted in v2. A loaded phone contains id, display_phone_number, is_catalog_visible and is_cart_enabled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                        "name": "Sam Smith",
                                        "email": "sam@example.com",
                                        "phone": "212600000000",
                                        "shop_domain": null,
                                        "auth_type": null,
                                        "language": "en",
                                        "phone_verified_at": null,
                                        "two_factor_enabled": false,
                                        "two_factor_verified": false,
                                        "first_message_wizard_completed": false,
                                        "roles": [
                                            "client"
                                        ],
                                        "credit": {
                                            "id": "018f16b6-7696-4ae8-8cf0-000000000008",
                                            "credit": 100
                                        },
                                        "subscription": null,
                                        "cr_account": null,
                                        "custom_credit": {},
                                        "accounts": [],
                                        "token": "YOUR_NEW_ACCESS_TOKEN"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/user": {
            "get": {
                "operationId": "userInfo",
                "summary": "User info",
                "description": "Read the authenticated account.",
                "tags": [
                    "Authentication"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, name, email, phone, shop_domain, auth_type, language, phone_verified_at, two_factor_enabled, two_factor_verified, first_message_wizard_completed, roles, credit, subscription, cr_account and custom_credit. credit contains id and credit; subscription contains price, start_date, end_date, status, is_expired, auto_renewable; cr_account contains id and name. Related records can be null.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Example response",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "name": "Sam Smith",
                                                "email": "sam@example.com",
                                                "phone": "212600000000",
                                                "shop_domain": null,
                                                "auth_type": null,
                                                "language": "en",
                                                "phone_verified_at": "2026-09-22T10:00:00.000000Z",
                                                "two_factor_enabled": false,
                                                "two_factor_verified": false,
                                                "first_message_wizard_completed": false,
                                                "roles": [
                                                    "client"
                                                ],
                                                "credit": {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000008",
                                                    "credit": 100
                                                },
                                                "subscription": null,
                                                "cr_account": null,
                                                "custom_credit": {}
                                            },
                                            "message": "Example response message"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · With related account and subscription",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "name": "Sam Smith",
                                                "email": "sam@example.com",
                                                "phone": "212600000000",
                                                "shop_domain": null,
                                                "auth_type": null,
                                                "language": "en",
                                                "phone_verified_at": "2026-09-22T10:00:00.000000Z",
                                                "two_factor_enabled": false,
                                                "two_factor_verified": false,
                                                "first_message_wizard_completed": false,
                                                "roles": [
                                                    "client"
                                                ],
                                                "credit": {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000008",
                                                    "credit": 100
                                                },
                                                "subscription": {
                                                    "price": 100,
                                                    "start_date": "01/09/2026",
                                                    "end_date": "01/10/2026",
                                                    "status": "active",
                                                    "is_expired": false,
                                                    "auto_renewable": false
                                                },
                                                "cr_account": {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000052",
                                                    "name": "Example account"
                                                },
                                                "custom_credit": {}
                                            },
                                            "message": "Example response message"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/categories": {
            "get": {
                "operationId": "categories",
                "summary": "Categories",
                "description": "List template categories.",
                "tags": [
                    "Resources"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [{id, name}], message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "name": "Marketing"
                                        }
                                    ],
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/templates": {
            "get": {
                "operationId": "templates",
                "summary": "Templates",
                "description": "Find templates and their variable definitions.\n\n- Includes active public templates and active private templates assigned to your account. Accounts configured for private templates only see their assigned private templates.\n\n- Assign a public template to your account before using its ID to look up senders or send a message.\n\n- Provider components appear only when the with_fb_components query flag is present. Pricing can be null; it requires pricing to be enabled for both the account and template.\n\n- Template variable definitions and file metadata depend on the selected template. They are returned as decoded JSON, not JSON-encoded strings.",
                "tags": [
                    "Resources"
                ],
                "parameters": [
                    {
                        "name": "language_id",
                        "in": "query",
                        "required": true,
                        "description": "Existing language ID; always numeric.",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "is_broadcast",
                        "in": "query",
                        "required": true,
                        "description": "Use 1 to append recipient phone and any file URL variable to the returned variables.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        },
                        "example": 0
                    },
                    {
                        "name": "name",
                        "in": "query",
                        "required": false,
                        "description": "Case-insensitive partial match on the display name.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter by category.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "has_flow_form",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this template capability.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "has_carousel",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this template capability.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "has_flow",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this template capability.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "is_calendar",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this template capability.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "is_otp",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this template capability.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "with_fb_components",
                        "in": "query",
                        "required": false,
                        "description": "Presence includes direct_message and fb_template_components, even if the value is 0.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [...], message}. Each template has id, name, description, image, variables, global_variables, catch_data, has_file, has_flow_form, has_flow, is_carousel, is_calendar, file_data, pricing. variables, global_variables and catch_data are decoded JSON values; file_data is a decoded object or null; pricing is null or {name, credit}. The with_fb_components flag adds direct_message and fb_template_components.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Example response",
                                        "value": {
                                            "success": true,
                                            "data": [
                                                {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                    "name": "Example template",
                                                    "description": "",
                                                    "image": "https://example.com/template.png",
                                                    "variables": [],
                                                    "global_variables": [],
                                                    "catch_data": [],
                                                    "has_file": false,
                                                    "has_flow_form": false,
                                                    "has_flow": false,
                                                    "is_carousel": false,
                                                    "is_calendar": false,
                                                    "file_data": null,
                                                    "pricing": null
                                                }
                                            ],
                                            "message": "Example response message"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · With with_fb_components and pricing enabled",
                                        "value": {
                                            "success": true,
                                            "data": [
                                                {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                    "name": "Example template",
                                                    "description": "",
                                                    "image": "https://example.com/template.png",
                                                    "variables": [],
                                                    "global_variables": [],
                                                    "catch_data": [],
                                                    "has_file": false,
                                                    "has_flow_form": false,
                                                    "has_flow": false,
                                                    "is_carousel": false,
                                                    "is_calendar": false,
                                                    "file_data": null,
                                                    "pricing": {
                                                        "name": "Example category",
                                                        "credit": 1
                                                    },
                                                    "direct_message": false,
                                                    "fb_template_components": []
                                                }
                                            ],
                                            "message": "Example response message"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/template/accounts": {
            "get": {
                "operationId": "templateAccounts",
                "summary": "Template accounts",
                "description": "Get sender choices for a selected template.\n\n- Send messages with template_account_flow_id, not the account/group ID. The sender must be active and its account subscription active.\n\n- The template must be attached to your account and the sender account assigned to you.",
                "tags": [
                    "Resources"
                ],
                "parameters": [
                    {
                        "name": "template_id",
                        "in": "query",
                        "required": true,
                        "description": "Template returned by Templates.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000042"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [...], message}. Each choice has account_id, has_form, template_account_flow_id, phone, private, country. country contains id, name, code, flag. Country IDs are record identifiers, not telephone prefixes.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "account_id": "018f16b6-7696-4ae8-8cf0-000000000052",
                                            "has_form": false,
                                            "template_account_flow_id": "018f16b6-7696-4ae8-8cf0-000000000073",
                                            "phone": "212600000000",
                                            "private": true,
                                            "country": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000009",
                                                "name": "Morocco",
                                                "code": "MA",
                                                "flag": ""
                                            }
                                        }
                                    ],
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/languages": {
            "get": {
                "operationId": "languages",
                "summary": "Languages",
                "description": "List the language IDs used in requests.",
                "tags": [
                    "Resources"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [{id, language, flag}], message}. id remains numeric in both versions.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": 1,
                                            "language": "English",
                                            "flag": ""
                                        }
                                    ],
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/credits": {
            "get": {
                "operationId": "credits",
                "summary": "Credits",
                "description": "Read the account credit record.\n\n- If the account has no credit record, the balance is 0. V2 omits the empty record ID.",
                "tags": [
                    "Resources"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {id, credit}, message}. An account without a credit record returns credit: 0; v2 omits its empty id.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "credit": 100
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/messages": {
            "post": {
                "operationId": "sendMessage",
                "summary": "Send message",
                "description": "Send one template message or schedule it for later.\n\n- Example variables are illustrative. Replace data with the exact variables returned for your template. Replace every example ID and phone number before sending.\n\n- Optional Idempotency-Key header: 8–128 letters, digits, dots, colons, underscores or hyphens. Reuse the same key and payload for retries. Invalid keys return 422. Reusing a key with different input returns 409; an operation still being processed can return 202.\n\n- Available credit, recipient opt-outs and template/sender access are checked before sending. SMS fallback depends on SMS availability and credit. Accepted WhatsApp sends wait for the configured delay and are checked for delivery; rejected sends can fall back immediately.\n\n- Immediate sends return the provider result in data. Scheduled sends return scheduled_for; queued carousel responses include queued: true. A 202 response means delivery is still pending.\n\n- Provider rejections can return 422. Template data or business-rule failures can return 404.",
                "tags": [
                    "Messaging"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Optional. 8–128 letters, digits, dots, colons, underscores or hyphens. A retry with the same key and the same body gets the first answer back instead of a second send; the same key with a different body answers 409.",
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name for the message/broadcast record."
                                    },
                                    "template_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Accessible template ID."
                                    },
                                    "template_account_flow_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Subscribed sender flow for the selected template."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "pattern": "^[0-9]+$",
                                        "description": "Recipient number with country calling code, without punctuation."
                                    },
                                    "country_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Existing Country record ID."
                                    },
                                    "data": {
                                        "type": "object",
                                        "description": "All variables and global variables required by the selected template, keyed by variable name. OTP values must contain digits only; URL variables must use http or https."
                                    },
                                    "is_test": {
                                        "type": "boolean",
                                        "description": "For a file template, a truthy value allows a file URL under file_data.variable instead of an uploaded file."
                                    },
                                    "as_form": {
                                        "type": "string",
                                        "description": "For a form template, including this field selects form sending. Omit it to disable; even as_form: false counts as present in this endpoint."
                                    },
                                    "delayed_to": {
                                        "type": "string",
                                        "description": "At least 15 minutes in the future. Include an explicit timezone when using a timezone-aware date."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "listener_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Receive broadcast status and contact updates at this URL. See Status listener below."
                                    },
                                    "sms_fallback": {
                                        "type": "boolean",
                                        "description": "Enable SMS fallback after a WhatsApp attempt. Only for accounts that have bought credits at least once, or premium accounts; free credits cover WhatsApp only, so any other account is refused with 422."
                                    },
                                    "sms_fallback_text": {
                                        "type": "string",
                                        "description": "Required when sms_fallback is true or 1. Maximum 640 characters."
                                    },
                                    "sms_fallback_delay": {
                                        "type": "integer",
                                        "description": "Seconds: 30–86400. Default 60."
                                    },
                                    "sms_fallback_from": {
                                        "type": "string",
                                        "description": "Sender name, maximum 64 characters. Must be a public sender name or one assigned to your account, and enabled; anything else is refused with 422. Omit it to use the default sender name."
                                    },
                                    "sms_fallback_operator": {
                                        "type": "string",
                                        "description": "IAM, ORANGE or INWI."
                                    }
                                },
                                "required": [
                                    "name",
                                    "template_id",
                                    "template_account_flow_id",
                                    "phone"
                                ]
                            },
                            "example": {
                                "name": "Order update",
                                "template_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                "template_account_flow_id": "018f16b6-7696-4ae8-8cf0-000000000073",
                                "phone": "212600000000",
                                "data": {
                                    "customer_name": "Sam"
                                }
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name for the message/broadcast record."
                                    },
                                    "template_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Accessible template ID."
                                    },
                                    "template_account_flow_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Subscribed sender flow for the selected template."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "pattern": "^[0-9]+$",
                                        "description": "Recipient number with country calling code, without punctuation."
                                    },
                                    "country_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Existing Country record ID."
                                    },
                                    "data": {
                                        "type": "object",
                                        "description": "All variables and global variables required by the selected template, keyed by variable name. OTP values must contain digits only; URL variables must use http or https."
                                    },
                                    "is_test": {
                                        "type": "boolean",
                                        "description": "For a file template, a truthy value allows a file URL under file_data.variable instead of an uploaded file."
                                    },
                                    "as_form": {
                                        "type": "string",
                                        "description": "For a form template, including this field selects form sending. Omit it to disable; even as_form: false counts as present in this endpoint."
                                    },
                                    "delayed_to": {
                                        "type": "string",
                                        "description": "At least 15 minutes in the future. Include an explicit timezone when using a timezone-aware date."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "listener_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Receive broadcast status and contact updates at this URL. See Status listener below."
                                    },
                                    "sms_fallback": {
                                        "type": "boolean",
                                        "description": "Enable SMS fallback after a WhatsApp attempt. Only for accounts that have bought credits at least once, or premium accounts; free credits cover WhatsApp only, so any other account is refused with 422."
                                    },
                                    "sms_fallback_text": {
                                        "type": "string",
                                        "description": "Required when sms_fallback is true or 1. Maximum 640 characters."
                                    },
                                    "sms_fallback_delay": {
                                        "type": "integer",
                                        "description": "Seconds: 30–86400. Default 60."
                                    },
                                    "sms_fallback_from": {
                                        "type": "string",
                                        "description": "Sender name, maximum 64 characters. Must be a public sender name or one assigned to your account, and enabled; anything else is refused with 422. Omit it to use the default sender name."
                                    },
                                    "sms_fallback_operator": {
                                        "type": "string",
                                        "description": "IAM, ORANGE or INWI."
                                    }
                                },
                                "required": [
                                    "name",
                                    "template_id",
                                    "template_account_flow_id",
                                    "phone"
                                ]
                            }
                        }
                    },
                    "description": "{file_data.variable}: For templates with has_file, upload under the name in file_data.variable using multipart/form-data."
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200 for sent or scheduled messages: {data, message, broadcast_id, message_info_url}. Scheduled responses also include scheduled_for; queued carousels include queued: true. HTTP 202: {data: null, message, status, broadcast_id, message_info_url} when queued or awaiting reconciliation. There is no universal success field for this endpoint. Provider failures can return 422 with a reason from Refusal reasons; template data/business checks can return 404.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Sent",
                                        "value": {
                                            "data": {
                                                "messaging_product": "whatsapp",
                                                "contacts": [
                                                    {
                                                        "input": "212600000000",
                                                        "wa_id": "212600000000"
                                                    }
                                                ],
                                                "messages": [
                                                    {
                                                        "id": "wamid.HBgMMjEyNjAwMDAwMDAwFQIAERgSQzE5RkI4",
                                                        "message_status": "accepted"
                                                    }
                                                ]
                                            },
                                            "message": "Message has been sent successfully",
                                            "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "message_info_url": "https://1confirmed.com/api/v2/contacts?broadcast_id=018f16b6-7696-4ae8-8cf0-000000000042"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · Scheduled",
                                        "value": {
                                            "data": null,
                                            "message": "Message has been scheduled successfully for 2026-09-23 10:00:00",
                                            "scheduled_for": "2026-09-23 10:00:00",
                                            "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "message_info_url": "https://1confirmed.com/api/v2/contacts?broadcast_id=018f16b6-7696-4ae8-8cf0-000000000042"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "202": {
                        "description": "202 · Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "202 · Queued",
                                        "value": {
                                            "data": null,
                                            "message": "Message is queued.",
                                            "status": "queued",
                                            "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "message_info_url": "https://1confirmed.com/api/v2/contacts?broadcast_id=018f16b6-7696-4ae8-8cf0-000000000042"
                                        }
                                    },
                                    "example2": {
                                        "summary": "202 · Awaiting reconciliation",
                                        "value": {
                                            "data": null,
                                            "message": "Message submission is awaiting reconciliation.",
                                            "status": "delivery_unknown",
                                            "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "message_info_url": "https://1confirmed.com/api/v2/contacts?broadcast_id=018f16b6-7696-4ae8-8cf0-000000000042"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "422 · Refused by WhatsApp",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "reason": "provider_refused"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/send-broadcast": {
            "post": {
                "operationId": "sendBroadcast",
                "summary": "Send broadcast",
                "description": "Create and queue a broadcast in one request.\n\n- Fetch Templates with is_broadcast=1 first. Replace customer_name with your template variables. Recipient phone values must be digits (an optional leading + is accepted); duplicate phones are rejected unless sending as a form. File templates need their file URL variable in each row.\n\n- The follow-up template must be active, accessible and available on the same sender as the primary template. Its mapping must have exactly as many rows as data.data, in original recipient order, with values keyed by variable name. Each required value must be a nonempty scalar, maximum 1000 characters.\n\n- Optional Idempotency-Key is supported as for Send message. Queued acceptance does not mean delivery; inspect contacts and status callbacks.\n\n- Connector-specific webhook_* and zoho_* fields are described under Result connectors below. They are optional and are separate from listener_url.",
                "tags": [
                    "Broadcasts"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Optional. 8–128 letters, digits, dots, colons, underscores or hyphens. A retry with the same key and the same body gets the first answer back instead of a second send; the same key with a different body answers 409.",
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nonempty broadcast name; the literal string null is rejected."
                                    },
                                    "language_id": {
                                        "type": "integer",
                                        "description": "Existing language ID."
                                    },
                                    "template_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Accessible template."
                                    },
                                    "template_account_flow_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Subscribed sender flow for that template."
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "Encode an object with a data array of recipient objects. Each row contains phone and the selected template variables. This field is a string, not a JSON object or array."
                                    },
                                    "global_data": {
                                        "type": "object",
                                        "description": "Shared template variable values keyed by variable name. Supply values required by the template; OTP globals must be digits and URL globals must be HTTP(S) URLs."
                                    },
                                    "country_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Existing Country record."
                                    },
                                    "as_form": {
                                        "type": "boolean",
                                        "description": "true/false, 1/0, \"true\"/\"false\", \"on\"/\"off\" are accepted. True requires a form template. Unlike single messages, false disables form sending."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Excel xlsx/xls source file, using multipart/form-data. data is still required."
                                    },
                                    "saved_list_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Owned or shared saved list. data is still required."
                                    },
                                    "delayed_to": {
                                        "type": "string",
                                        "description": "Y-m-d H:i:s in the application timezone, at least 15 minutes in the future. Omit for immediate queuing."
                                    },
                                    "calendar_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Your valid calendar for a calendar template."
                                    },
                                    "use_best_time": {
                                        "type": "boolean",
                                        "description": "Use recipient best-time scheduling."
                                    },
                                    "best_time_fallback": {
                                        "type": "string",
                                        "description": "now or global; controls recipients without their own send time when use_best_time is enabled."
                                    },
                                    "track_links": {
                                        "type": "object",
                                        "description": "Template variables whose value is a link written in the message text, at most 20. Each recipient gets their own tracked copy of that link, and opens are counted in the portal. Never name a variable holding an image or file address. A follow-up sending the same address is tracked through the same link.",
                                        "properties": {
                                            "*": {
                                                "type": "string",
                                                "description": "One variable name: letters, digits, spaces and _ . -, at most 191 characters."
                                            }
                                        }
                                    },
                                    "follow_up_configuration": {
                                        "oneOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "hours": {
                                                        "type": "integer",
                                                        "description": "Required with follow_up_configuration. 1–168 hours."
                                                    },
                                                    "template_id": {
                                                        "type": "string",
                                                        "format": "uuid",
                                                        "description": "Required with follow_up_configuration. Follow-up template on the same sender."
                                                    },
                                                    "mapping": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object"
                                                        },
                                                        "description": "Required with follow_up_configuration. At least one row; one row per original recipient, keyed by variable name."
                                                    },
                                                    "global_variables": {
                                                        "type": "object",
                                                        "description": "Shared follow-up template values. Nonempty scalar values, maximum 1000 characters; OTP and URL rules also apply."
                                                    },
                                                    "calendar_id": {
                                                        "type": "string",
                                                        "format": "uuid",
                                                        "description": "Owned, valid calendar when the follow-up template is a calendar template."
                                                    },
                                                    "as_form": {
                                                        "type": "boolean",
                                                        "description": "Same accepted values as as_form; true requires a follow-up form template."
                                                    },
                                                    "ai_flow_config": {
                                                        "oneOf": [
                                                            {
                                                                "type": "object"
                                                            },
                                                            {
                                                                "type": "string"
                                                            }
                                                        ],
                                                        "description": "Published AI Flow selection for the follow-up."
                                                    }
                                                }
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Finite follow-up. Include hours (integer 1–168), template_id and mapping (one row per recipient in recipient order, keyed by template-variable name; use an empty array for a row with no variables)."
                                    },
                                    "list_name": {
                                        "type": "string",
                                        "description": "When nonempty, also save a recipient list. Supply json_data alongside it."
                                    },
                                    "json_data": {
                                        "type": "string",
                                        "description": "List contents to persist when list_name is supplied. Separate from the required sending data field."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "listener_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Receive broadcast status and contact updates at this URL. See Status listener below."
                                    },
                                    "sms_fallback": {
                                        "type": "boolean",
                                        "description": "Enable SMS fallback after a WhatsApp attempt. Only for accounts that have bought credits at least once, or premium accounts; free credits cover WhatsApp only, so any other account is refused with 422."
                                    },
                                    "sms_fallback_text": {
                                        "type": "string",
                                        "description": "Required when sms_fallback is true or 1. Maximum 640 characters."
                                    },
                                    "sms_fallback_delay": {
                                        "type": "integer",
                                        "description": "Seconds: 30–86400. Default 60."
                                    },
                                    "sms_fallback_from": {
                                        "type": "string",
                                        "description": "Sender name, maximum 64 characters. Must be a public sender name or one assigned to your account, and enabled; anything else is refused with 422. Omit it to use the default sender name."
                                    },
                                    "sms_fallback_operator": {
                                        "type": "string",
                                        "description": "IAM, ORANGE or INWI."
                                    }
                                },
                                "required": [
                                    "name",
                                    "language_id",
                                    "template_id",
                                    "template_account_flow_id",
                                    "data"
                                ]
                            },
                            "example": {
                                "name": "Order updates",
                                "language_id": 1,
                                "template_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                "template_account_flow_id": "018f16b6-7696-4ae8-8cf0-000000000073",
                                "data": "{\"data\":[{\"phone\":\"212600000000\",\"customer_name\":\"Sam\"}]}"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nonempty broadcast name; the literal string null is rejected."
                                    },
                                    "language_id": {
                                        "type": "integer",
                                        "description": "Existing language ID."
                                    },
                                    "template_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Accessible template."
                                    },
                                    "template_account_flow_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Subscribed sender flow for that template."
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "Encode an object with a data array of recipient objects. Each row contains phone and the selected template variables. This field is a string, not a JSON object or array."
                                    },
                                    "global_data": {
                                        "type": "object",
                                        "description": "Shared template variable values keyed by variable name. Supply values required by the template; OTP globals must be digits and URL globals must be HTTP(S) URLs."
                                    },
                                    "country_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Existing Country record."
                                    },
                                    "as_form": {
                                        "type": "boolean",
                                        "description": "true/false, 1/0, \"true\"/\"false\", \"on\"/\"off\" are accepted. True requires a form template. Unlike single messages, false disables form sending."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Excel xlsx/xls source file, using multipart/form-data. data is still required."
                                    },
                                    "saved_list_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Owned or shared saved list. data is still required."
                                    },
                                    "delayed_to": {
                                        "type": "string",
                                        "description": "Y-m-d H:i:s in the application timezone, at least 15 minutes in the future. Omit for immediate queuing."
                                    },
                                    "calendar_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Your valid calendar for a calendar template."
                                    },
                                    "use_best_time": {
                                        "type": "boolean",
                                        "description": "Use recipient best-time scheduling."
                                    },
                                    "best_time_fallback": {
                                        "type": "string",
                                        "description": "now or global; controls recipients without their own send time when use_best_time is enabled."
                                    },
                                    "track_links": {
                                        "type": "object",
                                        "description": "Template variables whose value is a link written in the message text, at most 20. Each recipient gets their own tracked copy of that link, and opens are counted in the portal. Never name a variable holding an image or file address. A follow-up sending the same address is tracked through the same link.",
                                        "properties": {
                                            "*": {
                                                "type": "string",
                                                "description": "One variable name: letters, digits, spaces and _ . -, at most 191 characters."
                                            }
                                        }
                                    },
                                    "follow_up_configuration": {
                                        "oneOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "hours": {
                                                        "type": "integer",
                                                        "description": "Required with follow_up_configuration. 1–168 hours."
                                                    },
                                                    "template_id": {
                                                        "type": "string",
                                                        "format": "uuid",
                                                        "description": "Required with follow_up_configuration. Follow-up template on the same sender."
                                                    },
                                                    "mapping": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object"
                                                        },
                                                        "description": "Required with follow_up_configuration. At least one row; one row per original recipient, keyed by variable name."
                                                    },
                                                    "global_variables": {
                                                        "type": "object",
                                                        "description": "Shared follow-up template values. Nonempty scalar values, maximum 1000 characters; OTP and URL rules also apply."
                                                    },
                                                    "calendar_id": {
                                                        "type": "string",
                                                        "format": "uuid",
                                                        "description": "Owned, valid calendar when the follow-up template is a calendar template."
                                                    },
                                                    "as_form": {
                                                        "type": "boolean",
                                                        "description": "Same accepted values as as_form; true requires a follow-up form template."
                                                    },
                                                    "ai_flow_config": {
                                                        "oneOf": [
                                                            {
                                                                "type": "object"
                                                            },
                                                            {
                                                                "type": "string"
                                                            }
                                                        ],
                                                        "description": "Published AI Flow selection for the follow-up."
                                                    }
                                                }
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Finite follow-up. Include hours (integer 1–168), template_id and mapping (one row per recipient in recipient order, keyed by template-variable name; use an empty array for a row with no variables)."
                                    },
                                    "list_name": {
                                        "type": "string",
                                        "description": "When nonempty, also save a recipient list. Supply json_data alongside it."
                                    },
                                    "json_data": {
                                        "type": "string",
                                        "description": "List contents to persist when list_name is supplied. Separate from the required sending data field."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "listener_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Receive broadcast status and contact updates at this URL. See Status listener below."
                                    },
                                    "sms_fallback": {
                                        "type": "boolean",
                                        "description": "Enable SMS fallback after a WhatsApp attempt. Only for accounts that have bought credits at least once, or premium accounts; free credits cover WhatsApp only, so any other account is refused with 422."
                                    },
                                    "sms_fallback_text": {
                                        "type": "string",
                                        "description": "Required when sms_fallback is true or 1. Maximum 640 characters."
                                    },
                                    "sms_fallback_delay": {
                                        "type": "integer",
                                        "description": "Seconds: 30–86400. Default 60."
                                    },
                                    "sms_fallback_from": {
                                        "type": "string",
                                        "description": "Sender name, maximum 64 characters. Must be a public sender name or one assigned to your account, and enabled; anything else is refused with 422. Omit it to use the default sender name."
                                    },
                                    "sms_fallback_operator": {
                                        "type": "string",
                                        "description": "IAM, ORANGE or INWI."
                                    }
                                },
                                "required": [
                                    "name",
                                    "language_id",
                                    "template_id",
                                    "template_account_flow_id",
                                    "data"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Example response",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "sent_at": "2026-09-22",
                                                "name": "Order updates",
                                                "contacts": 1,
                                                "language": "English",
                                                "template": "Example template",
                                                "whatsapp_area": null,
                                                "is_draft": false,
                                                "mapping": null,
                                                "global_data": null,
                                                "confirmations": 0,
                                                "has_file": false,
                                                "is_flow_form": false,
                                                "file": "",
                                                "listener_url": null
                                            },
                                            "message": "Example response message"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · With follow-up configured",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "sent_at": "2026-09-22",
                                                "name": "Order updates",
                                                "contacts": 1,
                                                "language": "English",
                                                "template": "Example template",
                                                "whatsapp_area": null,
                                                "is_draft": false,
                                                "mapping": null,
                                                "global_data": null,
                                                "confirmations": 0,
                                                "has_file": false,
                                                "is_flow_form": false,
                                                "file": "",
                                                "listener_url": null,
                                                "follow_up_configuration": {
                                                    "hours": 24,
                                                    "template_id": "018f16b6-7696-4ae8-8cf0-000000000011",
                                                    "calendar_id": "018f16b6-7696-4ae8-8cf0-000000000012",
                                                    "mapping": [
                                                        {
                                                            "customer_name": "Sam"
                                                        }
                                                    ],
                                                    "global_data": [],
                                                    "is_flow_form": false
                                                }
                                            },
                                            "message": "Example response message"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcasts": {
            "post": {
                "operationId": "createBroadcast",
                "summary": "Create draft",
                "description": "Create a draft record. This request does not send messages.",
                "tags": [
                    "Broadcasts"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Broadcast name."
                                    },
                                    "language_id": {
                                        "type": "integer",
                                        "description": "An ID returned by Languages. Numeric in both versions."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "listener_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Receive broadcast status and contact updates at this URL. See Status listener below."
                                    }
                                },
                                "required": [
                                    "name",
                                    "language_id"
                                ]
                            },
                            "example": {
                                "name": "My broadcast",
                                "language_id": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": null,
                                        "template": null,
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "get": {
                "operationId": "broadcastList",
                "summary": "Broadcast list",
                "description": "Search your broadcasts by name or template name. Returns 15 records per page.\n\n- sent_at is a display label and can describe a scheduled or cancelled broadcast.",
                "tags": [
                    "Broadcasts"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search the records described above.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 15.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {broadcasts: [...], pagination}, message}. Fields: id, sent_at, name, contacts, stop_notifications, language, template, template_image, whatsapp_area, is_draft, read, delivered, confirmations, sent, interacted, cost, file_extension, has_file, status, in_queue, reengagement, delayed_to, refused, scheduled_jobs_count, cancellation_comment. reengagement is null or {id, hours}. sent_at is a display label and may contain Scheduled or Cancelled.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "broadcasts": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "sent_at": "2026-09-22",
                                                "name": "Order updates",
                                                "contacts": 0,
                                                "language": null,
                                                "template": null,
                                                "whatsapp_area": null,
                                                "is_draft": true,
                                                "confirmations": 0,
                                                "has_file": false,
                                                "stop_notifications": 0,
                                                "template_image": "https://example.com/template.png",
                                                "read": 0,
                                                "delivered": 0,
                                                "sent": 0,
                                                "interacted": 0,
                                                "cost": 0,
                                                "file_extension": "",
                                                "status": null,
                                                "in_queue": false,
                                                "reengagement": null,
                                                "delayed_to": null,
                                                "refused": false,
                                                "scheduled_jobs_count": 0,
                                                "cancellation_comment": null
                                            }
                                        ],
                                        "pagination": {
                                            "total": 1,
                                            "count": 1,
                                            "per_page": 15,
                                            "next_page_url": null,
                                            "prev_page_url": null,
                                            "current_page": 1,
                                            "total_pages": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcasts/{id}": {
            "get": {
                "operationId": "broadcastContacts",
                "summary": "Broadcast details",
                "description": "Read a broadcast belonging to your account.",
                "tags": [
                    "Broadcasts"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Replace the sample ID with the broadcast ID.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": null,
                                        "template": null,
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "operationId": "updateBroadcast",
                "summary": "Update draft",
                "description": "Update the name, language, AI Flow or listener on a draft. PATCH is also supported.\n\n- This endpoint does not reschedule a send. It refuses broadcasts that are no longer drafts. Scheduling changes in the portal are browser-session operations.",
                "tags": [
                    "Broadcasts"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Broadcast name."
                                    },
                                    "language_id": {
                                        "type": "integer",
                                        "description": "An ID returned by Languages. Numeric in both versions."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "listener_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Receive broadcast status and contact updates at this URL. See Status listener below."
                                    }
                                },
                                "required": [
                                    "name",
                                    "language_id"
                                ]
                            },
                            "example": {
                                "name": "Updated broadcast",
                                "language_id": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": null,
                                        "template": null,
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/contacts": {
            "get": {
                "operationId": "broadcastContactsList",
                "summary": "Broadcast contacts",
                "description": "List contacts in one of your broadcasts, 15 per page.",
                "tags": [
                    "Contacts"
                ],
                "parameters": [
                    {
                        "name": "broadcast_id",
                        "in": "query",
                        "required": true,
                        "description": "Broadcast belonging to your account.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    },
                    {
                        "name": "follow_up",
                        "in": "query",
                        "required": false,
                        "description": "0 (default) lists primary contacts; 1 lists follow-up contacts.",
                        "schema": {
                            "type": "integer",
                            "enum": [
                                0,
                                1
                            ]
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 date-time, for example 2026-10-27T09:00:00Z. Only contacts changed at or after this moment.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 15.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {contacts: [...], pagination}, message}. Contact fields: id, phone, broadcast_name, data, delivery_date, received_at, confirmed, canceled, interacted, cost, is_sent, message_id, sms_fallback, reply_at, statuses. message_id is the WhatsApp message id (wamid), or null before WhatsApp accepted the message. Each status has id, status, timestamp. sms_fallback is null or {id, text, cost, status, sent_at}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "contacts": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "phone": "212600000000",
                                                "broadcast_name": "Order updates",
                                                "data": "{\"customer_name\":\"Sam\"}",
                                                "delivery_date": "2026-09-22 10:00:00",
                                                "received_at": "2026-09-22 10:00:00",
                                                "confirmed": true,
                                                "canceled": false,
                                                "interacted": true,
                                                "cost": 1,
                                                "is_sent": true,
                                                "message_id": "wamid.HBgMMjEyNjAwMDAwMDAwFQIAERgSQzE5RkI4",
                                                "sms_fallback": null,
                                                "reply_at": null,
                                                "statuses": [
                                                    {
                                                        "id": "018f16b6-7696-4ae8-8cf0-000000000016",
                                                        "status": "delivered",
                                                        "timestamp": "1790071200"
                                                    }
                                                ]
                                            }
                                        ],
                                        "pagination": {
                                            "total": 1,
                                            "count": 1,
                                            "per_page": 15,
                                            "next_page_url": null,
                                            "prev_page_url": null,
                                            "current_page": 1,
                                            "total_pages": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/filter/contacts/segments": {
            "get": {
                "operationId": "filterContacts",
                "summary": "Filter contacts",
                "description": "Search contacts in your broadcasts, 20 per page.",
                "tags": [
                    "Contacts"
                ],
                "parameters": [
                    {
                        "name": "broadcast_id",
                        "in": "query",
                        "required": false,
                        "description": "Limit to one broadcast.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Match a stored message status, for example delivered or read.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "required": false,
                        "description": "Partial phone-number match.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_sent",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this value; use 1 or 0.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "confirmed",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this value; use 1 or 0.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "interacted",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this value; use 1 or 0.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "canceled",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this value; use 1 or 0.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "has_data",
                        "in": "query",
                        "required": false,
                        "description": "Filter by this value; use 1 or 0.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "date_range[]",
                        "in": "query",
                        "required": false,
                        "description": "Start and end bounds for contact created_at.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_since",
                        "in": "query",
                        "required": false,
                        "description": "ISO 8601 date-time, for example 2026-10-27T09:00:00Z. Only contacts changed at or after this moment.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 20.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {contacts: [...], pagination}, message}. Contact fields: id, phone, broadcast_name, data, delivery_date, received_at, confirmed, canceled, interacted, cost, is_sent, message_id, sms_fallback, reply_at, statuses. message_id is the WhatsApp message id (wamid), or null before WhatsApp accepted the message. Each status has id, status, timestamp. sms_fallback is null or {id, text, cost, status, sent_at}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "contacts": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "phone": "212600000000",
                                                "broadcast_name": "Order updates",
                                                "data": "{\"customer_name\":\"Sam\"}",
                                                "delivery_date": "2026-09-22 10:00:00",
                                                "received_at": "2026-09-22 10:00:00",
                                                "confirmed": true,
                                                "canceled": false,
                                                "interacted": true,
                                                "cost": 1,
                                                "is_sent": true,
                                                "message_id": "wamid.HBgMMjEyNjAwMDAwMDAwFQIAERgSQzE5RkI4",
                                                "sms_fallback": null,
                                                "reply_at": null,
                                                "statuses": [
                                                    {
                                                        "id": "018f16b6-7696-4ae8-8cf0-000000000016",
                                                        "status": "delivered",
                                                        "timestamp": "1790071200"
                                                    }
                                                ]
                                            }
                                        ],
                                        "pagination": {
                                            "total": 1,
                                            "count": 1,
                                            "per_page": 20,
                                            "next_page_url": null,
                                            "prev_page_url": null,
                                            "current_page": 1,
                                            "total_pages": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/black-list": {
            "get": {
                "operationId": "blacklistList",
                "summary": "Blacklist",
                "description": "Read opt-outs associated with your broadcasts, account memberships or manual blocks. Search phone or broadcast name; 10 per page.",
                "tags": [
                    "Contacts"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search the records described above.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 10.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {list: [...], pagination}, message}. Each item has id, contact_phone, broadcast, sender, account, created_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "list": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "contact_phone": "212600000000",
                                                "broadcast": "Order updates",
                                                "sender": "Example sender",
                                                "account": "Example account",
                                                "created_at": "2026-09-22 10:00:00"
                                            }
                                        ],
                                        "pagination": {
                                            "total": 1,
                                            "count": 1,
                                            "per_page": 10,
                                            "next_page_url": null,
                                            "prev_page_url": null,
                                            "current_page": 1,
                                            "total_pages": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "blacklistAdd",
                "summary": "Add to blacklist",
                "description": "Create a manual account-specific block.",
                "tags": [
                    "Contacts"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "phone": {
                                        "type": "string",
                                        "description": "Maximum 15 characters. An existing manual block for this phone/account is rejected."
                                    },
                                    "cr_account_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Account assigned to you."
                                    }
                                },
                                "required": [
                                    "phone",
                                    "cr_account_id"
                                ]
                            },
                            "example": {
                                "phone": "212600000000",
                                "cr_account_id": "018f16b6-7696-4ae8-8cf0-000000000052"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data is the created block record. The server sets for_all to 2 and records your user as its creator. V2 removes numeric relationship IDs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "phone": "212600000000",
                                        "for_all": 2
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/confirmations": {
            "get": {
                "operationId": "confirmations",
                "summary": "Confirmations",
                "description": "List paid, confirmed contacts in your broadcasts. Search phone or broadcast name; 15 per page.",
                "tags": [
                    "Contacts"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search the records described above.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 15.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {paid_messages: {confirmations: [...], pagination}, unpaid_messages}, message}. Confirmation fields: id, phone, broadcast_name, data, delivery_date, received_at, confirmed, canceled, statuses. Form replies are formatted in data. unpaid_messages reports the unpaid-credit summary.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "paid_messages": {
                                            "confirmations": [
                                                {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                    "phone": "212600000000",
                                                    "broadcast_name": "Order updates",
                                                    "data": "{\"customer_name\":\"Sam\"}",
                                                    "delivery_date": "2026-09-22 10:00:00",
                                                    "received_at": "2026-09-22 10:00:00",
                                                    "confirmed": true,
                                                    "canceled": false,
                                                    "statuses": [
                                                        {
                                                            "id": "018f16b6-7696-4ae8-8cf0-000000000016",
                                                            "status": "delivered",
                                                            "timestamp": "1790071200"
                                                        }
                                                    ]
                                                }
                                            ],
                                            "pagination": {
                                                "total": 1,
                                                "count": 1,
                                                "per_page": 15,
                                                "next_page_url": null,
                                                "prev_page_url": null,
                                                "current_page": 1,
                                                "total_pages": 1
                                            }
                                        },
                                        "unpaid_messages": {
                                            "messages_unpaid_count": 0,
                                            "messages_unpaid_credit": 0
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/confirmation/listeners": {
            "get": {
                "operationId": "confirmationListeners",
                "summary": "Confirmation listener",
                "description": "Read your account-level confirmation listener.\n\n- An account without a configured listener can return 404.",
                "tags": [
                    "Contacts"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200 when configured: {success, data: {target_url, active, updated_at}, message}. An account without a listener can return 404.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "target_url": "https://example.com/confirmations",
                                        "active": true,
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "confirmationListener",
                "summary": "Save confirmation listener",
                "description": "Create or update the listener for your account.",
                "tags": [
                    "Contacts"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "target_url": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "Callback destination."
                                    },
                                    "active": {
                                        "type": "integer",
                                        "enum": [
                                            0,
                                            1
                                        ],
                                        "description": "Whether the listener is active."
                                    }
                                },
                                "required": [
                                    "target_url"
                                ]
                            },
                            "example": {
                                "target_url": "https://example.com/confirmations",
                                "active": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {target_url, active, updated_at}, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "target_url": "https://example.com/confirmations",
                                        "active": true,
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/payments": {
            "get": {
                "operationId": "paymentsList",
                "summary": "Payments",
                "description": "List your payments, newest first, 10 per page.",
                "tags": [
                    "Account"
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 10.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {payments: [...], pagination}, message}. Fields: id, price, credit, user_id, is_paid, method, created_at, updated_at, expired.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "payments": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "price": 100,
                                                "credit": 100,
                                                "user_id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "is_paid": true,
                                                "method": "Stripe",
                                                "expired": false,
                                                "created_at": "2026-09-22 10:00:00",
                                                "updated_at": "2026-09-22 10:00:00"
                                            }
                                        ],
                                        "pagination": {
                                            "total": 1,
                                            "count": 1,
                                            "per_page": 10,
                                            "next_page_url": null,
                                            "prev_page_url": null,
                                            "current_page": 1,
                                            "total_pages": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "createPayment",
                "summary": "Create payment",
                "description": "Create a checkout session for a credit purchase.\n\n- The sample credit amount is illustrative; use your account purchase limits. The server calculates price.\n\n- Open the returned URL to complete checkout. Creating the checkout does not mean payment has completed.",
                "tags": [
                    "Account"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "credit": {
                                        "type": "number",
                                        "description": "At least the configured minimum purchase, and no more than the configured maximum when one is set. Limits can differ per account."
                                    },
                                    "method": {
                                        "type": "string",
                                        "description": "Stripe or Paypal, exactly as written. The selected gateway must be available."
                                    }
                                },
                                "required": [
                                    "credit",
                                    "method"
                                ]
                            },
                            "example": {
                                "credit": 100,
                                "method": "Stripe"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {url}, message}. Open data.url to complete payment. Checkout creation does not mean credits have been paid.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "url": "https://example.com/provider-checkout"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/connections": {
            "get": {
                "operationId": "connections",
                "summary": "Connections",
                "description": "Read your login history, newest first, 10 per page.",
                "tags": [
                    "Account"
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Rows per page, 1–100. Default 10.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {logs: [...], pagination}, message}. Fields: id, user_id, device, ip_address, browser, operating_system, city, country, logged_in_at, logged_out_at. Location fields may be null.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "logs": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "user_id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "device": "Desktop",
                                                "ip_address": "192.0.2.1",
                                                "browser": "Chrome",
                                                "operating_system": "macOS",
                                                "city": null,
                                                "country": null,
                                                "logged_in_at": "2026-09-22 10:00:00",
                                                "logged_out_at": null
                                            }
                                        ],
                                        "pagination": {
                                            "total": 1,
                                            "count": 1,
                                            "per_page": 10,
                                            "next_page_url": null,
                                            "prev_page_url": null,
                                            "current_page": 1,
                                            "total_pages": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/saved-list": {
            "get": {
                "operationId": "savedList",
                "summary": "Saved lists",
                "description": "Read lists you own and lists shared with you.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Search the records described above.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Without page, data is an array of {id, name, is_shared}. With page, data contains {lists, pagination}, 10 per page; list entries also include created_at and updated_at. Both shapes are wrapped in {success, data, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Example response",
                                        "value": {
                                            "success": true,
                                            "data": [
                                                {
                                                    "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                    "name": "Customers",
                                                    "is_shared": false
                                                }
                                            ],
                                            "message": "Example response message"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · With page query parameter",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "lists": [
                                                    {
                                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                        "name": "Customers",
                                                        "is_shared": false,
                                                        "created_at": "2026-09-22 10:00:00",
                                                        "updated_at": "2026-09-22 10:00:00"
                                                    }
                                                ],
                                                "pagination": {
                                                    "total": 1,
                                                    "count": 1,
                                                    "per_page": 10,
                                                    "next_page_url": null,
                                                    "prev_page_url": null,
                                                    "current_page": 1,
                                                    "total_pages": 1
                                                }
                                            },
                                            "message": "Example response message"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "createSavedList",
                "summary": "Create saved list",
                "description": "Store recipient data for later use.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "json_data": {
                                        "type": "string",
                                        "description": "List data encoded as JSON."
                                    },
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "A broadcast you own."
                                    }
                                },
                                "required": [
                                    "name",
                                    "json_data"
                                ]
                            },
                            "example": {
                                "name": "Customers",
                                "json_data": "{\"data\":[{\"phone\":\"212600000000\"}]}"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data is the saved-list record, including name and json_data. V1 returns the numeric id and uuid; v2 exposes the UUID as id and removes internal numeric relationship IDs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "name": "Customers",
                                        "json_data": "{\"data\":[{\"phone\":\"212600000000\"}]}"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/saved-list/{id}": {
            "get": {
                "operationId": "showSavedList",
                "summary": "Saved list details",
                "description": "Read an owned or shared list, including json_data and is_shared.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID returned by Saved lists.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data is the saved-list record, including name and json_data. V1 returns the numeric id and uuid; v2 exposes the UUID as id and removes internal numeric relationship IDs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "name": "Customers",
                                        "json_data": "{\"data\":[{\"phone\":\"212600000000\"}]}",
                                        "is_shared": false
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "operationId": "updateSavedList",
                "summary": "Update saved list",
                "description": "Update a list you own. PATCH is also supported.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nonempty, maximum 255 characters when supplied."
                                    },
                                    "json_data": {
                                        "type": "string",
                                        "description": "Nonempty valid JSON when supplied."
                                    }
                                }
                            },
                            "example": {
                                "name": "Updated customers"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data is the saved-list record, including name and json_data. V1 returns the numeric id and uuid; v2 exposes the UUID as id and removes internal numeric relationship IDs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "name": "Customers",
                                        "json_data": "{\"data\":[{\"phone\":\"212600000000\"}]}"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "deleteSavedList",
                "summary": "Delete saved list",
                "description": "Delete a list you own.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: true, message}. Missing or inaccessible lists return 404.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": true,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/saved-list/{id}/clone": {
            "post": {
                "operationId": "cloneSavedList",
                "summary": "Clone saved list",
                "description": "Copy an owned or shared list into your account.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data is the saved-list record, including name and json_data. V1 returns the numeric id and uuid; v2 exposes the UUID as id and removes internal numeric relationship IDs.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "name": "Customers",
                                        "json_data": "{\"data\":[{\"phone\":\"212600000000\"}]}"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/saved-lists/{id}/share": {
            "post": {
                "operationId": "savedListShare",
                "summary": "Share saved list",
                "description": "Share a list you own with an existing user. This sends that user an email.\n\n- Saved-list endpoints require an active premium subscription or the admin role, in addition to the normal account access token.",
                "tags": [
                    "Saved lists"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Existing user email. Cannot be your own email or a user the list is already shared with."
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            },
                            "example": {
                                "email": "colleague@example.com"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: true, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": true,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sms/send": {
            "post": {
                "operationId": "smsSend",
                "summary": "Send SMS",
                "description": "Send an SMS using your account credit. SMS is available once your account has bought credits at least once, or on a premium account; free credits cover WhatsApp only.\n\n- 422 covers invalid fields, an account that has never bought credits (reason sms_requires_purchase), insufficient credit or rejected sends; unexpected sending failures return 500. Provider acceptance is not a delivery receipt.",
                "tags": [
                    "SMS"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "phone": {
                                        "type": "string",
                                        "description": "9–20 characters. Use a supported Moroccan number with calling code 212."
                                    },
                                    "text": {
                                        "type": "string",
                                        "description": "Maximum 640 characters."
                                    },
                                    "from": {
                                        "type": "string",
                                        "description": "Sender name, maximum 11 characters. Must be a public sender name or one assigned to your account, and enabled; anything else is refused with 422. Omit it to use the default sender name."
                                    },
                                    "operator": {
                                        "type": "string",
                                        "description": "IAM, ORANGE or INWI; omitted means provider/operator detection."
                                    },
                                    "preference": {
                                        "type": "string",
                                        "description": "Normal (default), Broadcast or Retry."
                                    },
                                    "interval": {
                                        "type": "integer",
                                        "description": "Required with preference=Retry. 1–60 minutes."
                                    }
                                },
                                "required": [
                                    "phone",
                                    "text"
                                ]
                            },
                            "example": {
                                "phone": "212600000000",
                                "text": "Your order is ready."
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. SMS fields: id, user_id, phone, text, from_name, cost, status, created_at, updated_at. Sending also returns credit_cost at the top level.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "user_id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                        "phone": "212600000000",
                                        "text": "Your order is ready.",
                                        "from_name": "Example",
                                        "cost": 1,
                                        "status": "ACCEPTED",
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message",
                                    "credit_cost": 1
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sms": {
            "get": {
                "operationId": "smsList",
                "summary": "SMS history",
                "description": "List your SMS messages, newest first.\n\n- Statistics cover the whole account, not just the filtered page.",
                "tags": [
                    "SMS"
                ],
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Page number, starting at 1.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Page size; default 15.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "required": false,
                        "description": "Partial phone match.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {data: [...], current_page, last_page, per_page, total, from, to, stats}, message}. stats contains total, accepted, failed and today for the account (not just the filtered page). Message entries use the SMS fields listed above.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "data": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "user_id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                                "phone": "212600000000",
                                                "text": "Your order is ready.",
                                                "from_name": "Example",
                                                "cost": 1,
                                                "status": "ACCEPTED",
                                                "created_at": "2026-09-22 10:00:00",
                                                "updated_at": "2026-09-22 10:00:00"
                                            }
                                        ],
                                        "current_page": 1,
                                        "last_page": 1,
                                        "per_page": 15,
                                        "total": 1,
                                        "from": 1,
                                        "to": 1,
                                        "stats": {
                                            "total": 1,
                                            "accepted": 1,
                                            "failed": 0,
                                            "today": 1
                                        }
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sms/{id}": {
            "get": {
                "operationId": "smsShow",
                "summary": "SMS details",
                "description": "Read one of your SMS messages.",
                "tags": [
                    "SMS"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID returned by SMS history.",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. SMS fields: id, user_id, phone, text, from_name, cost, status, created_at, updated_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "user_id": "018f16b6-7696-4ae8-8cf0-000000000007",
                                        "phone": "212600000000",
                                        "text": "Your order is ready.",
                                        "from_name": "Example",
                                        "cost": 1,
                                        "status": "ACCEPTED",
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sms/cost": {
            "get": {
                "operationId": "smsCost",
                "summary": "SMS cost",
                "description": "Read your current per-message SMS credit cost.",
                "tags": [
                    "SMS"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, cost}. This response has no data wrapper.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "cost": 1
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/template": {
            "post": {
                "operationId": "broadcastTemplate",
                "summary": "Choose template",
                "description": "After Create draft, attach the template.",
                "tags": [
                    "Broadcast wizard"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "ID of a draft you own."
                                    },
                                    "template_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Accessible template ID."
                                    }
                                },
                                "required": [
                                    "broadcast_id",
                                    "template_id"
                                ]
                            },
                            "example": {
                                "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000123",
                                "template_id": "018f16b6-7696-4ae8-8cf0-000000000042"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": "English",
                                        "template": "Example template",
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/file": {
            "post": {
                "operationId": "broadcastFile",
                "summary": "Upload source file",
                "description": "Attach a recipient source file to a draft. Existing attached media is replaced.",
                "tags": [
                    "Broadcast wizard"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "ID of a draft you own."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "csv, txt, xlsx or xls. Use multipart/form-data."
                                    }
                                },
                                "required": [
                                    "broadcast_id",
                                    "file"
                                ]
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "ID of a draft you own."
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "csv, txt, xlsx or xls. Use multipart/form-data."
                                    }
                                },
                                "required": [
                                    "broadcast_id",
                                    "file"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": null,
                                        "template": null,
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/mapping": {
            "post": {
                "operationId": "broadcastMapping",
                "summary": "Map recipients",
                "description": "Supply recipients and template values after choosing the template.\n\n- Replace customer_name with the selected template variable names. File templates require a valid file URL in each row. OTP values must contain digits only.",
                "tags": [
                    "Broadcast wizard"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "ID of a draft you own."
                                    },
                                    "data": {
                                        "type": "string",
                                        "description": "Object with a data array of recipient rows, including phone and template variable keys. Same row format as Send broadcast."
                                    },
                                    "global_data": {
                                        "type": "object",
                                        "description": "Include all global variable keys required by the template."
                                    },
                                    "as_form": {
                                        "type": "string",
                                        "description": "Including this field enables form sending; omit it to disable."
                                    }
                                },
                                "required": [
                                    "broadcast_id",
                                    "data"
                                ]
                            },
                            "example": {
                                "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000123",
                                "data": "{\"data\":[{\"phone\":\"212600000000\",\"customer_name\":\"Sam\"}]}"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": "English",
                                        "template": "Example template",
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/country": {
            "post": {
                "operationId": "broadcastCountry",
                "summary": "Choose sender",
                "description": "Set the sending account flow for the draft.",
                "tags": [
                    "Broadcast wizard"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "ID of a draft you own."
                                    },
                                    "template_account_flow_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Sender flow for the selected template."
                                    },
                                    "country_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Country record ID."
                                    }
                                },
                                "required": [
                                    "broadcast_id",
                                    "template_account_flow_id"
                                ]
                            },
                            "example": {
                                "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000123",
                                "template_account_flow_id": "018f16b6-7696-4ae8-8cf0-000000000073"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 0,
                                        "language": "English",
                                        "template": "Example template",
                                        "whatsapp_area": null,
                                        "is_draft": true,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/send": {
            "post": {
                "operationId": "broadcastSend",
                "summary": "Send draft",
                "description": "Queue a prepared draft after template, mapping and sender steps.\n\n- Supports the optional Idempotency-Key header. Requires valid mapped recipients and enough credit. Large or flagged broadcasts can be held for review.",
                "tags": [
                    "Broadcast wizard"
                ],
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Optional. 8–128 letters, digits, dots, colons, underscores or hyphens. A retry with the same key and the same body gets the first answer back instead of a second send; the same key with a different body answers 409.",
                        "schema": {
                            "type": "string",
                            "pattern": "^[A-Za-z0-9._:-]{8,128}$"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "broadcast_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "ID of a draft you own."
                                    },
                                    "delayed_to": {
                                        "type": "string",
                                        "description": "At least 15 minutes in the future."
                                    },
                                    "ai_flow_config": {
                                        "oneOf": [
                                            {
                                                "type": "object"
                                            },
                                            {
                                                "type": "string"
                                            }
                                        ],
                                        "description": "Select an owned, published AI Flow. See AI Flow configuration below."
                                    },
                                    "track_links": {
                                        "type": "object",
                                        "description": "Template variables whose value is a link written in the message text, at most 20. Each recipient gets their own tracked copy of that link, and opens are counted in the portal. Never name a variable holding an image or file address. A follow-up sending the same address is tracked through the same link.",
                                        "properties": {
                                            "*": {
                                                "type": "string",
                                                "description": "One variable name: letters, digits, spaces and _ . -, at most 191 characters."
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "broadcast_id"
                                ]
                            },
                            "example": {
                                "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000123"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. data contains id, sent_at, name, contacts, language, template, whatsapp_area, is_draft, mapping, global_data, confirmations, has_file, is_flow_form, file and listener_url. The one-step send also loads follow_up_configuration when present: hours, template_id, calendar_id, mapping, global_data, is_flow_form. Nullable relationship IDs may be omitted in v2.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "sent_at": "2026-09-22",
                                        "name": "Order updates",
                                        "contacts": 1,
                                        "language": "English",
                                        "template": "Example template",
                                        "whatsapp_area": null,
                                        "is_draft": false,
                                        "mapping": null,
                                        "global_data": null,
                                        "confirmations": 0,
                                        "has_file": false,
                                        "is_flow_form": false,
                                        "file": "",
                                        "listener_url": null
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/{id}/download": {
            "get": {
                "operationId": "broadcastDownload",
                "summary": "Download source file",
                "description": "Download the source file attached to your broadcast.\n\n- HTTP 200 returns the file attachment. This response is not JSON. Missing files return 404; a v1 ownership failure returns 403.",
                "tags": [
                    "Broadcast actions"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: file attachment, not JSON. Missing files return 404; a v1 ownership failure returns 403.",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/{id}/stop": {
            "post": {
                "operationId": "broadcastStop",
                "summary": "Stop queued broadcast",
                "description": "Stop remaining queued work for your broadcast.",
                "tags": [
                    "Broadcast actions"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: true, message}. A refused stop returns 404 with {success: false, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": true,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/{id}/scheduled-jobs": {
            "get": {
                "operationId": "broadcastScheduledJobs",
                "summary": "Scheduled jobs",
                "description": "Inspect the schedule state of your broadcast.\n\n- V2 limits job entries to scheduling metadata. V1 returns legacy queue records.",
                "tags": [
                    "Broadcast actions"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {broadcast_id, scheduled_jobs_count, scheduled_jobs, is_scheduled, delayed_to, refused}, message}. V2 job entries contain only queue, attempts, available_at, reserved_at and created_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "scheduled_jobs_count": 0,
                                        "scheduled_jobs": [],
                                        "is_scheduled": false,
                                        "delayed_to": null,
                                        "refused": false
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/broadcast/{id}/cancel-schedule": {
            "post": {
                "operationId": "broadcastCancel",
                "summary": "Cancel scheduled broadcast",
                "description": "Cancel remaining scheduled work. Already cancelled or already processed broadcasts can return 400.\n\n- Refund reconciliation may still be pending. Check refund_reconciliation_pending before treating the refund as complete.",
                "tags": [
                    "Broadcast actions"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {refund_reconciliation_pending, broadcast_id, deleted_jobs_count, message, cancelled_at, cancelled_by}, message}. Refund reconciliation may still be pending; inspect that flag.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "refund_reconciliation_pending": false,
                                        "broadcast_id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "deleted_jobs_count": 1,
                                        "message": "Example cancellation message",
                                        "cancelled_at": "2026-09-22 10:00:00",
                                        "cancelled_by": "Sam Smith"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calendars": {
            "get": {
                "operationId": "calendars",
                "summary": "Calendars",
                "description": "Read your calendars.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendars"
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: {calendars: [...]}, message}. Entries use the calendar fields described below.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "calendars": [
                                            {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "name": "Appointments",
                                                "description": null,
                                                "date_start": "2026-09-23",
                                                "date_end": "2026-10-23",
                                                "is_active": true,
                                                "language": "en",
                                                "logo_url": "",
                                                "is_valid": false,
                                                "has_time_slots": false,
                                                "is_expired": false,
                                                "is_not_started": true,
                                                "days_until_start": 1,
                                                "created_at": "2026-09-22 10:00:00",
                                                "updated_at": "2026-09-22 10:00:00"
                                            }
                                        ]
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "operationId": "calendarCreate",
                "summary": "Create calendar",
                "description": "Create a calendar for appointment templates.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendars"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Calendar description."
                                    },
                                    "date_start": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Today or later when creating a calendar."
                                    },
                                    "date_end": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "After date_start."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this calendar."
                                    },
                                    "language": {
                                        "type": "string",
                                        "description": "en or fr. This is not language_id."
                                    },
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "jpeg, png, jpg, gif or webp image, maximum 2048 KB; use multipart/form-data."
                                    }
                                },
                                "required": [
                                    "name",
                                    "date_start",
                                    "date_end"
                                ]
                            },
                            "example": {
                                "name": "Appointments",
                                "date_start": "2026-11-27",
                                "date_end": "2026-12-26"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Calendar description."
                                    },
                                    "date_start": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Today or later when creating a calendar."
                                    },
                                    "date_end": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "After date_start."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this calendar."
                                    },
                                    "language": {
                                        "type": "string",
                                        "description": "en or fr. This is not language_id."
                                    },
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "jpeg, png, jpg, gif or webp image, maximum 2048 KB; use multipart/form-data."
                                    }
                                },
                                "required": [
                                    "name",
                                    "date_start",
                                    "date_end"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Calendar fields: id, name, description, date_start, date_end, is_active, language, logo_url, created_at, updated_at, is_valid, has_time_slots, is_expired, is_not_started, days_until_start. Loaded relationships add user {id, name, email}, cities and cities_count. Calendar details load the nested cities, weekday_schedules and time_ranges.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "name": "Appointments",
                                        "description": null,
                                        "date_start": "2026-09-23",
                                        "date_end": "2026-10-23",
                                        "is_active": true,
                                        "language": "en",
                                        "logo_url": "",
                                        "is_valid": false,
                                        "has_time_slots": false,
                                        "is_expired": false,
                                        "is_not_started": true,
                                        "days_until_start": 1,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calendars/{id}": {
            "get": {
                "operationId": "calendarShow",
                "summary": "Calendar details",
                "description": "Read an owned calendar with its schedule tree.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendars"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Calendar fields: id, name, description, date_start, date_end, is_active, language, logo_url, created_at, updated_at, is_valid, has_time_slots, is_expired, is_not_started, days_until_start. Loaded relationships add user {id, name, email}, cities and cities_count. Calendar details load the nested cities, weekday_schedules and time_ranges.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "examples": {
                                    "example1": {
                                        "summary": "200 · Example response",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "name": "Appointments",
                                                "description": null,
                                                "date_start": "2026-09-23",
                                                "date_end": "2026-10-23",
                                                "is_active": true,
                                                "language": "en",
                                                "logo_url": "",
                                                "is_valid": false,
                                                "has_time_slots": false,
                                                "is_expired": false,
                                                "is_not_started": true,
                                                "days_until_start": 1,
                                                "created_at": "2026-09-22 10:00:00",
                                                "updated_at": "2026-09-22 10:00:00"
                                            },
                                            "message": "Example response message"
                                        }
                                    },
                                    "example2": {
                                        "summary": "200 · With loaded schedule relationships",
                                        "value": {
                                            "success": true,
                                            "data": {
                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                "name": "Appointments",
                                                "description": null,
                                                "date_start": "2026-09-23",
                                                "date_end": "2026-10-23",
                                                "is_active": true,
                                                "language": "en",
                                                "logo_url": "",
                                                "is_valid": false,
                                                "has_time_slots": false,
                                                "is_expired": false,
                                                "is_not_started": true,
                                                "days_until_start": 1,
                                                "created_at": "2026-09-22 10:00:00",
                                                "updated_at": "2026-09-22 10:00:00",
                                                "cities": [
                                                    {
                                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                        "city_name": "Casablanca",
                                                        "address": null,
                                                        "description": null,
                                                        "is_active": true,
                                                        "created_at": "2026-09-22 10:00:00",
                                                        "updated_at": "2026-09-22 10:00:00",
                                                        "weekday_schedules": [
                                                            {
                                                                "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                                "day_of_week": 1,
                                                                "day_name": "Monday",
                                                                "is_active": true,
                                                                "special_notes": null,
                                                                "created_at": "2026-09-22 10:00:00",
                                                                "updated_at": "2026-09-22 10:00:00",
                                                                "time_ranges": [
                                                                    {
                                                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                                                        "start_time": "09:00",
                                                                        "end_time": "17:00",
                                                                        "duration_minutes": 30,
                                                                        "capacity": 1,
                                                                        "is_active": true,
                                                                        "created_at": "2026-09-22 10:00:00",
                                                                        "updated_at": "2026-09-22 10:00:00"
                                                                    }
                                                                ]
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            "message": "Example response message"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "operationId": "calendarUpdate",
                "summary": "Update calendar",
                "description": "Update fields on a calendar you own. PATCH is also supported.\n\n- name, date_start and date_end cannot be empty when supplied.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendars"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Calendar description."
                                    },
                                    "date_start": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Valid date. If updating date_end, also supply date_start for its comparison."
                                    },
                                    "date_end": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "After date_start."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this calendar."
                                    },
                                    "language": {
                                        "type": "string",
                                        "description": "en or fr. This is not language_id."
                                    },
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "jpeg, png, jpg, gif or webp image, maximum 2048 KB; use multipart/form-data."
                                    }
                                }
                            },
                            "example": {
                                "name": "Updated appointments"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Calendar description."
                                    },
                                    "date_start": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "Valid date. If updating date_end, also supply date_start for its comparison."
                                    },
                                    "date_end": {
                                        "type": "string",
                                        "format": "date",
                                        "description": "After date_start."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this calendar."
                                    },
                                    "language": {
                                        "type": "string",
                                        "description": "en or fr. This is not language_id."
                                    },
                                    "logo": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "jpeg, png, jpg, gif or webp image, maximum 2048 KB; use multipart/form-data."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Calendar fields: id, name, description, date_start, date_end, is_active, language, logo_url, created_at, updated_at, is_valid, has_time_slots, is_expired, is_not_started, days_until_start. Loaded relationships add user {id, name, email}, cities and cities_count. Calendar details load the nested cities, weekday_schedules and time_ranges.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "name": "Appointments",
                                        "description": null,
                                        "date_start": "2026-09-23",
                                        "date_end": "2026-10-23",
                                        "is_active": true,
                                        "language": "en",
                                        "logo_url": "",
                                        "is_valid": false,
                                        "has_time_slots": false,
                                        "is_expired": false,
                                        "is_not_started": true,
                                        "days_until_start": 1,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "calendarDelete",
                "summary": "Delete calendar",
                "description": "Delete a calendar you own.",
                "tags": [
                    "Calendars"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: null, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": null,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calendars/{id}/cities": {
            "get": {
                "operationId": "cityList",
                "summary": "City list",
                "description": "List records in a parent calendar you own.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [...], message}. Entries contain id, city_name, address, description, is_active, created_at, updated_at. Loaded relationships add calendar, weekday_schedules and weekday_schedules_count.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "city_name": "Casablanca",
                                            "address": null,
                                            "description": null,
                                            "is_active": true,
                                            "created_at": "2026-09-22 10:00:00",
                                            "updated_at": "2026-09-22 10:00:00"
                                        }
                                    ],
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/cities": {
            "post": {
                "operationId": "cityCreate",
                "summary": "Create city",
                "description": "Add a record to an owned calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "calendar_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Parent record belonging to your calendar."
                                    },
                                    "city_name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Location address."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "City description."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this city."
                                    }
                                },
                                "required": [
                                    "calendar_id",
                                    "city_name"
                                ]
                            },
                            "example": {
                                "calendar_id": "018f16b6-7696-4ae8-8cf0-000000000123",
                                "city_name": "Casablanca"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, city_name, address, description, is_active, created_at, updated_at. Loaded relationships add calendar, weekday_schedules and weekday_schedules_count.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "city_name": "Casablanca",
                                        "address": null,
                                        "description": null,
                                        "is_active": true,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/cities/{id}": {
            "get": {
                "operationId": "cityShow",
                "summary": "City details",
                "description": "Read a record in your calendar.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, city_name, address, description, is_active, created_at, updated_at. Loaded relationships add calendar, weekday_schedules and weekday_schedules_count.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "city_name": "Casablanca",
                                        "address": null,
                                        "description": null,
                                        "is_active": true,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "operationId": "cityUpdate",
                "summary": "Update city",
                "description": "Update this record. PATCH is also supported. Its parent cannot be changed here.\n\n- Required creation fields cannot be empty when supplied.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city_name": {
                                        "type": "string",
                                        "description": "Maximum 255 characters."
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Location address."
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "City description."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this city."
                                    }
                                }
                            },
                            "example": {
                                "city_name": "Casablanca"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, city_name, address, description, is_active, created_at, updated_at. Loaded relationships add calendar, weekday_schedules and weekday_schedules_count.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "city_name": "Casablanca",
                                        "address": null,
                                        "description": null,
                                        "is_active": true,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "cityDelete",
                "summary": "Delete city",
                "description": "Delete a record in your calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: null, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": null,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/cities/{id}/weekday-schedules": {
            "get": {
                "operationId": "weekdayScheduleList",
                "summary": "Weekday schedule list",
                "description": "List records in a parent calendar you own.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [...], message}. Entries contain id, day_of_week, day_name, is_active, special_notes, created_at, updated_at. Loaded time_ranges are included.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "day_of_week": 1,
                                            "day_name": "Monday",
                                            "is_active": true,
                                            "special_notes": null,
                                            "created_at": "2026-09-22 10:00:00",
                                            "updated_at": "2026-09-22 10:00:00"
                                        }
                                    ],
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/weekday-schedules": {
            "post": {
                "operationId": "weekdayScheduleCreate",
                "summary": "Create weekday schedule",
                "description": "Add a record to an owned calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Parent record belonging to your calendar."
                                    },
                                    "day_of_week": {
                                        "type": "integer",
                                        "description": "1–7."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this day."
                                    },
                                    "special_notes": {
                                        "type": "string",
                                        "description": "Notes for this day."
                                    }
                                },
                                "required": [
                                    "city_id",
                                    "day_of_week"
                                ]
                            },
                            "example": {
                                "city_id": "018f16b6-7696-4ae8-8cf0-000000000123",
                                "day_of_week": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, day_of_week, day_name, is_active, special_notes, created_at, updated_at. Loaded time_ranges are included.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "day_of_week": 1,
                                        "day_name": "Monday",
                                        "is_active": true,
                                        "special_notes": null,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/weekday-schedules/{id}": {
            "get": {
                "operationId": "weekdayScheduleShow",
                "summary": "Weekday schedule details",
                "description": "Read a record in your calendar.\n\n- Related records and relationship counts are included when loaded by this operation.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, day_of_week, day_name, is_active, special_notes, created_at, updated_at. Loaded time_ranges are included.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "day_of_week": 1,
                                        "day_name": "Monday",
                                        "is_active": true,
                                        "special_notes": null,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "operationId": "weekdayScheduleUpdate",
                "summary": "Update weekday schedule",
                "description": "Update this record. PATCH is also supported. Its parent cannot be changed here.\n\n- Required creation fields cannot be empty when supplied.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "day_of_week": {
                                        "type": "integer",
                                        "description": "1–7."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this day."
                                    },
                                    "special_notes": {
                                        "type": "string",
                                        "description": "Notes for this day."
                                    }
                                }
                            },
                            "example": {
                                "day_of_week": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, day_of_week, day_name, is_active, special_notes, created_at, updated_at. Loaded time_ranges are included.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "day_of_week": 1,
                                        "day_name": "Monday",
                                        "is_active": true,
                                        "special_notes": null,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "weekdayScheduleDelete",
                "summary": "Delete weekday schedule",
                "description": "Delete a record in your calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: null, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": null,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/weekday-schedules/{id}/time-ranges": {
            "get": {
                "operationId": "timeRangeList",
                "summary": "Time range list",
                "description": "List records in a parent calendar you own.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data: [...], message}. Entries contain id, start_time, end_time, duration_minutes, capacity, is_active, created_at, updated_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                            "start_time": "09:00",
                                            "end_time": "17:00",
                                            "duration_minutes": 30,
                                            "capacity": 1,
                                            "is_active": true,
                                            "created_at": "2026-09-22 10:00:00",
                                            "updated_at": "2026-09-22 10:00:00"
                                        }
                                    ],
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/time-ranges": {
            "post": {
                "operationId": "timeRangeCreate",
                "summary": "Create time range",
                "description": "Add a record to an owned calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "weekday_schedule_id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Parent record belonging to your calendar."
                                    },
                                    "start_time": {
                                        "type": "string",
                                        "description": "H:i."
                                    },
                                    "end_time": {
                                        "type": "string",
                                        "description": "H:i, after start_time."
                                    },
                                    "duration_minutes": {
                                        "type": "integer",
                                        "description": "5–480 minutes."
                                    },
                                    "capacity": {
                                        "type": "integer",
                                        "description": "1–100."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this time range."
                                    }
                                },
                                "required": [
                                    "weekday_schedule_id",
                                    "start_time",
                                    "end_time",
                                    "duration_minutes",
                                    "capacity"
                                ]
                            },
                            "example": {
                                "weekday_schedule_id": "018f16b6-7696-4ae8-8cf0-000000000123",
                                "start_time": "09:00",
                                "end_time": "17:00",
                                "duration_minutes": 30,
                                "capacity": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, start_time, end_time, duration_minutes, capacity, is_active, created_at, updated_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "start_time": "09:00",
                                        "end_time": "17:00",
                                        "duration_minutes": 30,
                                        "capacity": 1,
                                        "is_active": true,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/time-ranges/{id}": {
            "get": {
                "operationId": "timeRangeShow",
                "summary": "Time range details",
                "description": "Read a record in your calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, start_time, end_time, duration_minutes, capacity, is_active, created_at, updated_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "start_time": "09:00",
                                        "end_time": "17:00",
                                        "duration_minutes": 30,
                                        "capacity": 1,
                                        "is_active": true,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "operationId": "timeRangeUpdate",
                "summary": "Update time range",
                "description": "Update this record. PATCH is also supported. Its parent cannot be changed here.\n\n- When updating end_time, also send start_time for the comparison. Required creation fields cannot be empty when supplied.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "start_time": {
                                        "type": "string",
                                        "description": "H:i."
                                    },
                                    "end_time": {
                                        "type": "string",
                                        "description": "H:i, after start_time."
                                    },
                                    "duration_minutes": {
                                        "type": "integer",
                                        "description": "5–480 minutes."
                                    },
                                    "capacity": {
                                        "type": "integer",
                                        "description": "1–100."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Enable or disable this time range."
                                    }
                                }
                            },
                            "example": {
                                "start_time": "09:00",
                                "end_time": "17:00",
                                "duration_minutes": 30,
                                "capacity": 1
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success, data, message}. Fields: id, start_time, end_time, duration_minutes, capacity, is_active, created_at, updated_at.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "id": "018f16b6-7696-4ae8-8cf0-000000000042",
                                        "start_time": "09:00",
                                        "end_time": "17:00",
                                        "duration_minutes": 30,
                                        "capacity": 1,
                                        "is_active": true,
                                        "created_at": "2026-09-22 10:00:00",
                                        "updated_at": "2026-09-22 10:00:00"
                                    },
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "operationId": "timeRangeDelete",
                "summary": "Delete time range",
                "description": "Delete a record in your calendar.",
                "tags": [
                    "Calendar schedules"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "UUID string",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        },
                        "example": "018f16b6-7696-4ae8-8cf0-000000000123"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "HTTP 200: {success: true, data: null, message}.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": null,
                                    "message": "Example response message"
                                }
                            }
                        }
                    },
                    "default": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "accessToken": {
                "type": "http",
                "scheme": "bearer",
                "description": "The token returned by Login. Send it as Authorization: Bearer followed by the token."
            },
            "registrationToken": {
                "type": "http",
                "scheme": "bearer",
                "description": "For Register only: your premium account’s API token, or a registration token issued by an administrator."
            }
        },
        "responses": {
            "Error": {
                "description": "An error. Most carry message; a validation error adds errors, keyed by field. See Pagination & errors in the reference.",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object"
                        }
                    }
                }
            }
        }
    }
}