Skip to content
Navigation

Create a verification

Sends a one-time code by SMS to destination. Store the returned id; you need it to check the code the user enters.

POST
https://app.touchsms.com.au/api/v3/verify

Authorization

  • basicAuth
    HTTP
    required

Request body JSON required

  • destination
    string
    required

    Mobile number to verify. E.164 preferred; other formats are parsed.

  • source
    optional
    string

    Sender ID for the SMS. Must be a sender ID on your account. Defaults to your account's default sender.

  • template
    optional
    string

    Message text. Must contain %code%. Defaults to Your verification code is %code%.

    maxLength: 306
  • metadata
    optional
    map of
    one of

    Up to 10 key/value pairs. Keys are strings of up to 50 characters; values are strings or integers of up to 100 characters.

  • expiry_seconds
    optional
    integer

    How long the code can be used for.

    maximum: 3600 · minimum: 10 · default: 300
  • token_length
    optional
    integer

    Length of the generated code.

    maximum: 10 · minimum: 6 · default: 6

Returns

201

Verification created and code sent.

JSON
  • data
    optional
    object
    • id
      optional
      string
      format: uuid
    • status
      optional
      created
      or
      sent
      or
      expired
      or
      failed
      or
      verified
      or
      cancelled
    • type
      optional
      sms
      or
      email
    • destination
      optional
      string
    • source
      optional
      string
    • metadata
      optional
      object | null
    • template
      optional
      string
    • expires_at
      optional
      string
      format: date-time
    • created_at
      optional
      string
      format: date-time

401

Missing, malformed or invalid API credentials.
JSON
  • message
    string
    required

422

The request failed validation. errors lists the messages for each invalid field.
JSON
  • message
    optional
    string
  • errors
    optional
    map of
    array<string>

Type to search…

↑↓ navigate↵ selectEsc close