{
  "openapi": "3.1.1",
  "info": {
    "title": "Messaging API",
    "version": "2.0",
    "description": "Large campaigns and priority, single-recipient OTP. API credentials belong in a server application."
  },
  "servers": [
    {
      "url": "https://{host}/api/v2/{resellerCode}",
      "description": "Platform or shared reseller URL",
      "variables": {
        "host": {
          "default": "platform.example.invalid"
        },
        "resellerCode": {
          "default": "your-reseller"
        }
      }
    },
    {
      "url": "https://{host}/api/v2",
      "description": "Verified custom reseller domain",
      "variables": {
        "host": {
          "default": "sms.example.invalid"
        }
      }
    }
  ],
  "security": [
    {
      "clientId": [],
      "apiKey": []
    }
  ],
  "paths": {
    "/campaigns": {
      "post": {
        "operationId": "createCampaign",
        "summary": "Request a campaign preview",
        "responses": {
          "202": {
            "description": "Request a campaign preview",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                },
                "description": "Relative tracking URL."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "413": {
            "description": "Body exceeds endpoint limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "415": {
            "description": "Unsupported media type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Nonzero hyphenated UUID. Persist the key across retries for a single logical operation. Changed input under the same key is a conflict.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "No dispatch until confirmation. Max JSON or file size: 33,554,432 bytes; multipart overhead allowance: 262,144 bytes. Large imports continue in the background. Oversized JSON arrays return 413; excessive candidates in delimited text or files produce Failed with bulk_recipient_limit during background import.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignInput"
              },
              "example": {
                "sender": "YourBrand",
                "body": "Your order is ready.",
                "recipients": [
                  "+447700900123",
                  "+447700900124"
                ],
                "onlyNew": false
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/CampaignFile"
              }
            }
          }
        }
      }
    },
    "/campaigns/{id}": {
      "get": {
        "operationId": "getCampaign",
        "summary": "Read campaign progress, eligibility and financial estimate",
        "responses": {
          "200": {
            "description": "Read campaign progress, eligibility and financial estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Review phase=Ready and confirmable=true before confirming. Confirmed or Complete does not guarantee gateway or handset acceptance. transport.accepted counts recipients accepted by the gateway."
      }
    },
    "/campaigns/{id}/confirm": {
      "post": {
        "operationId": "confirmCampaign",
        "summary": "Launch the reviewed campaign",
        "responses": {
          "202": {
            "description": "Launch the reviewed campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                },
                "description": "Relative tracking URL."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/campaigns/{id}/cancel": {
      "post": {
        "operationId": "cancelCampaign",
        "summary": "Cancel an eligible campaign",
        "responses": {
          "202": {
            "description": "Cancel an eligible campaign",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrackingEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                },
                "description": "Relative tracking URL."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Check canCancel and the scheduling cancellation deadline first."
      }
    },
    "/campaigns/{id}/recipients": {
      "get": {
        "operationId": "listCampaignRecipients",
        "summary": "Read paginated recipient outcomes",
        "responses": {
          "200": {
            "description": "Read paginated recipient outcomes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignRecipientsEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "eligible",
                "filtered",
                "sent"
              ],
              "default": "all"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000,
              "default": 1
            }
          }
        ]
      }
    },
    "/otp": {
      "post": {
        "operationId": "submitOtp",
        "summary": "Queue one fixed-template verification message at high priority",
        "responses": {
          "202": {
            "description": "Queue one fixed-template verification message at high priority",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                },
                "description": "Relative tracking URL."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "413": {
            "description": "Body exceeds endpoint limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "415": {
            "description": "Unsupported media type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Nonzero hyphenated UUID. Persist the key across retries for a single logical operation. Changed input under the same key is a conflict.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Caller generates and verifies the code. Single destination, one part, no free text. A gateway transmission already in progress cannot be recalled. On 429 respect Retry-After.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OtpInput"
              },
              "example": {
                "sender": "YourBrand",
                "to": "+447700900123",
                "language": "en",
                "code": "0K839378"
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "operationId": "sendMessage",
        "summary": "Queue one SMS for a single recipient",
        "description": "Use an international destination or pass the active country code for a national mobile number. For compatibility an 11-digit Egyptian number starting with 01 also works when country is omitted. The funded message is queued once under the submitted key. Track the returned id with GET /messages/{id}.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 80,
              "pattern": "^[A-Za-z0-9._:-]{1,80}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sender",
                  "body",
                  "destination"
                ],
                "properties": {
                  "sender": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 11
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Up to four SMS parts after encoding."
                  },
                  "destination": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "One mobile number."
                  },
                  "country": {
                    "type": "string",
                    "pattern": "^[A-Za-z]{2}$",
                    "example": "EG"
                  },
                  "sourcePort": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  },
                  "destinationPort": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 65535
                  }
                },
                "dependentRequired": {
                  "sourcePort": [
                    "destinationPort"
                  ],
                  "destinationPort": [
                    "sourcePort"
                  ]
                }
              },
              "example": {
                "sender": "YourBrand",
                "destination": "01012345678",
                "country": "EG",
                "body": "Your order is ready."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Message admitted to the queue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageEnvelope"
                }
              }
            }
          },
          "default": {
            "description": "Request rejected. Consult error and reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{id}": {
      "get": {
        "operationId": "getMessage",
        "summary": "Track a submitted message and available delivery evidence",
        "responses": {
          "200": {
            "description": "Track a submitted message and available delivery evidence",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageEnvelope"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "default": {
            "description": "Request rejected. Check error and retain reference for support.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Allow": {
                "schema": {
                  "type": "string"
                },
                "description": "Allowed HTTP methods."
              }
            }
          },
          "400": {
            "description": "Invalid input or idempotency key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "401": {
            "description": "Credentials were not accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "403": {
            "description": "Account access unavailable, or HTTPS required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "404": {
            "description": "Resource missing or outside this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "409": {
            "description": "State, funds, routing or request-key conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          },
          "429": {
            "description": "Request rate exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 0
                },
                "description": "Seconds until the next poll or retry, when supplied."
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string"
                },
                "description": "Matches the JSON envelope reference."
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "clientId": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Client-Id"
      },
      "apiKey": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "CampaignInput": {
        "type": "object",
        "properties": {
          "sender": {
            "type": "string",
            "minLength": 1,
            "maxLength": 11,
            "description": "Exact approved sender name. Case-sensitive."
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "Server measures SMS encoding and enforces the four-part maximum."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$",
            "description": "ISO alpha-2 for interpreting national numbers."
          },
          "onlyNew": {
            "type": "boolean",
            "default": false
          },
          "scheduledUtc": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "recipients": {
            "description": "Up to 500,000 total candidates (including duplicates).",
            "oneOf": [
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 500000,
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string",
                "minLength": 1
              }
            ]
          }
        },
        "required": [
          "sender",
          "body",
          "recipients"
        ],
        "additionalProperties": false
      },
      "CampaignFile": {
        "type": "object",
        "properties": {
          "sender": {
            "type": "string",
            "minLength": 1,
            "maxLength": 11,
            "description": "Exact approved sender name. Case-sensitive."
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000,
            "description": "Server measures SMS encoding and enforces the four-part maximum."
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Za-z]{2}$",
            "description": "ISO alpha-2 for interpreting national numbers."
          },
          "onlyNew": {
            "type": "boolean",
            "default": false
          },
          "scheduledUtc": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "recipientsFile": {
            "type": "string",
            "format": "binary",
            "description": "UTF-8 TXT or CSV file, maximum 32 MiB."
          }
        },
        "required": [
          "sender",
          "body",
          "recipientsFile"
        ],
        "additionalProperties": false
      },
      "OtpInput": {
        "type": "object",
        "properties": {
          "sender": {
            "type": "string",
            "minLength": 1,
            "maxLength": 11,
            "description": "Exact approved sender name. Case-sensitive."
          },
          "to": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$",
            "description": "One international mobile number."
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "ar",
              "fr",
              "de",
              "es",
              "it",
              "pt",
              "nl",
              "tr",
              "ru",
              "uk",
              "pl",
              "el",
              "he",
              "ur",
              "fa",
              "hi",
              "bn",
              "zh",
              "ja"
            ]
          },
          "code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,8}$",
            "minLength": 1,
            "maxLength": 8,
            "example": "0K839378"
          }
        },
        "required": [
          "sender",
          "to",
          "language",
          "code"
        ],
        "additionalProperties": false
      },
      "Tracking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "statusUrl": {
            "type": "string",
            "format": "uri-reference"
          }
        },
        "required": [
          "id",
          "statusUrl"
        ]
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "parts": {
            "type": "integer",
            "minimum": 0
          },
          "createdUtc": {
            "type": "string",
            "format": "date-time"
          },
          "reason": {
            "type": "string",
            "description": "Possible OTP outcomes include otp_dispatch_expired and otp_dispatch_stopped."
          },
          "delivery": {
            "type": "object",
            "properties": {
              "deliveredParts": {
                "type": "integer",
                "minimum": 0
              },
              "failedParts": {
                "type": "integer",
                "minimum": 0
              },
              "pendingParts": {
                "type": "integer",
                "minimum": 0
              },
              "unconfirmedParts": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": []
          }
        },
        "required": [
          "id",
          "status",
          "parts",
          "createdUtc"
        ]
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "phase": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmable": {
            "type": "boolean"
          },
          "canCancel": {
            "type": "boolean"
          },
          "totalRows": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "preparedRows": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "launchedRows": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "eligible": {
            "type": "integer",
            "minimum": 0
          },
          "filtered": {
            "type": "integer",
            "minimum": 0
          },
          "parts": {
            "type": "integer",
            "minimum": 0
          },
          "importedRows": {
            "type": "integer",
            "minimum": 0
          },
          "readCharacters": {
            "type": "integer",
            "minimum": 0
          },
          "totalCharacters": {
            "type": "integer",
            "minimum": 0
          },
          "currentBalance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedCost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "projectedBalance": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresUtc": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "transport": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "queued": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "sending": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "scheduled": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "accepted": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "acceptedParts": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "deliveredParts": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "rejected": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "partiallySent": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "held": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "unknown": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "cancelled": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "asOfUtc": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "snapshotStale": {
                    "type": "boolean"
                  },
                  "snapshotPending": {
                    "type": "boolean"
                  }
                },
                "required": []
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "status",
          "phase",
          "confirmable",
          "eligible",
          "filtered",
          "parts",
          "currency",
          "expectedCost",
          "transport"
        ]
      },
      "CampaignRecipients": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "eligible": {
            "type": "integer",
            "minimum": 0
          },
          "filtered": {
            "type": "integer",
            "minimum": 0
          },
          "totalParts": {
            "type": "integer",
            "minimum": 0
          },
          "amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "confirmable": {
            "type": "boolean"
          },
          "canCancel": {
            "type": "boolean"
          },
          "page": {
            "type": "integer",
            "minimum": 0
          },
          "pageCount": {
            "type": "integer",
            "minimum": 0
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ordinal": {
                  "type": "integer",
                  "minimum": 0
                },
                "sourceLine": {
                  "type": "integer",
                  "minimum": 0
                },
                "sample": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "destination": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "networkEn": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "networkAr": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "encoding": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "result": {
                  "type": "string"
                },
                "parts": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "deliveredParts": {
                  "type": "integer",
                  "minimum": 0
                },
                "failedParts": {
                  "type": "integer",
                  "minimum": 0
                },
                "pendingParts": {
                  "type": "integer",
                  "minimum": 0
                },
                "unconfirmedParts": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": []
            }
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "count": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "code",
                "count"
              ]
            }
          },
          "networks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "networkEn": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "networkAr": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "recipients": {
                  "type": "integer",
                  "minimum": 0
                },
                "parts": {
                  "type": "integer",
                  "minimum": 0
                },
                "amount": {
                  "anyOf": [
                    {
                      "type": "number"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": []
            }
          }
        },
        "required": [
          "id",
          "status",
          "recipients",
          "networks",
          "page",
          "pageCount"
        ]
      },
      "TrackingEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "error": {
            "type": "null"
          },
          "reference": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/Tracking"
          }
        },
        "required": [
          "ok",
          "error",
          "reference",
          "data"
        ]
      },
      "MessageEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "error": {
            "type": "null"
          },
          "reference": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/Message"
          }
        },
        "required": [
          "ok",
          "error",
          "reference",
          "data"
        ]
      },
      "CampaignEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "error": {
            "type": "null"
          },
          "reference": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/Campaign"
          }
        },
        "required": [
          "ok",
          "error",
          "reference",
          "data"
        ]
      },
      "CampaignRecipientsEnvelope": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "error": {
            "type": "null"
          },
          "reference": {
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/CampaignRecipients"
          }
        },
        "required": [
          "ok",
          "error",
          "reference",
          "data"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          },
          "data": {
            "type": "null"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "error",
          "reference",
          "data"
        ]
      }
    }
  }
}
