{
  "openapi": "3.0.3",
  "info": {
    "title": "WAYVZ SMS API",
    "version": "1.0.0",
    "description": "Send SMS over HTTPS and track every message to the handset. Live keys start with sk_live_; sandbox keys start with sk_test_ and never send or charge. An account can restrict its live keys to an IP allowlist (403 IP_NOT_ALLOWED). Full guide: https://api.wayvzgroup.com/docs",
    "contact": {
      "name": "WAYVZ Group",
      "url": "https://wayvzgroup.com"
    }
  },
  "servers": [
    {
      "url": "https://api.wayvzgroup.com"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Messages"
    },
    {
      "name": "Bulks"
    },
    {
      "name": "Reports"
    },
    {
      "name": "Verify",
      "description": "One-time codes (OTP) by SMS: send a code, then check it. Same routes, prices and delivery reports as messages."
    }
  ],
  "paths": {
    "/v1/messages": {
      "post": {
        "tags": [
          "Messages"
        ],
        "operationId": "sendMessages",
        "summary": "Send messages",
        "description": "Sends one or more messages, each to one or more destinations. Every destination becomes its own message. Invalid destinations come back rejected inside the 202; they are not charged.",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "Idempotent-Replayed": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "true"
                  ]
                },
                "description": "Present when this is a replay of an earlier request with the same Idempotency-Key."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "get": {
        "tags": [
          "Messages"
        ],
        "operationId": "listMessages",
        "summary": "Search messages",
        "description": "Newest first. Pass nextCursor back as cursor to get the next page.",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Created at or after (UTC)."
          },
          {
            "name": "until",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Created before (UTC)."
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma separated groups: PENDING, DELIVERED, UNDELIVERABLE, EXPIRED, REJECTED.",
            "example": "UNDELIVERABLE,REJECTED"
          },
          {
            "name": "bulkId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Your bulkId or WAYVZ's."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Recipient number."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "nextCursor from the previous page."
          }
        ],
        "responses": {
          "200": {
            "description": "A page of messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Message"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "nullable": true,
                      "description": "Null on the last page."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/messages/estimate": {
      "post": {
        "tags": [
          "Messages"
        ],
        "operationId": "estimateMessages",
        "summary": "Estimate parts",
        "description": "Same body as sending. Returns encoding and parts per destination. Nothing is stored or sent.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EstimateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/v1/messages/{messageId}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "operationId": "getMessage",
        "summary": "Message status",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your messageId or WAYVZ's."
          }
        ],
        "responses": {
          "200": {
            "description": "The message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/bulks/{bulkId}": {
      "get": {
        "tags": [
          "Bulks"
        ],
        "operationId": "getBulk",
        "summary": "Bulk status",
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "The bulk",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bulk"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/bulks/{bulkId}/cancel": {
      "post": {
        "tags": [
          "Bulks"
        ],
        "operationId": "cancelBulk",
        "summary": "Cancel a bulk",
        "description": "Cancels every message of the bulk not yet sent. Cancelled messages are not charged.",
        "parameters": [
          {
            "$ref": "#/components/parameters/BulkId"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bulkId": {
                      "type": "string"
                    },
                    "cancelled": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/reports": {
      "get": {
        "tags": [
          "Reports"
        ],
        "operationId": "pullReports",
        "summary": "Delivery reports",
        "description": "Final results of the last 48 hours not collected yet, oldest first. Each result is returned once.",
        "parameters": [
          {
            "name": "bulkId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Reports",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reports"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify": {
      "post": {
        "tags": [
          "Verify"
        ],
        "operationId": "startVerification",
        "summary": "Send a one-time code",
        "description": "Generates a code, sends it by SMS (valid only while the code is), and returns a verificationId. A new code to the same number cancels the previous one. Limits per number: Verify:MaxPerNumberPerHour (default 5) and a minimum gap (default 30 seconds). The code is never returned, except to sandbox keys (sandboxCode).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Code sent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerificationStarted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "402": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/{verificationId}": {
      "get": {
        "tags": [
          "Verify"
        ],
        "operationId": "getVerification",
        "summary": "Verification status",
        "parameters": [
          {
            "name": "verificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The verification, with the SMS delivery status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verification"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/{verificationId}/check": {
      "post": {
        "tags": [
          "Verify"
        ],
        "operationId": "checkVerification",
        "summary": "Check a code",
        "description": "valid is true exactly once, on the check that approves the code. Each wrong code uses one attempt; after the last attempt the status is MAX_ATTEMPTS_REACHED.",
        "parameters": [
          {
            "name": "verificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "code"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[0-9]{4,10}$",
                    "example": "482913"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result of the check",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Verification"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/verify/{verificationId}/cancel": {
      "post": {
        "tags": [
          "Verify"
        ],
        "operationId": "cancelVerification",
        "summary": "Cancel a pending verification",
        "parameters": [
          {
            "name": "verificationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canceled",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verificationId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "example": "CANCELED"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "x-webhooks": {
    "deliveryReport": {
      "post": {
        "summary": "Delivery report",
        "description": "Sent to webhooks.delivery.url when a message reaches a final status. Verify X-Wayvz-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with your webhook secret>. Answer 2xx within 10 seconds.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Reports"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer sk_live_... (live) or sk_test_... (sandbox)."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128
        },
        "description": "Optional. Not needed when you set messageId. Repeating a request with the same key never sends twice."
      },
      "BulkId": {
        "name": "bulkId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "Your bulkId or WAYVZ's."
      }
    },
    "responses": {
      "Error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "SendRequest": {
        "type": "object",
        "required": [
          "messages"
        ],
        "properties": {
          "messages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/OutboundMessage"
            }
          },
          "options": {
            "$ref": "#/components/schemas/SendOptions"
          }
        }
      },
      "OutboundMessage": {
        "type": "object",
        "required": [
          "sender",
          "destinations",
          "content"
        ],
        "properties": {
          "sender": {
            "type": "string",
            "maxLength": 15,
            "description": "Up to 11 letters or digits, or a number of up to 15 digits.",
            "example": "WAYVZ"
          },
          "destinations": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/Destination"
            },
            "description": "Up to 1,000 per request in total."
          },
          "content": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1600,
                "description": "Up to 10 parts. Use {{name}} placeholders with destinations[].parameters."
              }
            }
          },
          "callbackData": {
            "type": "string",
            "maxLength": 4000,
            "description": "Returned unchanged in lookups, reports and webhooks."
          },
          "notifyUrl": {
            "type": "string",
            "format": "uri",
            "description": "Alias of webhooks.delivery.url."
          },
          "x-webhooks": {
            "type": "object",
            "properties": {
              "delivery": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public https URL."
                  },
                  "notify": {
                    "type": "boolean",
                    "description": "false = no webhook for this message."
                  }
                }
              },
              "callbackData": {
                "type": "string",
                "maxLength": 4000
              }
            }
          }
        }
      },
      "Destination": {
        "type": "object",
        "required": [
          "to"
        ],
        "properties": {
          "to": {
            "type": "string",
            "example": "+971501234567",
            "description": "International number; +, 00 or bare digits."
          },
          "messageId": {
            "type": "string",
            "maxLength": 200,
            "pattern": "^[A-Za-z0-9._:-]{1,200}$",
            "description": "Your own id, unique per account."
          },
          "clientReference": {
            "type": "string",
            "maxLength": 128
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Values for {{name}} placeholders."
          }
        }
      },
      "SendOptions": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "transactional",
              "marketing"
            ],
            "default": "transactional"
          },
          "schedule": {
            "type": "object",
            "properties": {
              "bulkId": {
                "type": "string",
                "maxLength": 100,
                "pattern": "^[A-Za-z0-9._:-]{1,100}$",
                "description": "Your own id for the request, unique per account."
              },
              "sendAt": {
                "type": "string",
                "format": "date-time",
                "description": "Up to 180 days ahead."
              },
              "sendingSpeedLimit": {
                "type": "object",
                "required": [
                  "amount"
                ],
                "properties": {
                  "amount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000000
                  },
                  "timeUnit": {
                    "type": "string",
                    "enum": [
                      "MINUTE",
                      "HOUR",
                      "DAY"
                    ],
                    "default": "MINUTE"
                  }
                }
              }
            }
          },
          "validityPeriod": {
            "type": "object",
            "required": [
              "amount"
            ],
            "description": "30 seconds to 48 hours; default 48 hours.",
            "properties": {
              "amount": {
                "type": "integer",
                "minimum": 1
              },
              "timeUnit": {
                "type": "string",
                "enum": [
                  "SECONDS",
                  "MINUTES",
                  "HOURS"
                ],
                "default": "MINUTES"
              }
            }
          },
          "deliveryTimeWindow": {
            "type": "object",
            "required": [
              "from",
              "to"
            ],
            "description": "Sending hours in UTC, at least one hour.",
            "properties": {
              "days": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "MONDAY",
                    "TUESDAY",
                    "WEDNESDAY",
                    "THURSDAY",
                    "FRIDAY",
                    "SATURDAY",
                    "SUNDAY"
                  ]
                }
              },
              "from": {
                "$ref": "#/components/schemas/TimeOfDay"
              },
              "to": {
                "$ref": "#/components/schemas/TimeOfDay"
              }
            }
          }
        }
      },
      "TimeOfDay": {
        "type": "object",
        "required": [
          "hour"
        ],
        "properties": {
          "hour": {
            "type": "integer",
            "minimum": 0,
            "maximum": 23
          },
          "minute": {
            "type": "integer",
            "minimum": 0,
            "maximum": 59,
            "default": 0
          }
        }
      },
      "Status": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "integer",
            "description": "1 pending, 2 undeliverable, 3 delivered, 4 expired, 5 rejected."
          },
          "groupName": {
            "type": "string",
            "enum": [
              "PENDING",
              "UNDELIVERABLE",
              "DELIVERED",
              "EXPIRED",
              "REJECTED"
            ]
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "example": "DELIVERED_TO_HANDSET"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "MessageError": {
        "type": "object",
        "nullable": true,
        "properties": {
          "code": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "permanent": {
            "type": "boolean",
            "description": "true = sending again will fail the same way."
          }
        }
      },
      "Price": {
        "type": "object",
        "nullable": true,
        "properties": {
          "pricePerMessage": {
            "type": "number",
            "description": "All parts of the message."
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR",
              "USD"
            ]
          }
        }
      },
      "SendResponse": {
        "type": "object",
        "properties": {
          "bulkId": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "messageId": {
                  "type": "string"
                },
                "wayvzMessageId": {
                  "type": "string",
                  "format": "uuid"
                },
                "to": {
                  "type": "string"
                },
                "status": {
                  "$ref": "#/components/schemas/Status"
                },
                "error": {
                  "$ref": "#/components/schemas/MessageError"
                },
                "smsCount": {
                  "type": "integer"
                },
                "encoding": {
                  "type": "string",
                  "enum": [
                    "GSM7",
                    "UCS2"
                  ]
                },
                "clientReference": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "string"
          },
          "wayvzMessageId": {
            "type": "string",
            "format": "uuid"
          },
          "bulkId": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "error": {
            "$ref": "#/components/schemas/MessageError"
          },
          "smsCount": {
            "type": "integer"
          },
          "partsSent": {
            "type": "integer"
          },
          "partsDelivered": {
            "type": "integer"
          },
          "encoding": {
            "type": "string",
            "enum": [
              "GSM7",
              "UCS2"
            ]
          },
          "clientReference": {
            "type": "string",
            "nullable": true
          },
          "callbackData": {
            "type": "string",
            "nullable": true
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "doneAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "validUntil": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "Bulk": {
        "type": "object",
        "properties": {
          "bulkId": {
            "type": "string"
          },
          "wayvzBulkId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "enum": [
              "transactional",
              "marketing"
            ]
          },
          "sendAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sendingSpeedPerMinute": {
            "type": "integer",
            "nullable": true
          },
          "messageCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "summary": {
            "type": "object",
            "properties": {
              "pending": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "byStatus": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "groupName": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "messages": {
                      "type": "integer"
                    },
                    "smsCount": {
                      "type": "integer"
                    }
                  }
                }
              },
              "price": {
                "type": "object",
                "nullable": true,
                "properties": {
                  "total": {
                    "type": "number"
                  },
                  "currency": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "messagesTruncated": {
            "type": "boolean"
          }
        }
      },
      "EstimateResponse": {
        "type": "object",
        "properties": {
          "totalSmsCount": {
            "type": "integer"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "encoding": {
                  "type": "string"
                },
                "smsCountPerDestination": {
                  "type": "integer"
                },
                "destinations": {
                  "type": "integer"
                }
              }
            }
          },
          "rejectedDestinations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "to": {
                  "type": "string"
                },
                "status": {
                  "$ref": "#/components/schemas/Status"
                },
                "error": {
                  "$ref": "#/components/schemas/MessageError"
                }
              }
            }
          }
        }
      },
      "Report": {
        "type": "object",
        "properties": {
          "bulkId": {
            "type": "string"
          },
          "messageId": {
            "type": "string"
          },
          "wayvzMessageId": {
            "type": "string",
            "format": "uuid"
          },
          "to": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "clientReference": {
            "type": "string",
            "nullable": true
          },
          "callbackData": {
            "type": "string",
            "nullable": true
          },
          "smsCount": {
            "type": "integer"
          },
          "partsDelivered": {
            "type": "integer"
          },
          "sentAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "doneAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          },
          "error": {
            "$ref": "#/components/schemas/MessageError"
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          }
        }
      },
      "Reports": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Report"
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "example": "INVALID_SENDER"
              },
              "message": {
                "type": "string"
              },
              "requestId": {
                "type": "string"
              }
            }
          }
        }
      },
      "VerifyRequest": {
        "type": "object",
        "required": [
          "to",
          "sender"
        ],
        "properties": {
          "to": {
            "type": "string",
            "example": "966501234567",
            "description": "Mobile number, international format."
          },
          "sender": {
            "type": "string",
            "example": "WAYVZ",
            "description": "Your registered sender name."
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "ar"
            ],
            "default": "en"
          },
          "appName": {
            "type": "string",
            "maxLength": 40,
            "example": "noon",
            "description": "Shown in the default text."
          },
          "template": {
            "type": "string",
            "maxLength": 480,
            "description": "Own text. Must contain {code}; may use {minutes} and {app}."
          },
          "codeLength": {
            "type": "integer",
            "minimum": 4,
            "maximum": 10,
            "default": 6
          },
          "expiresIn": {
            "type": "integer",
            "minimum": 60,
            "maximum": 1800,
            "default": 300,
            "description": "Seconds."
          },
          "androidAppHash": {
            "type": "string",
            "description": "Android SMS Retriever: the app's 11-character hash, added as the last line."
          },
          "webOtpDomain": {
            "type": "string",
            "example": "example.com",
            "description": "Web OTP: adds '@domain #code' as the last line."
          },
          "clientReference": {
            "type": "string",
            "maxLength": 128
          }
        }
      },
      "VerificationStarted": {
        "type": "object",
        "properties": {
          "verificationId": {
            "type": "string",
            "format": "uuid"
          },
          "to": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "example": "PENDING"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "attemptsAllowed": {
            "type": "integer"
          },
          "wayvzMessageId": {
            "type": "string",
            "format": "uuid"
          },
          "smsCount": {
            "type": "integer"
          },
          "clientReference": {
            "type": "string",
            "nullable": true
          },
          "sandboxCode": {
            "type": "string",
            "nullable": true,
            "description": "Sandbox (sk_test_) keys only."
          }
        }
      },
      "Verification": {
        "type": "object",
        "properties": {
          "verificationId": {
            "type": "string",
            "format": "uuid"
          },
          "valid": {
            "type": "boolean",
            "nullable": true,
            "description": "Check responses only: true when this check approved the code."
          },
          "to": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "APPROVED",
              "EXPIRED",
              "CANCELED",
              "MAX_ATTEMPTS_REACHED",
              "FAILED"
            ]
          },
          "attemptsUsed": {
            "type": "integer"
          },
          "attemptsLeft": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "approvedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "wayvzMessageId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "clientReference": {
            "type": "string",
            "nullable": true
          },
          "sms": {
            "type": "object",
            "nullable": true,
            "description": "GET only: delivery status of the SMS.",
            "properties": {
              "status": {
                "$ref": "#/components/schemas/Status"
              },
              "error": {
                "$ref": "#/components/schemas/MessageError"
              }
            }
          }
        }
      }
    }
  }
}
