Providers / Telesign

Test Telesign SMS without sending real messages

otpmock emulates the Telesign SMS API, SMS Verify and Verify API API. In your test environment, the official telesignsdk SDK talks to otpmock instead of Telesign; your end-to-end tests read each code over HTTPS.

Updated October 8, 2026Tested with the official telesignsdk SDK
Short answer

Set OTPMOCK_URL=https://api.otpmock.com in your test environment, point the Telesign client at it, and use your otpmock API key as the Telesign credential. Your application code doesn't change, and production keeps sending real SMS through Telesign.

Setup

The SDK takes the REST endpoint as its third constructor argument.

Language
sms.jsNode.js · telesignsdk
import TeleSignSDK from "telesignsdk";

export const telesign = new TeleSignSDK(
  process.env.TELESIGN_CUSTOMER_ID, // otpmock API key in tests
  process.env.TELESIGN_API_KEY,
  process.env.OTPMOCK_URL ?? "https://rest-api.telesign.com",
);

Each language is tested in CI against otpmock with the provider's official SDK, or its plain HTTP API where no SDK can be pointed at another host.

Credentials. In the test environment, use your otpmock API key as the Telesign customer ID. The API key can be any base64 value: the SDK signs requests with HMAC, and otpmock reads the customer ID without checking the signature. Basic auth also works.

What otpmock emulates

EndpointWhat it does
POST /v1/messagingSend an SMS (phone_number, message, message_type); status.code 290 on success
POST /v1/verify/smsSMS Verify: send a code (verify_code optional, template with $$CODE$$)
GET /v1/verify/{reference_id}?verify_code=SMS Verify: check; verify.code_state VALID, INVALID or MAX_ATTEMPTS_EXCEEDED
POST /verificationVerify API (verify.telesign.com): start an SMS verification, 201 with status 3901
PATCH /verification/{reference_id}/stateVerify API: finalize with security_factor (204 on success, 400 on a wrong code)
GET /verification/{reference_id}Verify API: status (3900 Verified, 3901 In progress)

Responses and errors follow Telesign's own format, so the SDK parses them as usual. Authentication failures and an exhausted monthly allowance also come back in Telesign's error shape.

Phone numbers

Telesign uses digits with country code (15550142). otpmock stores +15550142.

How to tell your app uses Telesign

Look for any of these in your codebase to confirm where the SMS is sent, and therefore where the otpmock option has to be set:

Read the code in your tests

signup.spec.ts
const phone = otp.randomPhone();
const since = Date.now() - 5_000;
await page.getByRole("button", { name: "Send code" }).click(); // your app calls Telesign
const { code } = await otp.waitForCode(phone, { since });

The otp helper is a single file: get it from the docs. Full walkthroughs: Playwright, Cypress.

Good to know

FAQ

Does otpmock send real SMS through Telesign?

No. In the test environment your app's Telesign requests go to otpmock, which stores the message for 10 minutes and never contacts Telesign or any carrier. Production keeps using Telesign because otpmock is only enabled when OTPMOCK_URL is set.

Is the official telesignsdk SDK supported?

Yes. otpmock's Telesign endpoints are tested end to end with the official telesignsdk package for Node.js. Other languages work too if their Telesign client lets you change the API host.

Which Telesign APIs does otpmock support?

POST /v1/messaging (Send an SMS (phone_number, message, message_type); status.code 290 on success); POST /v1/verify/sms (SMS Verify: send a code (verify_code optional, template with $$CODE$$)); GET /v1/verify/{reference_id}?verify_code= (SMS Verify: check; verify.code_state VALID, INVALID or MAX_ATTEMPTS_EXCEEDED); POST /verification (Verify API (verify.telesign.com): start an SMS verification, 201 with status 3901); PATCH /verification/{reference_id}/state (Verify API: finalize with security_factor (204 on success, 400 on a wrong code)); GET /verification/{reference_id} (Verify API: status (3900 Verified, 3901 In progress)).

Test Telesign flows today

The free plan includes 300 messages a month. Using an AI coding assistant? Point it at otpmock.com/llms-full.txt.

Get a free API key

Related guides

Other providers