{
  "openapi": "3.1.0",
  "info": {
    "title": "SendSMS API",
    "version": "1.0.4",
    "description": "SendSMS customer SMS API. The account is identified by the API key (X-API-Key) only; requests are accepted from the IP addresses listed for the key. 202 means accepted, not delivered. Documentation: https://docs.sendsms.to",
    "contact": {
      "name": "SendSMS support",
      "email": "support@sendsms.to",
      "url": "https://docs.sendsms.to"
    }
  },
  "servers": [
    {
      "url": "https://api.sendsms.to"
    }
  ],
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/v1/balance": {
      "get": {
        "summary": "Money balance & SMS credits",
        "description": "Default: money and smsCredits.total only. Exact decimal strings. Prepaid balance is booked funds, not a promise that all funds are spendable; holds and campaign reservations may restrict sending. For postpaid, balance is paid funds; request include=postpaid for available credit. Internal accounts return balance=null. No account ID can be supplied. SMS total spans scoped credits and does not imply eligibility for every destination. Each page is a fresh snapshot. Limited to one request per account per 10 seconds, in addition to general API limits.",
        "parameters": [
          {
            "name": "include",
            "in": "query",
            "description": "Optional comma-separated unique values: smsBreakdown,postpaid,account. Unknown, empty and duplicate values are rejected. postpaid is omitted for non-postpaid accounts. account adds snapshot time, account kind, payment mode, suspension status and balance meaning.",
            "schema": {
              "type": "string"
            },
            "example": "smsBreakdown,postpaid,account"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "SMS scope page size; allowed only with include=smsBreakdown.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "nextCursor from the previous page; allowed only with include=smsBreakdown.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current snapshot; Cache-Control: no-store",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Balance"
                },
                "example": {
                  "money": {
                    "balance": "125.12345",
                    "currency": "USD"
                  },
                  "smsCredits": {
                    "total": "1500.00"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid parameters, including any account selector",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, expired or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Key lacks balance.read; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Account missing or archived",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; respect Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "When the balance handler sets this header, wait this many seconds (10). The global request limiter may omit it."
              }
            }
          },
          "503": {
            "description": "Balance temporarily unavailable; respect Retry-After, never substitute zero",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "When the balance handler sets this header, wait this many seconds (10). The global request limiter may omit it."
              }
            }
          }
        },
        "tags": [
          "Balance"
        ],
        "x-required-scope": "balance.read",
        "operationId": "balance"
      }
    },
    "/v1/messages": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Send an SMS",
        "description": "202 means accepted into the durable processing chain, not delivered to the handset. Insufficient funds can return402. Sender is selected per new message through from; this does not edit an already sent SMS.",
        "x-required-scope": "messages.send",
        "responses": {
          "202": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageAccepted"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input, including invalid_number for an invalid recipient number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient available funds or credit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit. When admission by capacity is switched on by the platform (off by default): also transactional_overloaded - the transactional queue is full, nothing was created; respect Retry-After and repeat with the same Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before repeating the request. Sent with transactional_overloaded (the forecast wait, 1 to 30) and otp_capacity (1) when admission by capacity is switched on; the request rate limit then also sends 1."
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable. When admission by capacity is switched on by the platform (off by default): also otp_capacity - no capacity for one-time codes right now, nothing was created; repeat once after Retry-After, then use a fallback channel.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdmissionError"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before repeating the request. Sent with transactional_overloaded (the forecast wait, 1 to 30) and otp_capacity (1) when admission by capacity is switched on; the request rate limit then also sends 1."
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessage"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "Retain one key for one logical request; the key is scoped to the authenticated account. Single send (prepaid or postpaid account) and batch items (idempotencyKey of each item): the same key with the same payload returns the original acknowledgement (202, the same messageId, duplicate:true) with no second send; the same key with a different payload returns 409 idempotency_conflict. Postpaid account: if the original send was refused with 402 insufficient_credit, a repeat with the same key returns 402 insufficient_credit again (with messageId and duplicate:true); after topping up, use a new key. 409 idempotency_in_progress (with Retry-After) and 409 payment_mode_changed carry retryable:true and create no message: repeat later with the same key and the same payload. A timeout does not prove rejection; query the known message ID before attempting another send. Do not assume exactly-once operator delivery. A header sent empty (or only spaces) is refused with 400 invalid_idempotency_key. When admission by capacity is switched on: a repeat with a key that already has a message is answered before the capacity check and is never refused by it; a request refused with 429 transactional_overloaded or 503 otp_capacity created nothing, so repeating it with the same key is safe."
          },
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "sendSms"
      }
    },
    "/v1/messages/{id}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Message status",
        "description": "Read a tenant-owned message and last transport attempt in one bounded read-only transaction. Same404 for absent and foreign IDs. No provider calls. failed may still enter fallback; poll uncertain states without automatic resubmission. No delivery timestamp is invented from updated_at.",
        "x-required-scope": "messages.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageSnapshot"
                },
                "example": {
                  "id": "00000000-0000-0000-0000-000000000002",
                  "channel": "sms",
                  "destination": "+994000000000",
                  "status": "sent",
                  "created_at": "2026-10-28T10:00:00Z",
                  "updated_at": "2026-10-28T10:00:01Z",
                  "status_info": {
                    "known": true,
                    "outcome": "pending",
                    "poll_after_seconds": 5,
                    "resubmit_safe": false
                  },
                  "transport": {
                    "attempt": 1,
                    "status": "submitted",
                    "started_at": "2026-10-28T10:00:00Z",
                    "resolved_at": "2026-10-28T10:00:01Z",
                    "next_attempt_at": null,
                    "submitted_segments": 1,
                    "total_segments": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds before retry (5 for bounded database timeout)."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-public-status": "published",
        "operationId": "messageStatus"
      }
    },
    "/v1/templates": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Create a template",
        "description": "New/changed content follows the platform moderation workflow. Creation does not authorize bypassing approval.",
        "x-required-scope": "templates.manage",
        "responses": {
          "201": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                },
                "example": {
                  "id": "00000000-0000-4000-8000-000000000001",
                  "channel": "sms",
                  "name": "Order update",
                  "body": "Hello {{name}}",
                  "status": "pending",
                  "trafficClass": "transactional",
                  "variables": [
                    {
                      "name": "name",
                      "required": true,
                      "sample": "Aygun",
                      "label": "Name",
                      "builtin": true
                    }
                  ],
                  "version": 1,
                  "archived": false,
                  "createdAt": "2026-10-29T00:00:00.000Z",
                  "updatedAt": "2026-10-29T00:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateInput"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "createTemplate"
      },
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "List templates",
        "description": "",
        "x-required-scope": "templates.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Template"
                  }
                },
                "example": [
                  {
                    "id": "00000000-0000-4000-8000-000000000001",
                    "channel": "sms",
                    "name": "Order update",
                    "body": "Hello {{name}}",
                    "status": "pending",
                    "trafficClass": "transactional",
                    "variables": [
                      {
                        "name": "name",
                        "required": true,
                        "sample": "Aygun",
                        "label": "Name",
                        "builtin": true
                      }
                    ],
                    "version": 1,
                    "archived": false,
                    "createdAt": "2026-10-29T00:00:00.000Z",
                    "updatedAt": "2026-10-29T00:00:00.000Z"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "includeArchived",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "true — archived templates are listed too; any other value — without them."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 200
            },
            "description": "Page size, 1–200 (default 100). A value outside the range is brought to the nearest bound; it is not rejected."
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "How many templates to skip (default 0); a negative value counts as 0."
          }
        ],
        "operationId": "listTemplates"
      }
    },
    "/v1/templates/variables": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Template variables",
        "description": "",
        "x-required-scope": "templates.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,39}$",
                        "description": "Variable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name."
                      },
                      "label": {
                        "type": "string",
                        "maxLength": 80,
                        "description": "Display label supplied by the customer or SendSMS built-in catalog. May be absent from template definitions. Not used as the substitution key."
                      },
                      "sample": {
                        "type": "string",
                        "maxLength": 500,
                        "description": "Example value supplied by the customer or SendSMS catalog. Used only by preview with useSamples=true; never a substitute for actual send values."
                      },
                      "builtin": {
                        "type": "boolean",
                        "description": "Boolean generated by SendSMS: true means a built-in variable such as phone; false means a customer-defined variable."
                      },
                      "required": {
                        "type": "boolean",
                        "default": true,
                        "description": "Requirement computed/stored by SendSMS from the variable definition; normally true. phone is supplied from the recipient when available."
                      },
                      "fromRecipient": {
                        "type": "boolean",
                        "description": "Optional SendSMS built-in catalog flag: true means the value can be derived from the recipient number (phone)."
                      }
                    },
                    "required": [
                      "name",
                      "label",
                      "sample",
                      "builtin"
                    ]
                  }
                },
                "example": [
                  {
                    "name": "phone",
                    "label": "Recipient number",
                    "sample": "+994000000000",
                    "builtin": true,
                    "fromRecipient": true
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "operationId": "templateVariables"
      }
    },
    "/v1/templates/{id}": {
      "get": {
        "tags": [
          "Templates"
        ],
        "summary": "Read a template",
        "description": "",
        "x-required-scope": "templates.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                },
                "example": {
                  "id": "00000000-0000-4000-8000-000000000001",
                  "channel": "sms",
                  "name": "Order update",
                  "body": "Hello {{name}}",
                  "status": "pending",
                  "trafficClass": "transactional",
                  "variables": [
                    {
                      "name": "name",
                      "required": true,
                      "sample": "Aygun",
                      "label": "Name",
                      "builtin": true
                    }
                  ],
                  "version": 1,
                  "archived": false,
                  "createdAt": "2026-10-29T00:00:00.000Z",
                  "updatedAt": "2026-10-29T00:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "getTemplate"
      },
      "put": {
        "tags": [
          "Templates"
        ],
        "summary": "Update a template",
        "description": "",
        "x-required-scope": "templates.manage",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                },
                "example": {
                  "id": "00000000-0000-4000-8000-000000000001",
                  "channel": "sms",
                  "name": "Order update",
                  "body": "Hello {{name}}",
                  "status": "pending",
                  "trafficClass": "transactional",
                  "variables": [
                    {
                      "name": "name",
                      "required": true,
                      "sample": "Aygun",
                      "label": "Name",
                      "builtin": true
                    }
                  ],
                  "version": 1,
                  "archived": false,
                  "createdAt": "2026-10-29T00:00:00.000Z",
                  "updatedAt": "2026-10-29T00:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateUpdate"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "updateTemplate"
      },
      "delete": {
        "tags": [
          "Templates"
        ],
        "summary": "Archive a template",
        "description": "",
        "x-required-scope": "templates.manage",
        "responses": {
          "204": {
            "description": "Successful result"
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "archiveTemplate"
      }
    },
    "/v1/templates/{id}/preview": {
      "post": {
        "tags": [
          "Templates"
        ],
        "summary": "Preview a template",
        "description": "Preview uses the rendering function used by sending. Samples are for preview only. No SMS is sent and no money is reserved.",
        "x-required-scope": "templates.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "description": "Final preview text rendered by SendSMS from the stored template and supplied/sample values. Preview does not send."
                    },
                    "encoding": {
                      "type": "string",
                      "description": "Encoding calculated by SendSMS from preview text: GSM-7 or Unicode (UCS-2). Not chosen by the client."
                    },
                    "parts": {
                      "type": "integer",
                      "description": "Number of SMS segments calculated by SendSMS for the rendered text, not the number of recipients. Multipart boundaries depend on encoding."
                    },
                    "length": {
                      "type": "integer",
                      "description": "Length calculated by SendSMS: GSM-7 septets (extension characters count twice) or UCS-2/UTF-16 code units. Not bytes or necessarily the visible character count."
                    },
                    "trafficClass": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Traffic class supplied by the customer and stored by SendSMS; null means none is pinned in the template. This does not override account permissions."
                    },
                    "substituted": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Variable names for which SendSMS used samples because useSamples=true and real values were missing. Empty means no samples substituted."
                    },
                    "version": {
                      "type": "integer",
                      "description": "Stored template version used by SendSMS for this preview. Save it when comparing preview results with a later template edit."
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
                    }
                  },
                  "required": [
                    "text",
                    "encoding",
                    "parts",
                    "length",
                    "trafficClass",
                    "substituted",
                    "version"
                  ]
                },
                "example": {
                  "text": "Hello Aygun",
                  "encoding": "GSM-7",
                  "parts": 1,
                  "length": 11,
                  "trafficClass": "transactional",
                  "substituted": [],
                  "version": 1
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateError"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "variables": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Template variable values by name. Required for every required variable of the template unless useSamples is true."
                  },
                  "to": {
                    "type": "string",
                    "description": "Recipient number for the preview; fills {{phone}}. Optional."
                  },
                  "useSamples": {
                    "type": "boolean",
                    "default": false,
                    "description": "true fills missing variables with their sample values and lists them in substituted."
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "previewTemplate"
      }
    },
    "/v1/senders": {
      "get": {
        "tags": [
          "Senders"
        ],
        "summary": "List Sender IDs",
        "description": "Ascending ID keyset pagination, no total/count scan. Follow nextCursor as after; null means the end. No cross-request snapshot guarantee.",
        "x-required-scope": "senders.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Sender"
                      },
                      "description": "Page of sender records selected by SendSMS for the authenticated account and filters. An empty array is a successful empty result."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "SendSMS copies the last returned row ID when another page exists. Pass it unchanged as after with GET /v1/senders. null means no next page in this snapshot; not a new resource ID."
                    }
                  }
                },
                "example": {
                  "items": [
                    {
                      "id": "00000000-0000-4000-8000-000000000001",
                      "value": "SendSMS",
                      "channel": "sms",
                      "country": "AZ",
                      "operatorId": null,
                      "status": "pending",
                      "effectiveAt": null,
                      "expiresAt": null,
                      "createdAt": "2026-10-29T00:00:00.000Z",
                      "updatedAt": "2026-10-29T00:00:00.000Z"
                    }
                  ],
                  "nextCursor": null
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "enum": [
                "pending",
                "approved",
                "rejected",
                "disabled"
              ]
            }
          }
        ],
        "operationId": "listSenders"
      }
    },
    "/v1/senders/{id}": {
      "get": {
        "tags": [
          "Senders"
        ],
        "summary": "Read a Sender ID",
        "description": "",
        "x-required-scope": "senders.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sender"
                },
                "example": {
                  "id": "00000000-0000-4000-8000-000000000001",
                  "value": "SendSMS",
                  "channel": "sms",
                  "country": "AZ",
                  "operatorId": null,
                  "status": "pending",
                  "effectiveAt": null,
                  "expiresAt": null,
                  "createdAt": "2026-10-29T00:00:00.000Z",
                  "updatedAt": "2026-10-29T00:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation or eligibility failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "operationId": "getSender"
      }
    },
    "/v1/messages/statuses": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Message statuses",
        "description": "Read-only batch. Unique UUID ids,1..100. Input order is preserved. Missing and foreign IDs each return found:false; authorized items remain available. No sends or debits.",
        "x-required-scope": "messages.read",
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "found",
                              "message"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The requested UUID copied by SendSMS and normalized to lowercase. Its presence does not prove the message exists or belongs to the caller."
                              },
                              "found": {
                                "const": true,
                                "description": "SendSMS lookup result: true = message belongs to this account; false = missing or belongs to another account. The two false cases are intentionally indistinguishable."
                              },
                              "message": {
                                "$ref": "#/components/schemas/MessageSnapshot",
                                "description": "MessageSnapshot generated by SendSMS only when found=true. Absent, not null, when found=false."
                              }
                            }
                          },
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "found",
                              "error"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The requested UUID copied by SendSMS and normalized to lowercase. Its presence does not prove the message exists or belongs to the caller."
                              },
                              "found": {
                                "const": false,
                                "description": "SendSMS lookup result: true = message belongs to this account; false = missing or belongs to another account. The two false cases are intentionally indistinguishable."
                              },
                              "error": {
                                "const": "message_not_found",
                                "description": "SendSMS returns message_not_found only in the found=false branch. Not a delivery failure status."
                              }
                            }
                          }
                        ]
                      },
                      "description": "One result per requested ID, constructed by SendSMS in the original request order. This read creates no messages."
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
                    }
                  }
                },
                "example": {
                  "results": [
                    {
                      "id": "00000000-0000-0000-0000-000000000002",
                      "found": true,
                      "message": {
                        "id": "00000000-0000-0000-0000-000000000002",
                        "channel": "sms",
                        "destination": "+994000000000",
                        "status": "sent",
                        "created_at": "2026-10-28T10:00:00Z",
                        "updated_at": "2026-10-28T10:00:01Z",
                        "status_info": {
                          "known": true,
                          "outcome": "pending",
                          "poll_after_seconds": 5,
                          "resubmit_safe": false
                        },
                        "transport": {
                          "attempt": 1,
                          "status": "submitted",
                          "started_at": "2026-10-28T10:00:00Z",
                          "resolved_at": "2026-10-28T10:00:01Z",
                          "next_attempt_at": null,
                          "submitted_segments": 1,
                          "total_segments": 1
                        }
                      }
                    },
                    {
                      "id": "00000000-0000-4000-8000-000000000003",
                      "found": false,
                      "error": "message_not_found"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body exceeds 8192 bytes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds before retry (5 for bounded database timeout)."
              }
            }
          }
        },
        "x-public-status": "published",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "additionalProperties": false,
                "properties": {
                  "ids": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "example": {
                  "ids": [
                    "00000000-0000-4000-8000-000000000001"
                  ]
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "messageStatuses"
      }
    },
    "/v1/messages/batch": {
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Batch SMS sending",
        "description": "Submit up to 25 SMS messages. Each item uses the same admission handler as a single-message request and commits independently. HTTP 200 reports the batch results: inspect each item status. An item status of 202 means accepted for processing, not delivered. Use a stable idempotency key for each logical message; the same key also works with the single-message endpoint. Keep the original keys when retrying. Prepaid and postpaid accounts are supported; an account without idempotent admission support receives item status 409 with idempotent_admission_unavailable before a message is created. This operation is not an all-or-nothing transaction. Each item counts against the account request limit. If an admission outcome is unknown, remaining items are returned as not_attempted. More than 25 items, duplicate keys or a malformed item return 400 invalid_batch; 413 is returned only for a request body above the size limit.",
        "x-required-scope": "messages.send",
        "x-public-status": "published",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 25,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "idempotencyKey",
                        "message"
                      ],
                      "properties": {
                        "idempotencyKey": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128,
                          "pattern": "^[!-~]+$",
                          "description": "Unique within request; persisted logical message key, not an API authentication secret."
                        },
                        "message": {
                          "$ref": "#/components/schemas/SendMessage"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "items": [
                    {
                      "idempotencyKey": "sendsms-example-001",
                      "message": {
                        "channel": "sms",
                        "to": "994XXXXXXXXX",
                        "from": "APPROVED_SENDER",
                        "text": "Hello from SendSMS"
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-item admission results; partial acceptance possible",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "results"
                  ],
                  "properties": {
                    "results": {
                      "type": "array",
                      "maxItems": 25,
                      "items": {
                        "type": "object",
                        "required": [
                          "index",
                          "status",
                          "body"
                        ],
                        "properties": {
                          "index": {
                            "type": "integer",
                            "minimum": 0,
                            "description": "Zero-based item position assigned by SendSMS from the original input array. Not a resource ID."
                          },
                          "status": {
                            "type": "integer",
                            "description": "Per-item HTTP-style admission status generated by SendSMS (for example 202 accepted, 400 validation, 402 funds, 403 permission, 409 conflict, 422 policy, 503 unavailable/unknown). Not a message delivery state."
                          },
                          "body": {
                            "type": "object",
                            "description": "Original per-item response assembled by SendSMS: acknowledgement on 202, otherwise error details. not_attempted means that item was not attempted; admission_outcome_unknown means a commit may have succeeded, so retain the original idempotency key.",
                            "oneOf": [
                              {
                                "$ref": "#/components/schemas/MessageAccepted"
                              },
                              {
                                "$ref": "#/components/schemas/AdmissionError"
                              }
                            ]
                          }
                        }
                      },
                      "description": "SendSMS constructs one result for each submitted batch item, in input order. HTTP 200 means the batch result is available, not that every item was accepted."
                    },
                    "dryRun": {
                      "type": "boolean",
                      "const": true,
                      "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
                    }
                  }
                },
                "example": {
                  "results": [
                    {
                      "index": 0,
                      "status": 202,
                      "body": {
                        "messageId": "00000000-0000-4000-8000-000000000001",
                        "status": "queued"
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid batch; nothing attempted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "messages.send scope required; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds 131,072 bytes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Account rate limit exceeded; no items attempted",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "operationId": "batchSend"
      }
    },
    "/v1/scenarios/{id}/events": {
      "post": {
        "tags": [
          "Scenarios"
        ],
        "summary": "Scenario event",
        "description": "An event from your system (order ready, delivery status, abandoned cart, outage) becomes an SMS with the text of the scenario. One number (to): the SMS goes through the same handler as POST /v1/messages — channel, sender, tariff, funds and stop list checks included. A list (recipients): the event becomes a normal campaign of the scenario with the check and a report. In the quiet hours an event waits for their end unless the scenario sends events at once. A promotional scenario sends only to numbers that agreed to advertising (422 consent_required). 202 means accepted for processing, not delivered.",
        "x-required-scope": "messages.send",
        "x-public-status": "published",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Scenario ID from the cabinet: Scenarios → the scenario → API connection."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[!-~]+$"
            },
            "description": "Required. Your own stable key per event, scoped to the scenario. The same key with the same body returns the original answer with duplicate:true and sends nothing again; the same key with another body returns 422 idempotency_key_reused. A timeout does not prove rejection: repeat with the same key. A header sent empty (or only spaces) is refused with 400 invalid_idempotency_key."
          },
          {
            "name": "X-Dry-Run",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            },
            "description": "Optional. true — a trial request: every check of the real request is made (key, IP allowlist, permission, account, fields, sender, template, parts, price, funds), but nothing is executed — no message, no reservation, no queue, no data change, the Idempotency-Key is not taken. The answer has the real status and structure plus dryRun: true; identifiers in it are conditional (zero UUID). Refusals are the real ones. Any other value — 400 invalid_dry_run. Trial requests have their own, lower rate limit."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScenarioEvent"
              },
              "example": {
                "to": "994XXXXXXXXX",
                "variables": {
                  "order_id": "A-10492",
                  "place": "12 Nizami St"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioEventResult"
                },
                "example": {
                  "eventId": "00000000-0000-0000-0000-000000000011",
                  "status": "queued",
                  "messageId": "00000000-0000-0000-0000-000000000012"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input: no Idempotency-Key, both or neither of to and recipients, a wrong number, a list sent to a one-number scenario or the reverse.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "Insufficient available funds or credit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflict: the scenario is paused (scenario_not_active), or the first request with this key is still in progress (idempotency_in_progress, retryable).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "More numbers in the list than allowed per event.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Validation failure: a text variable is missing (template_variables_missing), the key was used for another event (idempotency_key_reused), no consent to advertising (consent_required).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "scenarioEvent"
      }
    },
    "/v1/scenarios/{id}/events/{eventId}": {
      "get": {
        "tags": [
          "Scenarios"
        ],
        "summary": "Scenario event state",
        "description": "What became of an event: its state, the message ID (one number) or the run of the scenario (a list), the reason of a refusal. Another account’s event is indistinguishable from a missing one (404).",
        "x-required-scope": "messages.send",
        "x-public-status": "published",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Scenario ID from the cabinet: Scenarios → the scenario → API connection."
          },
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScenarioEventResult"
                },
                "example": {
                  "eventId": "00000000-0000-0000-0000-000000000011",
                  "status": "sent",
                  "messageId": "00000000-0000-0000-0000-000000000012"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or revoked API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Insufficient key permissions or account/channel policy; or the request came from an IP address not allowed for this key (ip_not_allowed)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource unavailable to this account",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "scenarioEventState"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Secret API key of the account. Accepted only from the IP addresses listed for this key in the cabinet (API and integrations → Allowed IP addresses)."
      }
    },
    "schemas": {
      "Balance": {
        "type": "object",
        "required": [
          "money",
          "smsCredits"
        ],
        "properties": {
          "money": {
            "type": "object",
            "required": [
              "balance",
              "currency"
            ],
            "properties": {
              "balance": {
                "oneOf": [
                  {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Booked prepaid balance, or paid funds for postpaid. SendSMS returns a decimal string with 5 fractional digits in money.currency. This is not a spendable-funds promise: reservations and credit restrictions may apply. null for an internal account."
              },
              "currency": {
                "type": "string",
                "pattern": "^[A-Z]{3}$",
                "description": "ISO 4217 currency code saved in the account settings by SendSMS. All monetary values in this money object use this currency; no client-side relabeling or implicit conversion."
              },
              "postpaid": {
                "type": "object",
                "properties": {
                  "period": {
                    "type": "string",
                    "pattern": "^[0-9]{4}-[0-9]{2}$",
                    "description": "Billing month YYYY-MM calculated by SendSMS using the platform billing time zone. Not a Unix timestamp or the client device month."
                  },
                  "fixedLimit": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "Configured fixed monthly credit limit. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "fixedUsed": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "Recorded usage of the fixed monthly limit. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "fixedRemaining": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "max(fixedLimit − fixedUsed, 0). Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "additionalLimit": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "Additional credit granted for this billing period. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "additionalUsed": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "Recorded usage of the additional credit. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "additionalRemaining": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "max(additionalLimit − additionalUsed, 0). Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "available": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "fixedRemaining + additionalRemaining; excludes paid funds. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  },
                  "totalAvailable": {
                    "type": "string",
                    "pattern": "^-?[0-9]+\\.[0-9]{5}$",
                    "examples": [
                      "125.12345"
                    ],
                    "description": "money.balance + available; a calculated snapshot, not a reservation. Calculated/read by SendSMS. Decimal string with 5 digits in money.currency."
                  }
                },
                "description": "Included only when include=postpaid is requested for a non-internal postpaid account. SendSMS calculates this object from the current billing-period limits and usage. Absence does not mean zero.",
                "required": [
                  "period",
                  "fixedLimit",
                  "fixedUsed",
                  "fixedRemaining",
                  "additionalLimit",
                  "additionalUsed",
                  "additionalRemaining",
                  "available",
                  "totalAvailable"
                ]
              }
            },
            "description": "Monetary account snapshot calculated by SendSMS from its ledger. It is separate from SMS credits."
          },
          "smsCredits": {
            "type": "object",
            "required": [
              "total"
            ],
            "properties": {
              "total": {
                "type": "string",
                "pattern": "^-?[0-9]+\\.[0-9]{2}$",
                "examples": [
                  "1500.00"
                ],
                "description": "Sum of the account’s SMS credit quantities across scopes, calculated by SendSMS. Decimal string with 2 digits, in SMS credits, not currency or successfully delivered messages. Scope restrictions still apply."
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "country",
                    "operatorId",
                    "operatorName",
                    "quantity",
                    "currency"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID generated by the SendSMS database when the credit-balance scope row is created. Identifies that balance row, not a message or operator."
                    },
                    "country": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Country restriction stored for the credit scope, usually an ISO alpha-2 code. null means no country restriction on that row, not an unknown recipient country."
                    },
                    "operatorId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uuid",
                      "description": "Existing operator/provider UUID recorded in the scope by SendSMS. null means no operator restriction on this row. This ID does not itself identify the recipient’s current network."
                    },
                    "operatorName": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Operator/provider display name read from the SendSMS registry for operatorId; null when no name is available. Use operatorId for references, not this editable name."
                    },
                    "quantity": {
                      "type": "string",
                      "pattern": "^-?[0-9]+\\.[0-9]{2}$",
                      "examples": [
                        "1500.00"
                      ],
                      "description": "Stored remaining quota for this exact scope. SendSMS returns a decimal string with 2 fractional digits, in SMS credits."
                    },
                    "currency": {
                      "type": "string",
                      "description": "Valuation currency stored with the SMS credit row. quantity remains a number of credits; this field does not turn credits into cash."
                    }
                  }
                },
                "description": "Scope breakdown returned only with include=smsBreakdown. SendSMS returns at most limit items; an empty array means no matching rows on this page."
              },
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid",
                "description": "SendSMS copies the last returned row ID when another page exists. Pass it unchanged as after with include=smsBreakdown. null means no next page in this snapshot; not a new resource ID."
              }
            },
            "description": "SMS quota snapshot maintained by SendSMS, separate from monetary funds."
          },
          "asOf": {
            "type": "string",
            "format": "date-time",
            "description": "Present with include=account. SendSMS database statement timestamp of this balance snapshot, serialized as ISO 8601 UTC. Not the last top-up or message delivery time."
          },
          "accountKind": {
            "type": "string",
            "description": "With include=account: financial account classification stored by SendSMS. customer is a customer account; internal has no platform cash balance.",
            "x-known-values": [
              "customer",
              "internal"
            ]
          },
          "paymentMode": {
            "type": "string",
            "description": "With include=account: configured payment mode, prepaid or postpaid, read from SendSMS account settings.",
            "x-known-values": [
              "prepaid",
              "postpaid"
            ]
          },
          "billingSuspended": {
            "type": "boolean",
            "description": "With include=account: SendSMS billing flag. true blocks new billable traffic; it does not mean this balance read failed."
          },
          "balanceType": {
            "enum": [
              "booked_prepaid",
              "paid_funds",
              "not_applicable"
            ],
            "description": "With include=account, computed by SendSMS: booked_prepaid = booked prepaid balance; paid_funds = paid postpaid funds, excluding credit; not_applicable = internal account with null money.balance."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code."
          },
          "message": {
            "type": "string",
            "description": "Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation."
          },
          "code": {
            "type": "string",
            "description": "Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code."
          },
          "statusCode": {
            "type": "integer",
            "description": "Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative."
          }
        },
        "required": [
          "error"
        ]
      },
      "MessageAccepted": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string",
            "format": "uuid",
            "description": "Message UUID created by SendSMS before durable admission. With an Idempotency-Key, a postpaid account (and a prepaid account in budget-enabled admission) gets the same ID for the same key within the authenticated account; without a key SendSMS generates a random UUID. Save it for status reads. It is not the operator’s message ID."
          },
          "status": {
            "const": "queued",
            "description": "Original acknowledgement generated by SendSMS: queued means accepted for processing, not delivered. A replay may return this original acknowledgement after the message state has changed."
          },
          "duplicate": {
            "type": "boolean",
            "description": "Optional true flag generated by SendSMS on an idempotent replay. No new message was created by this acknowledgement. Absence is not delivery evidence."
          },
          "dryRun": {
            "type": "boolean",
            "const": true,
            "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
          },
          "from": {
            "type": "string",
            "description": "SendSMS accounts only: the sender name the message went with — from the request, the default Sender ID for the API or the only approved name."
          }
        },
        "required": [
          "messageId",
          "status"
        ]
      },
      "SendMessage": {
        "type": "object",
        "required": [
          "channel",
          "to"
        ],
        "properties": {
          "channel": {
            "const": "sms",
            "description": "This first documented transport is SMS; additional channels require explicit availability qualification."
          },
          "to": {
            "type": "string",
            "description": "International recipient number."
          },
          "from": {
            "type": "string",
            "description": "Sender value: use an approved, unexpired Sender ID of your account, exactly as registered. Never an operator override. Limitation of the current version: country, operator and start date of a sender are not applied at sending. SendSMS: required unless a default Sender ID is set or the account has exactly one approved name. The «Default Sender ID» of the cabinet («API and integrations») is used; if not set — the only approved name; otherwise 400 sender_required. The name used is in the from field of the 202 answer."
          },
          "text": {
            "type": "string",
            "description": "Message text. Required when templateId is not given; do not send it together with templateId. SendSMS: required: one of text or templateId. 400 text_or_template_required (both — 400 text_and_template_conflict)."
          },
          "templateId": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of an approved, not archived template of your account. Required when text is not given; the message text is rendered from the template. SendSMS: required: one of text or templateId. 400 text_or_template_required (both — 400 text_and_template_conflict)."
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            },
            "description": "Template variable values by name. Required with templateId for every required variable of the template; phone is taken from to. SendSMS: required with templateId — for every required variable. 422 template_variables_missing (the list is in missing)."
          },
          "trafficClass": {
            "type": "string",
            "enum": [
              "otp",
              "transactional",
              "promotional"
            ],
            "description": "SendSMS: required unless the template or the setting gives a class. The template class is used, then the «Default traffic class»; otherwise 400 traffic_class_required. Allowed: otp (codes), transactional (notices), promotional (advertising: only with consent and outside quiet hours); anything else — 400 traffic_class_not_allowed."
          }
        },
        "oneOf": [
          {
            "required": [
              "text"
            ],
            "not": {
              "required": [
                "templateId"
              ]
            }
          },
          {
            "required": [
              "templateId"
            ],
            "not": {
              "required": [
                "text"
              ]
            }
          }
        ]
      },
      "TemplateInput": {
        "type": "object",
        "required": [
          "name",
          "body"
        ],
        "properties": {
          "channel": {
            "const": "sms",
            "default": "sms"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1530
          },
          "trafficClass": {
            "type": "string",
            "description": "SendSMS: optional; the template class is used when a send has no trafficClass. The class comes from the send request or the «Default traffic class»."
          },
          "variables": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,39}$"
                },
                "required": {
                  "type": "boolean",
                  "default": true
                },
                "sample": {
                  "type": "string",
                  "maxLength": 500
                },
                "label": {
                  "type": "string",
                  "maxLength": 80
                }
              }
            },
            "description": "Only placeholders used in body are stored. {{phone}} defaults to the recipient. Samples are used only by preview when useSamples=true; sending requires actual values."
          }
        }
      },
      "SenderRequest": {
        "type": "object",
        "required": [
          "value"
        ],
        "additionalProperties": false,
        "properties": {
          "value": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Printable ASCII registration request, no leading/trailing whitespace. Actual sender validity depends on moderator/operator approval."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z]{2}$"
          },
          "operatorId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "Sender": {
        "type": "object",
        "required": [
          "id",
          "value",
          "channel",
          "country",
          "operatorId",
          "status",
          "effectiveAt",
          "expiresAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Sender record UUID generated by the SendSMS database when the request/record is created. Use this ID for GET /v1/senders/{id}; it is not the displayed Sender ID value."
          },
          "value": {
            "type": "string",
            "description": "Sender value supplied in the request and stored by SendSMS after validation. Registration does not itself authorize sending."
          },
          "channel": {
            "const": "sms",
            "description": "Channel recorded by SendSMS; this API returns sms."
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Requested country scope stored by SendSMS; ISO alpha-2 or null for no explicit country restriction."
          },
          "operatorId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Existing operator registry UUID selected in the request and stored by SendSMS; null for no explicit operator restriction. Not a new operator created by this API."
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "rejected",
              "disabled"
            ],
            "description": "Approval/availability state managed by SendSMS moderation: pending, approved, rejected or disabled. approved: may be used for sending until expiresAt (when set). Limitation of the current version: country, operator and effectiveAt are stored but not applied at sending.",
            "x-value-descriptions": {
              "pending": "Request awaits platform review; not approved for use.",
              "approved": "Approved in SendSMS; applicable channel, dates and operator rules still apply.",
              "rejected": "Request rejected by platform review.",
              "disabled": "Sender disabled in SendSMS."
            }
          },
          "effectiveAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Validity start configured in SendSMS. null means no explicit start bound. ISO 8601 UTC; null may also indicate missing historical data. Not a message-delivery timestamp. Limitation of the current version: not applied at sending."
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Validity end configured in SendSMS. null means no explicit expiry. ISO 8601 UTC; null may also indicate missing historical data. Not a message-delivery timestamp."
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Record creation timestamp assigned by the SendSMS database. ISO 8601 UTC; null may also indicate missing historical data. Not a message-delivery timestamp."
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Last record change timestamp maintained by SendSMS. ISO 8601 UTC; null may also indicate missing historical data. Not a message-delivery timestamp."
          },
          "dryRun": {
            "type": "boolean",
            "const": true,
            "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
          }
        }
      },
      "TemplateUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1530
          },
          "trafficClass": {
            "type": "string",
            "description": "SendSMS: optional; the template class is used when a send has no trafficClass. The class comes from the send request or the «Default traffic class»."
          },
          "variables": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "object",
              "required": [
                "name"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,39}$"
                },
                "required": {
                  "type": "boolean",
                  "default": true
                },
                "sample": {
                  "type": "string",
                  "maxLength": 500
                },
                "label": {
                  "type": "string",
                  "maxLength": 80
                }
              }
            },
            "description": "Only placeholders used in body are stored. {{phone}} defaults to the recipient. Samples are used only by preview when useSamples=true; sending requires actual values."
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Template UUID generated by the SendSMS database when created. Stable across edits; use version to identify content revisions. It is not messageId.",
            "format": "uuid"
          },
          "channel": {
            "type": "string",
            "description": "Template channel stored by SendSMS. This API is SMS-only."
          },
          "name": {
            "type": "string",
            "description": "Customer-supplied template name validated and stored by SendSMS."
          },
          "body": {
            "type": "string",
            "description": "Customer-supplied template text with {{placeholders}}, stored for this version. Not a sent message."
          },
          "status": {
            "type": "string",
            "description": "Moderation state recorded by SendSMS for the returned template/version. Lists can show the template state; detail/create/update use the current version state. pending/approved/rejected and historical legacy are documented below.",
            "x-known-values": [
              "pending",
              "approved",
              "rejected",
              "legacy"
            ],
            "x-value-descriptions": {
              "pending": "Current template/version is awaiting moderation.",
              "approved": "Current template/version is approved in SendSMS; archive and channel restrictions still apply.",
              "rejected": "Current template/version was rejected.",
              "legacy": "Historical version without current explicit approval; do not treat it as approved for a new send."
            }
          },
          "createdAt": {
            "type": "string",
            "description": "Template record creation timestamp assigned by the SendSMS database. ISO 8601 UTC; Not a message-delivery timestamp.",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last record change timestamp maintained by SendSMS. ISO 8601 UTC; Not a message-delivery timestamp.",
            "format": "date-time"
          },
          "trafficClass": {
            "type": [
              "string",
              "null"
            ],
            "description": "Traffic class supplied by the customer and stored by SendSMS; null means none is pinned in the template. This does not override account permissions."
          },
          "variables": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "object",
              "required": [
                "name",
                "required",
                "sample",
                "builtin"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,39}$",
                  "description": "Variable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name."
                },
                "required": {
                  "type": "boolean",
                  "default": true,
                  "description": "Requirement computed/stored by SendSMS from the variable definition; normally true. phone is supplied from the recipient when available."
                },
                "sample": {
                  "type": "string",
                  "maxLength": 500,
                  "description": "Example value supplied by the customer or SendSMS catalog. Used only by preview with useSamples=true; never a substitute for actual send values."
                },
                "label": {
                  "type": "string",
                  "maxLength": 80,
                  "description": "Display label supplied by the customer or SendSMS built-in catalog. May be absent from template definitions. Not used as the substitution key."
                },
                "builtin": {
                  "type": "boolean",
                  "description": "Boolean generated by SendSMS: true means a built-in variable such as phone; false means a customer-defined variable."
                }
              }
            },
            "description": "Variable definitions derived by SendSMS from placeholders actually used in body and supplied definitions. An empty array means no placeholders."
          },
          "version": {
            "type": "integer",
            "description": "Positive version number assigned by SendSMS: starts at 1 and increments when content/settings change. An unchanged update can retain the number. Not a timestamp."
          },
          "archived": {
            "type": "boolean",
            "description": "Boolean calculated by SendSMS from the archive marker. true means unavailable for a new send; history is retained."
          },
          "dryRun": {
            "type": "boolean",
            "const": true,
            "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
          }
        },
        "required": [
          "id",
          "channel",
          "name",
          "body",
          "status",
          "trafficClass",
          "variables",
          "version",
          "archived",
          "createdAt",
          "updatedAt"
        ]
      },
      "MessageStatus": {
        "type": "string",
        "description": "Current lifecycle state maintained by SendSMS from admission, routing and transport/delivery evidence. Known values and meanings are listed below; preserve unknown future values. It is not a raw SMPP status code.",
        "x-known-values": [
          "prepared",
          "queued",
          "pending",
          "retrying",
          "sent",
          "submission_ambiguous",
          "ambiguous",
          "failed",
          "throttled",
          "delivered",
          "undeliverable",
          "suppressed",
          "blocked_consent",
          "expired",
          "rejected",
          "cancelled",
          "rejected_insufficient_credit"
        ],
        "x-value-descriptions": {
          "prepared": "Prepared by SendSMS; transport delivery is not confirmed.",
          "queued": "Accepted into the SendSMS processing queue.",
          "pending": "Waiting for further platform processing.",
          "retrying": "SendSMS is processing a retry/fallback; do not create another logical message.",
          "sent": "Submitted to transport; handset delivery is not yet confirmed.",
          "submission_ambiguous": "The submission outcome is uncertain, including possible partial submission; blind resending can duplicate SMS.",
          "ambiguous": "Uncertain transport outcome retained by SendSMS; not a safe-to-resend signal.",
          "failed": "Failure recorded; current runtime can still enter fallback. This name alone is not final-failure proof; status_info.outcome remains uncertain.",
          "throttled": "Rate throttling recorded. Do not assume final failure or submit a new copy.",
          "delivered": "SendSMS has delivery confirmation.",
          "undeliverable": "Negative delivery outcome recorded as undeliverable.",
          "suppressed": "Sending suppressed by platform policy.",
          "blocked_consent": "Sending blocked by the recorded consent policy.",
          "expired": "Message validity/processing time expired.",
          "rejected": "Rejection recorded by platform or transport handling.",
          "cancelled": "Message cancelled in the platform workflow.",
          "rejected_insufficient_credit": "Rejected because the applicable credit/funds check failed."
        }
      },
      "MessageSnapshot": {
        "type": "object",
        "required": [
          "id",
          "channel",
          "destination",
          "status",
          "created_at",
          "updated_at",
          "status_info",
          "transport"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Message UUID created by SendSMS before durable admission. With an Idempotency-Key, a postpaid account (and a prepaid account in budget-enabled admission) gets the same ID for the same key within the authenticated account; without a key SendSMS generates a random UUID. Save it for status reads. It is not the operator’s message ID."
          },
          "channel": {
            "type": "string",
            "description": "Transport channel stored by SendSMS at admission. SMS uses sms."
          },
          "destination": {
            "type": "string",
            "description": "Recipient destination stored by SendSMS from the accepted request. Use your retained message ID for correlation, not assumptions about plus-sign formatting."
          },
          "status": {
            "$ref": "#/components/schemas/MessageStatus",
            "description": "Current lifecycle state maintained by SendSMS from admission, routing and transport/delivery evidence. Known values and meanings are listed below; preserve unknown future values. It is not a raw SMPP status code."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Database timestamp set when SendSMS creates the message record; ISO 8601 UTC. PostgreSQL now() is transaction-start time, not proof of commit, send or handset delivery time."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Last message-row update timestamp recorded by SendSMS; ISO 8601 UTC. May reflect a status or other row change. Not a dedicated delivery timestamp."
          },
          "status_info": {
            "type": "object",
            "required": [
              "known",
              "outcome",
              "poll_after_seconds",
              "resubmit_safe"
            ],
            "properties": {
              "known": {
                "type": "boolean",
                "description": "SendSMS sets true if status is recognized by this API version. false means a future/unknown value; keep it and treat the outcome as uncertain."
              },
              "outcome": {
                "enum": [
                  "pending",
                  "uncertain",
                  "delivered",
                  "not_delivered"
                ],
                "description": "SendSMS summary: pending = processing continues; uncertain = no safe final conclusion; delivered = delivery confirmed; not_delivered = recorded negative outcome."
              },
              "poll_after_seconds": {
                "type": [
                  "integer",
                  "null"
                ],
                "enum": [
                  5,
                  null
                ],
                "description": "Polling delay suggested by SendSMS, in seconds: 5 for pending/uncertain, null for delivered/not_delivered. Not a delivery deadline or a Unix timestamp."
              },
              "resubmit_safe": {
                "const": false,
                "description": "Always false in this version: SendSMS never authorizes a new send from a status read. Retry an original send only using its original idempotency contract."
              }
            },
            "description": "Customer-facing interpretation calculated by SendSMS from the current status. Does not perform a provider lookup."
          },
          "transport": {
            "type": [
              "object",
              "null"
            ],
            "description": "Last transport attempt stored by SendSMS. null if no attempt record exists. This is not a handset delivery receipt and contains no operator credentials or upstream costs.",
            "required": [
              "attempt",
              "status",
              "started_at",
              "resolved_at",
              "next_attempt_at",
              "submitted_segments",
              "total_segments"
            ],
            "properties": {
              "attempt": {
                "type": "integer",
                "description": "Per-message attempt number assigned by SendSMS. Identifies an attempt, not another message; do not use it as messageId."
              },
              "status": {
                "enum": [
                  "pending",
                  "submitted",
                  "failed",
                  "throttled",
                  "ambiguous",
                  "reconciled_accepted",
                  "reconciled_rejected"
                ],
                "description": "Attempt state recorded by SendSMS from transport results. submitted/reconciled_accepted mean transport acceptance, not handset delivery; ambiguous is uncertain. See value descriptions below.",
                "x-value-descriptions": {
                  "pending": "Attempt is being prepared or awaits a transport result.",
                  "submitted": "Transport submission recorded; not handset delivery.",
                  "failed": "Attempt failed; the message can still have another attempt.",
                  "throttled": "Transport throttling recorded for the attempt.",
                  "ambiguous": "Acceptance is uncertain; a blind new send risks a duplicate.",
                  "reconciled_accepted": "Reconciliation established transport acceptance, not delivery.",
                  "reconciled_rejected": "Reconciliation established rejection of the attempt."
                }
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "Attempt start recorded by SendSMS. ISO 8601 UTC or null when not recorded/scheduled."
              },
              "resolved_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "Attempt result resolution recorded by SendSMS, not handset delivery. ISO 8601 UTC or null when not recorded/scheduled."
              },
              "next_attempt_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "description": "Next retry time scheduled by SendSMS; not a promised delivery time. ISO 8601 UTC or null when not recorded/scheduled."
              },
              "submitted_segments": {
                "type": "integer",
                "description": "Count of SMS segments recorded by SendSMS as submitted in this attempt from transport acknowledgements. Not a count of delivered logical messages."
              },
              "total_segments": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Total expected SMS segments recorded for this attempt by SendSMS. null means unavailable, not zero."
              }
            }
          }
        }
      },
      "AdmissionError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code."
          },
          "message": {
            "type": "string",
            "description": "Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation."
          },
          "code": {
            "type": "string",
            "description": "Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code."
          },
          "statusCode": {
            "type": "integer",
            "description": "Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Request field identified by the SendSMS validator, such as name or body."
                },
                "message": {
                  "type": "string",
                  "description": "Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation."
                }
              }
            },
            "description": "Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors."
          },
          "invalid": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Variable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name."
                },
                "reason": {
                  "type": "string",
                  "description": "SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery."
                }
              }
            },
            "description": "Invalid variable values identified by SendSMS, with variable name and validation reason."
          },
          "retryable": {
            "type": "boolean",
            "description": "Optional SendSMS hint that an operation may be retried after contention/unavailability. It never authorizes a new logical send with a different idempotency key."
          },
          "messageId": {
            "type": "string",
            "format": "uuid",
            "description": "Message UUID created by SendSMS before durable admission. With an Idempotency-Key, a postpaid account (and a prepaid account in budget-enabled admission) gets the same ID for the same key within the authenticated account; without a key SendSMS generates a random UUID. Save it for status reads. It is not the operator’s message ID."
          },
          "duplicate": {
            "type": "boolean",
            "description": "Optional true flag generated by SendSMS when a repeat with the same Idempotency-Key returns the stored refusal of a postpaid send (402 insufficient_credit). This answer created no new message."
          },
          "channel": {
            "type": "string",
            "description": "Requested channel echoed by SendSMS in a channel-availability refusal."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes."
          },
          "mnp": {
            "type": "string",
            "description": "MNP decision state reported by SendSMS in an applicable network-lookup refusal. Not proof that an external provider was contacted."
          },
          "estimatedWaitSeconds": {
            "type": "integer",
            "description": "Present with transactional_overloaded: the forecast wait in seconds (1 to 30), equal to the Retry-After header."
          }
        },
        "required": [
          "error"
        ]
      },
      "TemplateError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Error identifier or legacy human-readable text returned by SendSMS. Not every handler exposes a stable machine code here. Check HTTP status and documented identifiers; never parse translated prose as a permanent code."
          },
          "message": {
            "type": "string",
            "description": "Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation."
          },
          "code": {
            "type": "string",
            "description": "Optional machine-readable code generated by SendSMS or its HTTP framework. Meaning depends on the operation; not a universal numeric provider code."
          },
          "statusCode": {
            "type": "integer",
            "description": "Optional HTTP status number generated by the server framework for a framework-level error. The actual HTTP response status is authoritative."
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "description": "Request field identified by the SendSMS validator, such as name or body."
                },
                "message": {
                  "type": "string",
                  "description": "Optional explanation generated by SendSMS. Intended for people; wording/language may change. Absence means the handler supplied no separate explanation."
                }
              }
            },
            "description": "Optional field-validation issues generated by SendSMS, typically for template create/update. An absent array is not an empty successful result."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Variable names SendSMS found missing from a template send/preview request. Present only for relevant template errors."
          },
          "invalid": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Variable identifier derived from a {{placeholder}} in the template or built-in catalog; use it as a key in variables. Not a person’s actual name."
                },
                "reason": {
                  "type": "string",
                  "description": "SendSMS validation reason: value_too_long, invalid_characters or unsupported_type. It describes a variable value, not network delivery."
                }
              }
            },
            "description": "Invalid variable values identified by SendSMS, with variable name and validation reason."
          },
          "channel": {
            "type": "string",
            "description": "Requested channel echoed by SendSMS in a channel-availability refusal."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "SendSMS channel refusal reasons, such as globally disabled, not assigned, not implemented or not configured. These are platform policy results, not operator receipt codes."
          }
        },
        "required": [
          "error"
        ]
      },
      "ScenarioEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "to": {
            "type": "string",
            "description": "Recipient number in international format (digits, an optional +). Send either to or recipients, not both. SendSMS: required: one of to or recipients. 400 (both or neither; a list for a one-number scenario is 400 too)."
          },
          "recipients": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            },
            "description": "List of recipient numbers for a scenario that accepts lists (for example an outage notice). The limit per event is set by SendSMS; repeated numbers count once. SendSMS: required: one of to or recipients. 400 (both or neither; a list for a one-number scenario is 400 too)."
          },
          "variables": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            },
            "maxProperties": 30,
            "description": "Values of the scenario text variables {{name}}: up to 30 values, each up to 500 characters. Every variable of the text must be filled. SendSMS: required for every variable of the scenario text. 422 template_variables_missing (the list is in missing)."
          }
        }
      },
      "ScenarioEventResult": {
        "type": "object",
        "required": [
          "eventId",
          "status"
        ],
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid",
            "description": "Event identifier generated by SendSMS. Keep it to read the event later."
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "scheduled",
              "accepted",
              "refused",
              "sent",
              "sending",
              "cancelled",
              "failed"
            ],
            "description": "queued — the SMS was accepted by the same handler as POST /v1/messages (messageId); scheduled — it waits for the end of the quiet hours (sendAt); accepted — a list event that becomes a normal campaign of the scenario; refused — not sent (error explains why)."
          },
          "messageId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Message identifier for GET /v1/messages/{id} (one-number events)."
          },
          "sendAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a waiting event will be sent (the end of the quiet hours)."
          },
          "recipients": {
            "type": "integer",
            "description": "Number of distinct recipients of a list event."
          },
          "duplicate": {
            "type": "boolean",
            "description": "true — a repeat of an event already accepted with this Idempotency-Key; nothing was sent again."
          },
          "campaignId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "A list event: the campaign of the scenario run made from it."
          },
          "runState": {
            "type": [
              "string",
              "null"
            ],
            "description": "A list event: the state of that run (preparing, review, scheduled, done, failed…)."
          },
          "reasonCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the event or its run did not go out, when it did not."
          },
          "dryRun": {
            "type": "boolean",
            "const": true,
            "description": "Present only in the answer to a trial request (X-Dry-Run: true): nothing was executed; identifiers in this answer are conditional."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Messages"
    },
    {
      "name": "Templates"
    },
    {
      "name": "Balance"
    },
    {
      "name": "Senders"
    },
    {
      "name": "Scenarios"
    }
  ]
}
