Skip to main content
POST
/
messaging_hosted_number_orders
/
{id}
/
verification_codes
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const response = await client.messagingHostedNumberOrders.createVerificationCodes('id', {
  phone_numbers: ['string'],
  verification_method: 'sms',
});

console.log(response.data);
{
  "data": [
    {
      "phone_number": "<string>",
      "verification_code_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "sms"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Order ID to have a verification code created.

Body

application/json

Message payload

phone_numbers
string<+E.164>[]
required
verification_method
enum<string>
required
Available options:
sms,
call,
flashcall

Response

Verification codes created and sent to the phone numbers of the hosted order.

data
(VerificationCodeSuccess · object | VerificationCodeError · object)[]
required

Successful verification code creation response

  • VerificationCodeSuccess
  • VerificationCodeError