{
  "components": {
    "schemas": {
      "CampaignBody": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "footer": {
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "project_id": {
            "format": "int64",
            "type": "integer"
          },
          "public_id": {
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "stats": {
            "$ref": "#/components/schemas/StatsBody"
          },
          "status": {
            "enum": [
              "draft",
              "running",
              "paused",
              "done",
              "canceled"
            ],
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "public_id",
          "project_id",
          "name",
          "text",
          "footer",
          "status",
          "total",
          "stats",
          "started_at",
          "finished_at",
          "created_at"
        ],
        "type": "object"
      },
      "CheckInputBody": {
        "additionalProperties": false,
        "properties": {
          "numbers": {
            "items": {
              "type": "string"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "numbers"
        ],
        "type": "object"
      },
      "CheckInputBody1": {
        "additionalProperties": false,
        "properties": {
          "code": {
            "maxLength": 16,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "type": "object"
      },
      "CheckOutputBody": {
        "additionalProperties": false,
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/NumberStatusBody"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "results"
        ],
        "type": "object"
      },
      "ContactBody": {
        "additionalProperties": false,
        "properties": {
          "aliases": {
            "description": "Other names the contact goes by, such as wife or mom",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "on_whatsapp": {
            "description": "null until the number was checked",
            "type": [
              "boolean",
              "null"
            ]
          },
          "phone": {
            "type": "string"
          },
          "saved_at": {
            "format": "date-time",
            "type": "string"
          },
          "source": {
            "enum": [
              "manual",
              "api",
              "whatsapp",
              "vcard",
              "csv"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "phone",
          "aliases",
          "note",
          "source",
          "on_whatsapp",
          "saved_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ContactFields": {
        "additionalProperties": false,
        "properties": {
          "aliases": {
            "description": "Other names, such as wife, mom, accountant",
            "items": {
              "type": "string"
            },
            "maxItems": 20,
            "type": [
              "array",
              "null"
            ]
          },
          "default_country": {
            "description": "Country calling code for local numbers, such as 7",
            "maxLength": 4,
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "note": {
            "maxLength": 2000,
            "type": "string"
          },
          "phone": {
            "description": "International number; local formats work with default_country",
            "maxLength": 32,
            "minLength": 3,
            "type": "string"
          }
        },
        "required": [
          "name",
          "phone"
        ],
        "type": "object"
      },
      "CreateInputBody6": {
        "additionalProperties": false,
        "properties": {
          "app_name": {
            "description": "Replaces {app} in the text, defaults to the project sender name",
            "maxLength": 100,
            "type": "string"
          },
          "channels": {
            "description": "Tried in order; omit to use the project routing policy (WhatsApp first, Telegram as fallback)",
            "items": {
              "enum": [
                "whatsapp_gateway",
                "telegram",
                "telegram_gateway",
                "whatsapp_official"
              ],
              "type": "string"
            },
            "maxItems": 4,
            "type": [
              "array",
              "null"
            ]
          },
          "code_length": {
            "format": "int64",
            "maximum": 8,
            "minimum": 4,
            "type": "integer"
          },
          "locale": {
            "description": "BCP 47 tag of the message, defaults to the project locale",
            "maxLength": 10,
            "type": "string"
          },
          "max_attempts": {
            "format": "int64",
            "maximum": 10,
            "minimum": 1,
            "type": "integer"
          },
          "mode": {
            "description": "Defaults to outbound",
            "enum": [
              "outbound",
              "inbound"
            ],
            "type": "string"
          },
          "to": {
            "description": "Recipient phone in international format such as +77010000000, required for outbound",
            "maxLength": 32,
            "type": "string"
          },
          "ttl_seconds": {
            "format": "int64",
            "maximum": 900,
            "minimum": 30,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ErrorDetail": {
        "additionalProperties": false,
        "properties": {
          "location": {
            "description": "Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'",
            "type": "string"
          },
          "message": {
            "description": "Error message text",
            "type": "string"
          },
          "value": {
            "description": "The value at the given location"
          }
        },
        "type": "object"
      },
      "ErrorModel": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "description": "A human-readable explanation specific to this occurrence of the problem.",
            "examples": [
              "Property foo is required but is missing."
            ],
            "type": "string"
          },
          "errors": {
            "description": "Optional list of individual error details",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "instance": {
            "description": "A URI reference that identifies the specific occurrence of the problem.",
            "examples": [
              "https://example.com/error-log/abc123"
            ],
            "format": "uri",
            "type": "string"
          },
          "status": {
            "description": "HTTP status code",
            "examples": [
              400
            ],
            "format": "int64",
            "type": "integer"
          },
          "title": {
            "description": "A short, human-readable summary of the problem type. This value should not change between occurrences of the error.",
            "examples": [
              "Bad Request"
            ],
            "type": "string"
          },
          "type": {
            "default": "about:blank",
            "description": "A URI reference to human-readable documentation for the error.",
            "examples": [
              "https://example.com/errors/example"
            ],
            "format": "uri",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ImportBody": {
        "additionalProperties": false,
        "properties": {
          "errors": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "imported": {
            "format": "int64",
            "type": "integer"
          },
          "skipped": {
            "format": "int64",
            "type": "integer"
          },
          "updated": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "imported",
          "updated",
          "skipped",
          "errors"
        ],
        "type": "object"
      },
      "ImportFields": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "description": "Text of the file",
            "maxLength": 5242880,
            "type": "string"
          },
          "default_country": {
            "description": "Country calling code for numbers saved without it, such as 7",
            "maxLength": 4,
            "type": "string"
          },
          "format": {
            "description": "vcard: .vcf from iPhone, Android, macOS, Google or Outlook; csv: Google or Outlook export",
            "enum": [
              "vcard",
              "csv"
            ],
            "type": "string"
          }
        },
        "required": [
          "format",
          "content"
        ],
        "type": "object"
      },
      "InboundMessageBody": {
        "additionalProperties": false,
        "properties": {
          "contact_name": {
            "description": "Name of the sender in the address book, empty if not saved",
            "type": "string"
          },
          "from_phone": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "received_at": {
            "format": "date-time",
            "type": "string"
          },
          "slot_id": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slot_id",
          "from_phone",
          "contact_name",
          "text",
          "received_at"
        ],
        "type": "object"
      },
      "KeyCreateInputBody": {
        "additionalProperties": false,
        "properties": {
          "all_contacts": {
            "description": "Send to every contact of the address book",
            "type": "boolean"
          },
          "contact_ids": {
            "items": {
              "format": "int64",
              "type": "integer"
            },
            "maxItems": 10000,
            "type": [
              "array",
              "null"
            ]
          },
          "footer": {
            "maxLength": 300,
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "start": {
            "description": "Start sending right away, default true; false keeps a draft for the owner to review",
            "type": "boolean"
          },
          "text": {
            "description": "{name} is replaced with the recipient's name from the address book",
            "maxLength": 4096,
            "minLength": 1,
            "type": "string"
          },
          "to": {
            "description": "Phones in international format",
            "items": {
              "type": "string"
            },
            "maxItems": 10000,
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "text"
        ],
        "type": "object"
      },
      "ListOutputBody": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/TemplateBody"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "MessageBody": {
        "additionalProperties": false,
        "properties": {
          "attempts": {
            "format": "int64",
            "type": "integer"
          },
          "body": {
            "type": "string"
          },
          "channel": {
            "enum": [
              "whatsapp_gateway",
              "telegram",
              "telegram_gateway",
              "whatsapp_official"
            ],
            "type": "string"
          },
          "contact_name": {
            "description": "Name of the recipient in the address book, empty if not saved",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "error_code": {
            "type": "string"
          },
          "failed_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "project_id": {
            "format": "int64",
            "type": "integer"
          },
          "purpose": {
            "enum": [
              "notification",
              "otp"
            ],
            "type": "string"
          },
          "read_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "scheduled_at": {
            "description": "Earliest moment the gateway sends the message",
            "format": "date-time",
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "slot_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "queued",
              "sending",
              "sent",
              "delivered",
              "read",
              "failed"
            ],
            "type": "string"
          },
          "to_phone": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "to_phone",
          "contact_name",
          "channel",
          "slot_id",
          "body",
          "purpose",
          "status",
          "error_code",
          "attempts",
          "scheduled_at",
          "sent_at",
          "delivered_at",
          "read_at",
          "failed_at",
          "created_at"
        ],
        "type": "object"
      },
      "NumberStatusBody": {
        "additionalProperties": false,
        "properties": {
          "checked_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "exists": {
            "description": "null when the number could not be checked yet",
            "type": [
              "boolean",
              "null"
            ]
          },
          "phone": {
            "type": "string"
          }
        },
        "required": [
          "phone",
          "exists",
          "checked_at"
        ],
        "type": "object"
      },
      "PageOutputBody": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WorkspaceBody"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_cursor": {
            "type": "string"
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "PingBody": {
        "additionalProperties": false,
        "properties": {
          "chat_access": {
            "description": "own: this caller reads only the chats it wrote to itself",
            "enum": [
              "all",
              "own"
            ],
            "type": "string"
          },
          "project_id": {
            "format": "int64",
            "type": "integer"
          },
          "scopes": {
            "items": {
              "enum": [
                "verify",
                "messages",
                "read"
              ],
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "workspace_id": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "project_id",
          "workspace_id",
          "scopes",
          "chat_access"
        ],
        "type": "object"
      },
      "RepliesOutputBody": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InboundMessageBody"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "SendInputBody": {
        "additionalProperties": false,
        "properties": {
          "idempotency_key": {
            "maxLength": 128,
            "type": "string"
          },
          "send_at": {
            "description": "Send later, at this RFC 3339 time, up to 60 days ahead; for reminders",
            "format": "date-time",
            "type": "string"
          },
          "slot_id": {
            "description": "Send from this slot instead of the automatic choice",
            "maxLength": 20,
            "type": "string"
          },
          "text": {
            "maxLength": 4096,
            "minLength": 1,
            "type": "string"
          },
          "to": {
            "description": "Recipient phone in international format such as +77010000000 (spaces, dashes and brackets are ignored), or the name or alias of a saved contact",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "to",
          "text"
        ],
        "type": "object"
      },
      "StatsBody": {
        "additionalProperties": false,
        "properties": {
          "delivered": {
            "format": "int64",
            "type": "integer"
          },
          "failed": {
            "format": "int64",
            "type": "integer"
          },
          "pending": {
            "format": "int64",
            "type": "integer"
          },
          "queued": {
            "format": "int64",
            "type": "integer"
          },
          "read": {
            "format": "int64",
            "type": "integer"
          },
          "replied": {
            "format": "int64",
            "type": "integer"
          },
          "sent": {
            "format": "int64",
            "type": "integer"
          },
          "skipped": {
            "description": "Opted out before their turn",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "pending",
          "skipped",
          "failed",
          "queued",
          "sent",
          "delivered",
          "read",
          "replied"
        ],
        "type": "object"
      },
      "TemplateBody": {
        "additionalProperties": false,
        "properties": {
          "locale": {
            "type": "string"
          },
          "source": {
            "enum": [
              "default",
              "custom"
            ],
            "type": "string"
          },
          "variants": {
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "locale",
          "source",
          "variants"
        ],
        "type": "object"
      },
      "ThreadBody": {
        "additionalProperties": false,
        "properties": {
          "last_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_direction": {
            "enum": [
              "sent",
              "received"
            ],
            "type": "string"
          },
          "last_status": {
            "description": "Status of the last sent message, empty when the last message was received",
            "type": "string"
          },
          "last_text": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "unanswered": {
            "description": "Messages received after the last one sent",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "phone",
          "name",
          "last_text",
          "last_at",
          "last_direction",
          "last_status",
          "unanswered"
        ],
        "type": "object"
      },
      "ThreadOutputBody": {
        "additionalProperties": false,
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/TurnBody"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "required": [
          "phone",
          "name",
          "messages"
        ],
        "type": "object"
      },
      "ThreadsOutputBody": {
        "additionalProperties": false,
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ThreadBody"
            },
            "type": [
              "array",
              "null"
            ]
          }
        },
        "required": [
          "items"
        ],
        "type": "object"
      },
      "TurnBody": {
        "additionalProperties": false,
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "by": {
            "description": "api: sent through OTPRun; owner: the owner typed it on the phone; contact: the other person wrote it",
            "enum": [
              "api",
              "owner",
              "contact"
            ],
            "type": "string"
          },
          "direction": {
            "enum": [
              "sent",
              "received"
            ],
            "type": "string"
          },
          "error_code": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "direction",
          "by",
          "text",
          "status",
          "error_code",
          "at"
        ],
        "type": "object"
      },
      "VerificationBody": {
        "additionalProperties": false,
        "properties": {
          "attempts": {
            "format": "int64",
            "type": "integer"
          },
          "channel_used": {
            "description": "Channel that carries the code, null until chosen",
            "enum": [
              "whatsapp_gateway",
              "telegram",
              "telegram_gateway",
              "whatsapp_official"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "code_length": {
            "format": "int64",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "error_code": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "failed_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "inbound": {
            "$ref": "#/components/schemas/VerificationInboundBody",
            "description": "Links the user taps to confirm, present for inbound verifications and pending Telegram deep links, null otherwise"
          },
          "inbound_link": {
            "description": "wa.me link for inbound verifications, empty otherwise",
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "max_attempts": {
            "format": "int64",
            "type": "integer"
          },
          "mode": {
            "enum": [
              "outbound",
              "inbound"
            ],
            "type": "string"
          },
          "project_id": {
            "format": "int64",
            "type": "integer"
          },
          "sent_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "slot_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "pending",
              "sent",
              "delivered",
              "verified",
              "failed",
              "expired",
              "canceled",
              "locked"
            ],
            "type": "string"
          },
          "to_phone": {
            "description": "E.164 recipient, empty for inbound verifications without an expected phone",
            "type": "string"
          },
          "verified_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "project_id",
          "mode",
          "to_phone",
          "locale",
          "code_length",
          "status",
          "channel_used",
          "slot_id",
          "inbound_link",
          "attempts",
          "max_attempts",
          "expires_at",
          "sent_at",
          "delivered_at",
          "verified_at",
          "failed_at",
          "error_code",
          "created_at",
          "inbound"
        ],
        "type": "object"
      },
      "VerificationCheckBody": {
        "additionalProperties": false,
        "properties": {
          "attempts_left": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "verified",
              "wrong",
              "expired",
              "locked",
              "canceled"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "attempts_left"
        ],
        "type": "object"
      },
      "VerificationInboundBody": {
        "additionalProperties": false,
        "properties": {
          "tg_link": {
            "description": "t.me deep link that confirms the user in the Telegram bot, empty when no bot is available",
            "type": "string"
          },
          "wa_link": {
            "description": "wa.me link the user taps to send the code, empty when no WhatsApp slot is connected",
            "type": "string"
          }
        },
        "required": [
          "wa_link",
          "tg_link"
        ],
        "type": "object"
      },
      "WorkspaceBody": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "members_count": {
            "format": "int64",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "plan": {
            "enum": [
              "free",
              "starter",
              "growth",
              "scale"
            ],
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "admin",
              "developer",
              "viewer"
            ],
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "trial_ends_at": {
            "format": "date-time",
            "type": [
              "string",
              "null"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "plan",
          "role",
          "trial_ends_at",
          "members_count",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "or_live_…",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Send WhatsApp messages from the user's own linked WhatsApp number, read replies, keep an address book and send one-time codes. Recipients can be phones or saved contact names. Guide: https://otprun.com/llms.txt",
    "title": "OTPRun",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/campaigns": {
      "post": {
        "description": "Send one message to many people (up to 10000) with automatic pacing and opt-out; people who replied STOP are skipped",
        "operationId": "public-create-campaign",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyCreateInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignBody"
                }
              }
            },
            "description": "Created"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Send one message to many people (up to 10000) with automatic pacing and opt-out; people who replied STOP are skipped",
        "x-openai-isConsequential": false
      }
    },
    "/v1/campaigns/{campaignId}": {
      "get": {
        "description": "Progress of a campaign: sent, delivered, read, replied",
        "operationId": "public-get-campaign",
        "parameters": [
          {
            "in": "path",
            "name": "campaignId",
            "required": true,
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Progress of a campaign: sent, delivered, read, replied",
        "x-openai-isConsequential": false
      }
    },
    "/v1/contacts": {
      "get": {
        "description": "Find saved contacts by name, alias, phone or note",
        "operationId": "public-list-contacts",
        "parameters": [
          {
            "description": "Part of a name, alias, phone or note",
            "explode": false,
            "in": "query",
            "name": "search",
            "schema": {
              "description": "Part of a name, alias, phone or note",
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 500,
              "format": "int64",
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Find saved contacts by name, alias, phone or note",
        "x-openai-isConsequential": false
      },
      "post": {
        "description": "Save a contact; for a phone already saved the name is updated and aliases are added",
        "operationId": "public-save-contact",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactFields"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Save a contact; for a phone already saved the name is updated and aliases are added",
        "x-openai-isConsequential": false
      }
    },
    "/v1/contacts/import": {
      "post": {
        "description": "Import contacts from vCard or CSV text",
        "operationId": "public-import-contacts",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportFields"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Import contacts from vCard or CSV text",
        "x-openai-isConsequential": false
      }
    },
    "/v1/contacts/import-whatsapp": {
      "post": {
        "description": "Import the names saved on the phone of the linked WhatsApp numbers",
        "operationId": "public-import-whatsapp-contacts",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Import the names saved on the phone of the linked WhatsApp numbers",
        "x-openai-isConsequential": false
      }
    },
    "/v1/contacts/{contactId}": {
      "delete": {
        "description": "Remove a contact",
        "operationId": "public-delete-contact",
        "parameters": [
          {
            "in": "path",
            "name": "contactId",
            "required": true,
            "schema": {
              "format": "int64",
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Remove a contact",
        "x-openai-isConsequential": false
      }
    },
    "/v1/conversations": {
      "get": {
        "description": "People the user exchanged WhatsApp messages with, latest first, with the last message and how many replies are unanswered",
        "operationId": "public-list-conversations",
        "parameters": [
          {
            "description": "Part of a phone, contact name or alias",
            "explode": false,
            "in": "query",
            "name": "search",
            "schema": {
              "description": "Part of a phone, contact name or alias",
              "maxLength": 100,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadsOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "People the user exchanged WhatsApp messages with, latest first, with the last message and how many replies are unanswered",
        "x-openai-isConsequential": false
      }
    },
    "/v1/conversations/{phone}": {
      "get": {
        "description": "Messages exchanged with one person in both directions, oldest first; phone may be a saved contact name such as wife",
        "operationId": "public-get-conversation",
        "parameters": [
          {
            "description": "Phone or saved contact name or alias, for example wife",
            "in": "path",
            "name": "phone",
            "required": true,
            "schema": {
              "description": "Phone or saved contact name or alias, for example wife",
              "maxLength": 200,
              "type": "string"
            }
          },
          {
            "description": "Messages per direction",
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 30,
              "description": "Messages per direction",
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ThreadOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Messages exchanged with one person in both directions, oldest first; phone may be a saved contact name such as wife",
        "x-openai-isConsequential": false
      }
    },
    "/v1/inbox": {
      "get": {
        "description": "Replies and other messages received on the linked WhatsApp numbers",
        "operationId": "list-replies",
        "parameters": [
          {
            "description": "Comma separated phones; empty means replies from anyone",
            "explode": false,
            "in": "query",
            "name": "from",
            "schema": {
              "description": "Comma separated phones; empty means replies from anyone",
              "maxLength": 4000,
              "type": "string"
            }
          },
          {
            "description": "Only replies received after this moment, RFC 3339",
            "explode": false,
            "in": "query",
            "name": "since",
            "schema": {
              "description": "Only replies received after this moment, RFC 3339",
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Seconds to wait for a reply when none matches yet, up to 25. Without since, only replies that arrive during the wait are returned",
            "explode": false,
            "in": "query",
            "name": "wait",
            "schema": {
              "description": "Seconds to wait for a reply when none matches yet, up to 25. Without since, only replies that arrive during the wait are returned",
              "format": "int64",
              "maximum": 25,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepliesOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Replies and other messages received on the linked WhatsApp numbers",
        "x-openai-isConsequential": false
      }
    },
    "/v1/messages": {
      "post": {
        "description": "Queue a text message to a WhatsApp number",
        "operationId": "send-message",
        "parameters": [
          {
            "description": "Seconds to wait for the delivery outcome, up to 15. The answer then says delivered, or why the message did not reach the phone",
            "explode": false,
            "in": "query",
            "name": "wait",
            "schema": {
              "description": "Seconds to wait for the delivery outcome, up to 15. The answer then says delivered, or why the message did not reach the phone",
              "format": "int64",
              "maximum": 15,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageBody"
                }
              }
            },
            "description": "Accepted"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Queue a text message to a WhatsApp number",
        "x-openai-isConsequential": false
      }
    },
    "/v1/messages/{messageId}": {
      "get": {
        "description": "Status and acks of a message",
        "operationId": "get-message",
        "parameters": [
          {
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "format": "uuid",
              "maxLength": 36,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Status and acks of a message",
        "x-openai-isConsequential": false
      }
    },
    "/v1/numbers/check": {
      "post": {
        "description": "Check whether phones are registered on WhatsApp",
        "operationId": "check-numbers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckInputBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Check whether phones are registered on WhatsApp",
        "x-openai-isConsequential": false
      }
    },
    "/v1/ping": {
      "get": {
        "description": "Check the api key and see what it can do",
        "operationId": "ping",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PingBody"
                }
              }
            },
            "description": "OK"
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Check the api key and see what it can do",
        "x-openai-isConsequential": false
      }
    },
    "/v1/slots": {
      "get": {
        "description": "Slots of the workspace and their health",
        "operationId": "public-list-slots",
        "parameters": [
          {
            "explode": false,
            "in": "query",
            "name": "cursor",
            "schema": {
              "maxLength": 64,
              "type": "string"
            }
          },
          {
            "explode": false,
            "in": "query",
            "name": "limit",
            "schema": {
              "default": 50,
              "format": "int64",
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageOutputBody"
                }
              }
            },
            "description": "OK"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Slots of the workspace and their health",
        "x-openai-isConsequential": false
      }
    },
    "/v1/verifications": {
      "post": {
        "description": "Send a one-time code or issue a tap-to-verify link",
        "operationId": "create-verification",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInputBody6"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationBody"
                }
              }
            },
            "description": "Created"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Too Many Requests"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Send a one-time code or issue a tap-to-verify link",
        "x-openai-isConsequential": false
      }
    },
    "/v1/verifications/{verificationId}": {
      "get": {
        "description": "Status and delivery of a verification",
        "operationId": "get-verification",
        "parameters": [
          {
            "in": "path",
            "name": "verificationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "maxLength": 36,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Status and delivery of a verification",
        "x-openai-isConsequential": false
      }
    },
    "/v1/verifications/{verificationId}/cancel": {
      "post": {
        "description": "Cancel a verification that is still open",
        "operationId": "cancel-verification",
        "parameters": [
          {
            "in": "path",
            "name": "verificationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "maxLength": 36,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Conflict"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Cancel a verification that is still open",
        "x-openai-isConsequential": false
      }
    },
    "/v1/verifications/{verificationId}/check": {
      "post": {
        "description": "Check the code entered by the user",
        "operationId": "check-verification",
        "parameters": [
          {
            "in": "path",
            "name": "verificationId",
            "required": true,
            "schema": {
              "format": "uuid",
              "maxLength": 36,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckInputBody1"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationCheckBody"
                }
              }
            },
            "description": "OK"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorModel"
                }
              }
            },
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ],
        "summary": "Check the code entered by the user",
        "x-openai-isConsequential": false
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "servers": [
    {
      "url": "https://otprun.com"
    }
  ]
}