Learn how to interact with our Text2FA API endpoints
API Settings
.Once configured, events such as number assignment, SMS reception, and rental updates will be POSTed to your Webhook URL.
Endpoint: /api/v1/account-details
Retrieve your account information and current balance.
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));
Endpoint: /api/v1/services-s1
List all available S1 services for temporary numbers.
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));
Endpoint: /api/v1/us-states
Retrieve a list of US states for requesting numbers.
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));
Endpoint: /api/v1/request-number-s1
Request a new temporary number for a specific service and state.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
service_key
— Your S1 service keyrequest_premium
— Premium amountstate
— State 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));
Endpoint: /api/v1/reuse-number-s1
Reuse a previously released S1 number by order ID.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Previous 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));
Endpoint: /api/v1/reject-number-s1
Reject an S1 number that you no longer need.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order 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));
Endpoint: /api/v1/number-details-s1?order_id=6
Fetch details for a specific S1 number by order ID.
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));
Endpoint: /api/v1/reserved-list-s1
Get a list of reserved S1 numbers under your account.
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));
Endpoint: /api/v1/services-s2
List all available S2 services for temporary numbers.
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));
Endpoint: /api/v1/request-number-s2
Request a new S2 temporary number for a specific service.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
service_key
— Your 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));
Endpoint: /api/v1/reject-number-s2
Reject an S2 number that you no longer need.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order 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));
Endpoint: /api/v1/number-details-s2?order_id=10
Fetch details for a specific S2 number by order ID.
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));
Endpoint: /api/v1/reserved-list-s2
Get a list of reserved S2 numbers under your account.
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));
Endpoint: /api/v1/rental-service-list
List all available rental number services.
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));
Endpoint: /api/v1/rental-states
Get a list of states/countries available for rentals.
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));
Endpoint: /api/v1/request-rental-number
Request a new rental number for a selected service.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
service_key
— Your rental service keyduration
— Rental 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));
Endpoint: /api/v1/rental-reserve-list
View currently reserved rental numbers.
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));
Endpoint: /api/v1/rental-message?order_id=123
Retrieve SMS messages received on a single rental number.
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));
Endpoint: /api/v1/active-rental-numbers
List all currently active rental numbers.
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));
Endpoint: /api/v1/renew-rental
Extend the duration of an existing rental.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order ID to renewadditional_days
— Number 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));
Endpoint: /api/v1/cancel-rental
Cancel an active rental and release the number.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order 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));
Endpoint: /api/v1/account-details
Retrieve your account information and current balance.
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));
Endpoint: /api/v1/services-s1
List all available S1 services for temporary numbers.
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));
Endpoint: /api/v1/us-states
Retrieve a list of US states for requesting numbers.
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));
Endpoint: /api/v1/request-number-s1
Request a new temporary number for a specific service and state.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
service_key
— Your S1 service keyrequest_premium
— Premium amountstate
— State 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));
Endpoint: /api/v1/reuse-number-s1
Reuse a previously released S1 number by order ID.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Previous 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));
Endpoint: /api/v1/reject-number-s1
Reject an S1 number that you no longer need.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order 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));
Endpoint: /api/v1/number-details-s1?order_id=6
Fetch details for a specific S1 number by order ID.
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));
Endpoint: /api/v1/reserved-list-s1
Get a list of reserved S1 numbers under your account.
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));
Endpoint: /api/v1/services-s2
List all available S2 services for temporary numbers.
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));
Endpoint: /api/v1/request-number-s2
Request a new S2 temporary number for a specific service.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
service_key
— Your 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));
Endpoint: /api/v1/reject-number-s2
Reject an S2 number that you no longer need.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order 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));
Endpoint: /api/v1/number-details-s2?order_id=10
Fetch details for a specific S2 number by order ID.
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));
Endpoint: /api/v1/reserved-list-s2
Get a list of reserved S2 numbers under your account.
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));
Endpoint: /api/v1/rental-service-list
List all available rental number services.
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));
Endpoint: /api/v1/rental-states
Get a list of states/countries available for rentals.
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));
Endpoint: /api/v1/request-rental-number
Request a new rental number for a selected service.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
service_key
— Your rental service keyduration
— Rental 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));
Endpoint: /api/v1/rental-reserve-list
View currently reserved rental numbers.
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));
Endpoint: /api/v1/rental-message?order_id=123
Retrieve SMS messages received on a single rental number.
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));
Endpoint: /api/v1/active-rental-numbers
List all currently active rental numbers.
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));
Endpoint: /api/v1/renew-rental
Extend the duration of an existing rental.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order ID to renewadditional_days
— Number 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));
Endpoint: /api/v1/cancel-rental
Cancel an active rental and release the number.
Authorization
: YOUR_API_TOKEN
Accept
: application/json
order_id
— Order 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));