Skip to main content
GET
/
texml
/
Accounts
/
{account_sid}
/
Calls
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const response = await client.texml.accounts.calls.retrieveCalls('account_sid');

console.log(response.calls);
{
  "calls": [],
  "end": 0,
  "first_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1",
  "next_page_uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ",
  "page": 0,
  "page_size": 1,
  "start": 0,
  "uri": "/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

account_sid
string
required

The id of the account the resource belongs to.

Query Parameters

Page
integer

The number of the page to be displayed, zero-indexed, should be used in conjuction with PageToken.

PageSize
integer

The number of records to be displayed on a page

PageToken
string

Used to request the next page of results.

To
string

Filters calls by the to number.

From
string

Filters calls by the from number.

Status
enum<string>

Filters calls by status.

Available options:
canceled,
completed,
failed,
busy,
no-answer
StartTime
string

Filters calls by their start date. Expected format is YYYY-MM-DD.

StartTime_gt
string

Filters calls by their start date (after). Expected format is YYYY-MM-DD

StartTime_lt
string

Filters calls by their start date (before). Expected format is YYYY-MM-DD

EndTime
string

Filters calls by their end date. Expected format is YYYY-MM-DD

EndTime_gt
string

Filters calls by their end date (after). Expected format is YYYY-MM-DD

EndTime_lt
string

Filters calls by their end date (before). Expected format is YYYY-MM-DD

Response

Multiple call resources.

calls
Call resource · object[]
end
integer

The number of the last element on the page, zero-indexed.

Example:

19

first_page_uri
string

/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1

Example:

"accepted"

next_page_uri
string

/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=1&PageSize=1&PageToken=MTY4AjgyNDkwNzIxMQ

Example:

"accepted"

page
integer

Current page number, zero-indexed.

Example:

0

page_size
integer

The number of items on the page

Example:

20

start
integer

The number of the first element on the page, zero-indexed.

Example:

0

uri
string

The URI of the current page.

Example:

"/v2/texml/Accounts/61bf923e-5e4d-4595-a110-56190ea18a1b/Calls.json?Page=0&PageSize=1"