Get Requirements
Get the regulatory requirements for purchasing phone numbers in a specific country. Some countries require identity verification, proof of address, or other documentation before you can purchase a number.
Endpoint
GET https://api.p.2chat.io/open/numbers/requirements
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Parameters
These are query-string parameters.
| Field | Type | Required | Description |
|---|---|---|---|
country | string | Yes | ISO country code (e.g. US, BR, DE) |
did_type | string | No | DID type ID to filter requirements (from the DID Types endpoint) |
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location --request GET 'https://api.p.2chat.io/open/numbers/requirements?country=DE' \
--header 'X-User-API-Key: your_api_key_here'
import requests
url = "https://api.p.2chat.io/open/numbers/requirements"
headers = {
"X-User-API-Key": "your_api_key_here"
}
params = {
"country": "DE"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
const axios = require('axios');
const response = await axios.get('https://api.p.2chat.io/open/numbers/requirements', {
params: { country: 'DE' },
headers: {
'X-User-API-Key': 'your_api_key_here'
}
});
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/numbers/requirements?country=DE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
info
Regulation requirements vary by country. Some countries (like the US) have no special requirements, while others (like Germany) may require identity documents and proof of address.
Response
Success
{
"success": true,
"data": {
"requirements": [
{
// Regulation fields vary by country
// May include identity, address, and proof requirements
}
]
}
}
Error
{
"success": false,
"error": true,
"error_message": "Description of what went wrong"
}