Skip to main content
POST
/
dir
/
{dir_id}
/
loa
JavaScript
import Telnyx from 'telnyx';

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

const response = await client.dir.createLoa('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
  phone_numbers: ['+13125550000'],
});

console.log(response);

const content = await response.blob();
console.log(content);
"<string>"

Authorizations

Authorization
string
header
required

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

Path Parameters

dir_id
string<uuid>
required

The DIR id.

Body

application/json
phone_numbers
string[]
required

Telephone numbers to authorize on the DIR, in +E164 format (+ followed by 10-15 digits). Max 15 per request.

Required array length: 1 - 15 elements
Pattern: ^\+[1-9][0-9]{9,14}$
agent
object

Optional. The third-party reseller / partner managing the enterprise's phone numbers. Omit when working directly with Telnyx; the LOA marks the Authorized Agent block as N/A.

signature
object

Optional. When provided the rendered PDF embeds the signature image, printed name, and signed-at date. When absent the PDF is returned unsigned so the customer can sign externally and upload it via the Documents API.

Response

The rendered LOA PDF.

The response is of type file.