Skip to main content
GET
/
requirements
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const requirementListResponse of client.requirements.list()) {
  console.log(requirementListResponse.id);
}
import os
from telnyx import Telnyx

client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.requirements.list()
page = page.data[0]
print(page.id)
package main

import (
"context"
"fmt"

"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)

func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Requirements.List(context.TODO(), telnyx.RequirementListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
package com.telnyx.sdk.example;

import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.requirements.RequirementListPage;
import com.telnyx.sdk.models.requirements.RequirementListParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();

RequirementListPage page = client.requirements().list();
}
}
require "telnyx"

telnyx = Telnyx::Client.new(api_key: "My API Key")

page = telnyx.requirements.list

puts(page)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');

try {
$page = $client->requirements->list(
filter: [
'action' => 'porting', 'countryCode' => 'US', 'phoneNumberType' => 'local'
],
pageNumber: 0,
pageSize: 0,
sort: ['country_code'],
);

var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}
telnyx requirements list \
--api-key 'My API Key'
curl --request GET \
--url https://api.telnyx.com/v2/requirements \
--header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "record_type": "requirement",
      "country_code": "FR",
      "locality": "Nice",
      "phone_number_type": "local",
      "action": "ordering",
      "requirements_types": [
        {
          "acceptance_criteria": {
            "time_limit": "Current and not expired",
            "locality_limit": "Issued by the same country that the phone number belongs to",
            "acceptable_values": [
              "US"
            ],
            "max_length": 20,
            "min_length": 16,
            "acceptable_characters": "abcdef0123456789"
          },
          "description": "Proves the customer has a physical address in the same locality as the phone number",
          "example": "Utility bill, internet bill, phone bill, or lease",
          "type": "document",
          "name": "Proof of Address",
          "record_type": "requirement_type",
          "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
          "created_at": "2021-04-09T22:25:27.521Z",
          "updated_at": "2021-04-12T20:20:20.020Z"
        }
      ],
      "id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
      "created_at": "2021-04-09T22:25:27.521Z",
      "updated_at": "2021-04-12T20:20:20.020Z"
    }
  ],
  "meta": {
    "total_pages": 3,
    "total_results": 55,
    "page_number": 2,
    "page_size": 25
  }
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}
{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

filter
object

Consolidated filter parameter for requirements (deepObject style). Originally: filter[country_code], filter[phone_number_type], filter[action]

sort
enum<string>[]

Consolidated sort parameter for requirements (deepObject style). Originally: sort[] Specifies the sort order for results. If you want to sort by a field in ascending order, include it as a sort parameter. If you want to sort in descending order, prepend a - in front of the field name.

Available options:
created_at,
updated_at,
country_code,
phone_number_type,
-created_at,
-updated_at,
-country_code,
-phone_number_type
Example:
["country_code"]
page
object

Consolidated page parameter (deepObject style). Originally: page[size], page[number]

Response

Successful response

data
object[]
meta
object