logo

Staging Environment

The Staging environment is designed to help you safely test your integration with Telgorithm APIs in a production-like environment — without impacting real users, networks, or financial systems.

It supports end-to-end development flows, including:

  • Setting up and managing campaigns
  • Simulating messaging and calling behavior
  • Purchasing and porting phone numbers

⚠️ Important: In the staging environment, messages and calls are not real — they are fully emulated. No actual delivery or telecom traffic occurs. These interactions are mocked to allow controlled testing.

For these cases, Telgorithm provides the testkit, a utility for emulating inbound messages, simulating delivery statuses, and triggering fake calls.

Other operations — such as number purchasing, campaign setup, Port-In, and test payments — are performed through standard Telgorithm APIs and behave similarly to production, with staging-specific behaviors.

All operations require a company token for authentication.

Testkit-Based Emulation

Emulate Inbound Messages

To emulate an Inbound Message, you will need to use the https://api.staging.telgorithm.com/testkit/v1/Emulate/inbound-message endpoint. This endpoint allows you to simulate an incoming message to Telgorithm by specifying only a few fields.

Body for the request contains:

  • "from" - The origination phone number of the message
  • "to" - The destination phone numbers of the message, that should contain at least one company number
  • "text" - The text of the message
  • "mediaUrls" - The URLs for the media, to emulate MMS message
{
"from": "+19876543210",
"to": [
"+11234567890",
"+11234567891"
],
"text": "Text of the message",
"mediaUrls": [
"http://some.site/image.png"
]
}

Once the request is processed, the emulation will create the Inbound Message and send a webhook if it is set up.

Emulate Outbound Delivery Status

To emulate whether an Outbound Message has been delivered or failed, you will need to use the https://api.staging.telgorithm.com/testkit/v1/Emulate/outbound-message-status endpoint. This endpoint allows you to set up the delivery status of an outbound message by providing its SID.

Body for the request contains

  • "sid" - Sid of Outbound Message
  • "to" - The boolean flag, that indicates if delivery should succeed or not
{
"sid": "OM08d9704f044a2fa13d3faa216fcf4574b64b19be32626243",
"deliveredSuccessfully": true
}

Once the request is processed, the emulation will change the status of the Outbound Message and send a webhook if it is set up.

Emulate Inbound Call

To emulate an Inbound Call, you will need to use the https://api.staging.telgorithm.com/testkit/v1/Emulate/inbound-call endpoint. This endpoint allows you to create a call to your number and check the forwarding rules.

Body for the request contains:

  • "from" - The origination phone number of the call
  • "to" - The destination phone number of the call, that should be a company number
  • "durationInMinutes" - Desired duration (in minutes) of emulated call. Value should be in range of [0; 5].
{
"from": "+19876543210",
"to": "+11234567890",
"durationInMinutes": 1
}

If you specify a durationInMinutes of 0, the call will hang up immediately, and no outbound call leg will be created, and no forwarding will be used or requested via webhook.

Otherwise, the call will be handled as follows:

  1. With static forwarding setup, the call ends when the request ends. Inbound and outbound call legs are created, and the call is completed. The duration is set to the value passed in the request.
  2. With routing webhook configuration, the request ends before the call ends, as forwarding data is retrieved via webhook. You will need to await a little for the call to be completed. The duration is set to the value passed in the request.

Emulate Port-In Phone Numbers

To emulate number port-in, use POST https://api.staging.telgorithm.com/messaging/v1/Phones/port-in

This endpoint accepts a multipart/form-data request with two parts:

  • data - JSON object describing the port-in details.
  • files - One or more attachments (LOA documents).

Example data:

{
"phones": [
{
"phone": "+12145678900",
"name": "My Ported Phone",
"messagingConfigSid": "MCf4f1e0ccde19431ebde74a9f2996afa0",
"authorization": {
"accountNumber": "012345",
"accountPhoneNumber": "+12145678900",
"authorizerName": "John Smith",
"authorizationDate": "2023-01-01",
"accountPin": "123"
},
"endUser": {
"name": "John Smith",
"streetNumber": "123",
"streetDirectionPrefix": "N",
"streetName": "Highland",
"streetType": "St",
"streetDirectionPostfix": "N",
"locationType1": "Bld",
"locationValue1": "2B",
"locationType2": "string",
"locationValue2": "string",
"locationType3": "string",
"locationValue3": "string",
"city": "Los Angeles",
"state": "CA",
"postalCode": "12345",
"serviceType": "Business"
}
}
],
"features": "Messaging"
}

After submission, all PendingPortIn numbers are automatically transitioned to Active within 5 minutes in the staging environment.

Emulate Payments

In the staging environment, you can bind and use test credit cards to simulate successful payment flows (e.g., number purchases, subscriptions, campaign setup).

Test cards can be added via the Staging Portal under
Organization → Billing → Payment Info.

Below is a list of supported test card numbers:

Card TypeTest NumberCVV
Visa4012000098765439999
Mastercard5146315000000055998
Mastercard (BIN 2)2223000048400011998
Discover6011000993026909996
American Express3741010000006089997
American Express3714496353923769997
Diner’s Club36256000000725123
JCB3566000000000000123

Use these cards only in the Staging environment. No actual charges will be made.