API Documentation

Learn how to interact with our Text2FA API endpoints

Webhook Setup

  1. Log in to your Text2FA dashboard.
  2. Navigate to API Settings.
  3. Enter your Webhook URL and click Save.

Once configured, events such as number assignment, SMS reception, and rental updates will be POSTed to your Webhook URL.

GET Account Details

Endpoint: /api/v1/account-details

Retrieve your account information and current balance.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/account-details', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Service List

Endpoint: /api/v1/services-s1

List all available S1 services for temporary numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/services-s1', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Get US States

Endpoint: /api/v1/us-states

Retrieve a list of US states for requesting numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/us-states', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S1) - Request Number

Endpoint: /api/v1/request-number-s1

Request a new temporary number for a specific service and state.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • service_keyYour S1 service key
  • request_premiumPremium amount
  • stateState code (e.g., AL)
// JavaScript
const formData = new URLSearchParams();
formData.append('service_key', 'ee1fdp');
formData.append('request_premium', '10');
formData.append('state', 'AL');

fetch('https://app.text2fa.com/api/v1/request-number-s1', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: formData,
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S1) - Reuse Number

Endpoint: /api/v1/reuse-number-s1

Reuse a previously released S1 number by order ID.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idPrevious order ID to reuse
// JavaScript
fetch('https://app.text2fa.com/api/v1/reuse-number-s1', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '6' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S1) - Reject Number

Endpoint: /api/v1/reject-number-s1

