{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robase-dev/json-schema/robase-dev-send-otprequest-schema.json",
  "title": "SendOTPRequest",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robase-dev-openapi.yaml#/components/schemas/SendOTPRequest",
  "type": "object",
  "required": [
    "phone_number"
  ],
  "properties": {
    "phone_number": {
      "type": "string",
      "description": "Phone number in E.164 format"
    },
    "code_length": {
      "type": "integer",
      "minimum": 4,
      "maximum": 8,
      "default": 6,
      "description": "Number of digits in the generated code. Omit to use the default.\nSending `0` is not the same as omitting the field. Anything outside\n4 to 8 is refused with `validation_error`.\n"
    },
    "ttl_seconds": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3600,
      "default": 600,
      "description": "How long the code stays verifiable, in seconds. Omit to use the default."
    },
    "language": {
      "type": "string",
      "enum": [
        "en",
        "fr"
      ],
      "description": "Language for the OTP message body. Omit to use the workspace's default language (Settings → General → Language & region). Supply it per request when your own end users are not all in the same language.\n\n`Accept-Language` deliberately does not affect the message body: it describes the integrator reading our error responses, not the person receiving the SMS.\n"
    },
    "channel": {
      "type": "string",
      "enum": [
        "sms",
        "whatsapp"
      ],
      "description": "Delivery channel for this send. Honoured only when the workspace\n`otp_delivery_mode` allows it:\n\n- `sms` mode: only `sms` (or omit); `whatsapp` → `channel_not_allowed`\n- `whatsapp` mode: only `whatsapp` (or omit); `sms` → `channel_not_allowed`\n- `both` mode: omit only; any explicit value → `channel_not_allowed`\n- `either` mode: `sms` or `whatsapp`; omit means SMS\n\nWhatsApp is OTP-only (Meta Authentication + copy-code). A failed\nWhatsApp leg is never silently re-sent as SMS.\n"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true,
      "maxProperties": 50,
      "description": "Arbitrary key-value data stored with the OTP and returned by `GET /v1/otp/{id}`.\nAt most 50 keys and 4 KB of JSON, or the request fails with\n`validation_error`. Reserved keys (`antispam` and any key starting\nwith `robase_`) are dropped.\n"
    }
  }
}