Skip to content
Navigation

Check a code by destination

Checks a code against the most recent verification sent to destination. Checking by ID is recommended instead: if you use this endpoint, make sure two users cannot verify the same number at once and that the number cannot change mid-flow.

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

Authorization

  • basicAuth
    HTTP
    required

Request body JSON required

  • destination
    string
    required

    The number being verified.

  • code
    integer
    required

    Code entered by the user. Must be numeric.

Returns

200

The verification and the result of the check. A failed check still returns 200; use verify_success.

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
  • verify_success
    optional
    boolean

    Whether the code was accepted.

  • verify_error
    optional
    string | null

    Why the check failed, for example Provided code does not match verify, Verify expired before check request, Verify cancelled before check request or Verify already used.

401

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

404

No verification was found for this destination.
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