Reject an S1 number that you no longer need.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to reject
// JavaScript
fetch('https://app.text2fa.com/api/v1/reject-number-s1', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '6' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Number Details

Endpoint: /api/v1/number-details-s1?order_id=6

Fetch details for a specific S1 number by order ID.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/number-details-s1?order_id=6', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Reserved List

Endpoint: /api/v1/reserved-list-s1

Get a list of reserved S1 numbers under your account.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/reserved-list-s1', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S2) - Service List

Endpoint: /api/v1/services-s2

List all available S2 services for temporary numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/services-s2', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S2) - Request Number

Endpoint: /api/v1/request-number-s2

Request a new S2 temporary number for a specific service.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • service_keyYour S2 service key
// JavaScript
fetch('https://app.text2fa.com/api/v1/request-number-s2', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ service_key: 'xyz123' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S2) - Reject Number

Endpoint: /api/v1/reject-number-s2

Reject an S2 number that you no longer need.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to reject
// JavaScript
fetch('https://app.text2fa.com/api/v1/reject-number-s2', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '10' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S2) - Number Details

Endpoint: /api/v1/number-details-s2?order_id=10

Fetch details for a specific S2 number by order ID.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/number-details-s2?order_id=10', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S2) - Reserved List

Endpoint: /api/v1/reserved-list-s2

Get a list of reserved S2 numbers under your account.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/reserved-list-s2', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Rental Service List

Endpoint: /api/v1/rental-service-list

List all available rental number services.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-service-list', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Rental States

Endpoint: /api/v1/rental-states

Get a list of states/countries available for rentals.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-states', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Rental Number - Request Rental Number

Endpoint: /api/v1/request-rental-number

Request a new rental number for a selected service.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • service_keyYour rental service key
  • durationRental duration in days
// JavaScript
const rentData = new URLSearchParams();
rentData.append('service_key', 'rent123');
rentData.append('duration', '7');

fetch('https://app.text2fa.com/api/v1/request-rental-number', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: rentData,
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Rental Reserve List

Endpoint: /api/v1/rental-reserve-list

View currently reserved rental numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-reserve-list', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Get Message for a Single Number

Endpoint: /api/v1/rental-message?order_id=123

Retrieve SMS messages received on a single rental number.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-message?order_id=123', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Active Rental Numbers

Endpoint: /api/v1/active-rental-numbers

List all currently active rental numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/active-rental-numbers', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Rental Number - Renew a Rental

Endpoint: /api/v1/renew-rental

Extend the duration of an existing rental.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to renew
  • additional_daysNumber of extra days
// JavaScript
fetch('https://app.text2fa.com/api/v1/renew-rental', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '123', additional_days: '7' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Rental Number - Cancel a Rental

Endpoint: /api/v1/cancel-rental

Cancel an active rental and release the number.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to cancel
// JavaScript
fetch('https://app.text2fa.com/api/v1/cancel-rental', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '123' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Account Details

Endpoint: /api/v1/account-details

Retrieve your account information and current balance.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/account-details', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Service List

Endpoint: /api/v1/services-s1

List all available S1 services for temporary numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/services-s1', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Get US States

Endpoint: /api/v1/us-states

Retrieve a list of US states for requesting numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/us-states', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S1) - Request Number

Endpoint: /api/v1/request-number-s1

Request a new temporary number for a specific service and state.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • service_keyYour S1 service key
  • request_premiumPremium amount
  • stateState code (e.g., AL)
// JavaScript
const formData = new URLSearchParams();
formData.append('service_key', 'ee1fdp');
formData.append('request_premium', '10');
formData.append('state', 'AL');

fetch('https://app.text2fa.com/api/v1/request-number-s1', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: formData,
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S1) - Reuse Number

Endpoint: /api/v1/reuse-number-s1

Reuse a previously released S1 number by order ID.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idPrevious order ID to reuse
// JavaScript
fetch('https://app.text2fa.com/api/v1/reuse-number-s1', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '6' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S1) - Reject Number

Endpoint: /api/v1/reject-number-s1

Reject an S1 number that you no longer need.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to reject
// JavaScript
fetch('https://app.text2fa.com/api/v1/reject-number-s1', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '6' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Number Details

Endpoint: /api/v1/number-details-s1?order_id=6

Fetch details for a specific S1 number by order ID.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/number-details-s1?order_id=6', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S1) - Reserved List

Endpoint: /api/v1/reserved-list-s1

Get a list of reserved S1 numbers under your account.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/reserved-list-s1', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S2) - Service List

Endpoint: /api/v1/services-s2

List all available S2 services for temporary numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/services-s2', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S2) - Request Number

Endpoint: /api/v1/request-number-s2

Request a new S2 temporary number for a specific service.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • service_keyYour S2 service key
// JavaScript
fetch('https://app.text2fa.com/api/v1/request-number-s2', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ service_key: 'xyz123' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Temporary Number (S2) - Reject Number

Endpoint: /api/v1/reject-number-s2

Reject an S2 number that you no longer need.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to reject
// JavaScript
fetch('https://app.text2fa.com/api/v1/reject-number-s2', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '10' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S2) - Number Details

Endpoint: /api/v1/number-details-s2?order_id=10

Fetch details for a specific S2 number by order ID.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/number-details-s2?order_id=10', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Temporary Number (S2) - Reserved List

Endpoint: /api/v1/reserved-list-s2

Get a list of reserved S2 numbers under your account.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/reserved-list-s2', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Rental Service List

Endpoint: /api/v1/rental-service-list

List all available rental number services.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-service-list', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Rental States

Endpoint: /api/v1/rental-states

Get a list of states/countries available for rentals.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-states', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Rental Number - Request Rental Number

Endpoint: /api/v1/request-rental-number

Request a new rental number for a selected service.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • service_keyYour rental service key
  • durationRental duration in days
// JavaScript
const rentData = new URLSearchParams();
rentData.append('service_key', 'rent123');
rentData.append('duration', '7');

fetch('https://app.text2fa.com/api/v1/request-rental-number', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: rentData,
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Rental Reserve List

Endpoint: /api/v1/rental-reserve-list

View currently reserved rental numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-reserve-list', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Get Message for a Single Number

Endpoint: /api/v1/rental-message?order_id=123

Retrieve SMS messages received on a single rental number.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/rental-message?order_id=123', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

GET Rental Number - Active Rental Numbers

Endpoint: /api/v1/active-rental-numbers

List all currently active rental numbers.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json
// JavaScript
fetch('https://app.text2fa.com/api/v1/active-rental-numbers', {
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
  },
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Rental Number - Renew a Rental

Endpoint: /api/v1/renew-rental

Extend the duration of an existing rental.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to renew
  • additional_daysNumber of extra days
// JavaScript
fetch('https://app.text2fa.com/api/v1/renew-rental', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '123', additional_days: '7' }),
})
  .then(res => res.json())
  .then(data => console.log(data));

POST Rental Number - Cancel a Rental

Endpoint: /api/v1/cancel-rental

Cancel an active rental and release the number.

Headers

  • Authorization: YOUR_API_TOKEN
  • Accept: application/json

Parameters

  • order_idOrder ID to cancel
// JavaScript
fetch('https://app.text2fa.com/api/v1/cancel-rental', {
  method: 'POST',
  headers: {
    Authorization: 'YOUR_API_TOKEN',
    Accept: 'application/json',
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  body: new URLSearchParams({ order_id: '123' }),
})
  .then(res => res.json())
  .then(data => console.log(data));