3.0.0 • Published 5 years ago

@datafire/telnyx v3.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@datafire/telnyx

Client library for Telnyx API

Installation and Usage

npm install --save @datafire/telnyx
let telnyx = require('@datafire/telnyx').create({
  BearerAuth: "",
  bearerAuth: ""
});

.then(data => {
  console.log(data);
});

Description

SIP trunking, SMS, MMS, Call Control and Telephony Data Services.

Actions

DeleteBulkTelephonyCredential

Delete several credentials in bulk.

telnyx.DeleteBulkTelephonyCredential({
  "filter[tag]": ""
}, context)

Input

  • input object
    • filtertag required string: Filter by tag, required by bulk operations.

Output

  • output object
    • data object
      • credentials integer: Amount of credentials affected

UpdateBulkTelephonyCredential

Update several credentials in bulk.

telnyx.UpdateBulkTelephonyCredential({
  "filter[tag]": "",
  "body": {
    "tag": "",
    "connection_id": ""
  }
}, context)

Input

Output

  • output object
    • data object
      • credentials integer: Amount of credentials affected

CreateBulkTelephonyCredential

Creates several credentials in bulk.

telnyx.CreateBulkTelephonyCredential({
  "body": {
    "tag": "",
    "connection_id": ""
  }
}, context)

Input

Output

  • output object
    • data object
      • credentials integer: Amount of credentials affected

BulkSIMCardNetworkPreferences

This API allows dispatching the same operation described for the PUT sim_cards/:sim_card_id/network_preferences API for multiple SIM cards at once. Although, a SIM card network preference may fail individually under any validation triggered as a consequence of its state. For example, a SIM can't have an in-progress OTA update for applying a Network Preference, so they'll fail when requested in this API. In that scenario, the specific error will be present in the response along with the successful definitions in the "errors" response node.

telnyx.BulkSIMCardNetworkPreferences({}, context)

Input

Output

SimCardRegister

Register the SIM cards associated with the provided registration codes to the current user's account. If sim_card_group_id is provided, the SIM cards will be associated with that group. Otherwise, the default group for the current user, which is already data-enabled, will be used.

telnyx.SimCardRegister({
  "body": {}
}, context)

Input

Output

  • output object

BulkCredentialAction

Perform activate or deactivate action on all credentials filtered by the provided tag. Activate action will change the status to active, making it possible to connect calls with the credential. Deactivate action will change the status to inactive, making it impossible to connect calls with the credential.

telnyx.BulkCredentialAction({
  "action": "",
  "filter[tag]": ""
}, context)

Input

  • input object
    • action required string (values: activate, deactivate): Identifies the action to be taken. Activate will change the status to active. Deactivate will change the status to inactive.
    • filtertag required string: Filter by tag, required by bulk operations.

Output

  • output object
    • data object
      • credentials integer: Amount of credentials affected

findAddresss

Returns a list of your addresses.

telnyx.findAddresss({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filtercustomer_reference string: Filter addresses via the customer reference set. Matching is not case-sensitive.
    • filtercustomer_reference string: If present, addresses with customer_reference containing the given value will be returned. Matching is not case-sensitive.
    • filterstreet_address string: If present, addresses with street_address containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • filteraddress_book string: If present, only returns results with the address_book flag set to the given value.
    • sort string (values: created_at, first_name, last_name, business_name, street_address): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

CreateAddress

Creates an address.

telnyx.CreateAddress({
  "body": {
    "first_name": "",
    "last_name": "",
    "business_name": "",
    "street_address": "",
    "locality": "",
    "country_code": ""
  }
}, context)

Input

Output

validateAddress

Validates an address for emergency services.

telnyx.validateAddress({
  "body": {
    "country_code": "",
    "street_address": "",
    "locality": "",
    "postal_code": "",
    "administrative_area": ""
  }
}, context)

Input

Output

DeleteAddress

Deletes an existing address.

telnyx.DeleteAddress({
  "id": ""
}, context)

Input

  • input object
    • id required string: address ID

Output

getAddress

Retrieves the details of an existing address.

telnyx.getAddress({
  "id": ""
}, context)

Input

  • input object
    • id required string: address ID

Output

listAvailablePhoneNumbers

List available phone numbers

telnyx.listAvailablePhoneNumbers({}, context)

Input

  • input object
    • filterphone_number string: Filter numbers starting with a pattern (meant to be used after national_destination_code filter has been set).
    • filterphone_number string: Filter numbers ending with a pattern.
    • filterphone_number string: Filter numbers containing a pattern.
    • filterlocality string: Filter phone numbers by city.
    • filteradministrative_area string: Filter phone numbers by US state/CA province.
    • filtercountry_code string: Filter phone numbers by ISO alpha-2 country code.
    • filternational_destination_code string: Filter by the national destination code of the number. This filter is only applicable to North American numbers.
    • filterrate_center string: Filter phone numbers by NANP rate center. This filter is only applicable to North American numbers.
    • filternumber_type string (values: toll-free, national, mobile, local): Filter phone numbers by number type.
    • filterfeatures array: Filter if the phone number should be used for voice, fax, mms, sms, emergency.
    • filterlimit integer: Limits the number of results.
    • filterbest_effort boolean: Filter to determine if best effort results should be included.
    • filterquickship boolean: Filter to exclude phone numbers that need additional time after to purchase to receive phone calls.
    • filterreservable boolean: Filter to exclude phone numbers that cannot be reserved before purchase.

Output

getUserBalance

Retrieve user balance details

telnyx.getUserBalance(null, context)

Input

This action has no parameters

Output

listBillingGroups

List all billing groups

telnyx.listBillingGroups({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

createBillingGroup

Create a billing group

telnyx.createBillingGroup({
  "body": null
}, context)

Input

Output

deleteBillingGroup

Delete a billing group

telnyx.deleteBillingGroup({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the billing group

Output

retrieveBillingGroup

Retrieve a billing group

telnyx.retrieveBillingGroup({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the billing group

Output

updateBillingGroup

Update a billing group

telnyx.updateBillingGroup({
  "id": "",
  "body": null
}, context)

Input

  • input object

Output

listCallControlApplications

Return a list of call control applications.

telnyx.listCallControlApplications({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterapplication_name string: If present, applications with application_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • filteroutbound.outbound_voice_profile_id string: Identifies the associated outbound voice profile.
    • sort string (values: created_at, connection_name, active): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

createCallControlApplication

Create a call control application.

telnyx.createCallControlApplication({
  "body": {
    "application_name": "",
    "webhook_event_url": ""
  }
}, context)

Input

Output

deleteCallControlApplication

Deletes a call control application.

telnyx.deleteCallControlApplication({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

retrieveCallControlApplication

Retrieves the details of an existing call control application.

telnyx.retrieveCallControlApplication({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

updateCallControlApplication

Updates settings of an existing call control application.

telnyx.updateCallControlApplication({
  "id": "",
  "body": {
    "application_name": "",
    "webhook_event_url": ""
  }
}, context)

Input

Output

listCallEvents

Filters call events by given filter parameters. Events are ordered by event_timestamp. If filter for call_leg_id or call_session_id is not present, it only filters events from the last 24 hours.

Note: Only one filter[event_timestamp] can be passed.

telnyx.listCallEvents({}, context)

Input

  • input object
    • filtercall_leg_id string: The unique identifier of an individual call leg.
    • filtercall_session_id string: The unique identifier of the call control session. A session may include multiple call leg events.
    • filterstatus string (values: delivered, failed): Event status
    • filtertype string (values: command, webhook): Event type
    • filterevent_timestamp string: Event timestamp: greater than
    • filterevent_timestamp string: Event timestamp: greater than or equal
    • filterevent_timestamp string: Event timestamp: lower than
    • filterevent_timestamp string: Event timestamp: lower than or equal
    • filterevent_timestamp string: Event timestamp: equal
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

callDial

Dial a number or SIP URI from a given connection. A successful response will include a call_leg_id which can be used to correlate the command with subsequent webhooks.

Expected Webhooks:

  • call.initiated
  • call.answered or call.hangup
  • call.machine.detection.ended if answering_machine_detection was requested
  • call.machine.greeting.ended if answering_machine_detection was set to detect_beep, greeting_end or detect_words
telnyx.callDial({
  "body": {
    "connection_id": "",
    "to": "",
    "from": ""
  }
}, context)

Input

Output

  • output object

retrieveCallStatus

Returns the status of a call (data is available 10 minutes after call ended).

telnyx.retrieveCallStatus({
  "call_control_id": ""
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call

Output

  • output object

callAnswer

Answer an incoming call. You must issue this command before executing subsequent commands on an incoming call.

Expected Webhooks:

  • call.answered
telnyx.callAnswer({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required AnswerRequest

Output

callBridge

Bridge two call control calls.

Expected Webhooks:

  • call.bridged for Leg A
  • call.bridged for Leg B
telnyx.callBridge({
  "call_control_id": "",
  "body": {
    "call_control_id": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required BridgeRequest

Output

callForkStart

Call forking allows you to stream the media from a call to a specific target in realtime. This stream can be used to enable realtime audio analysis to support a variety of use cases, including fraud detection, or the creation of AI-generated audio responses. Requests must specify either the target attribute or the rx and tx attributes.

Expected Webhooks:

  • call.fork.started
  • call.fork.stopped

Simple Telnyx RTP Encapsulation Protocol (STREP)

Note: This header/encapsulation is not used when the rx and tx parameters have been specified; it only applies when media is forked using the target attribute.

If the destination for forked media is specified using the "target" attribute, the RTP will be encapsulated in an extra Telnyx protocol, which adds a 24 byte header to the RTP payload in each packet. The STREP header includes the Call Control call_leg_id for stream identification, along with bits that represent the direction (inbound or outbound) of the media. This 24-byte header sits between the UDP header and the RTP header.

The STREP header makes it possible to fork RTP for multiple calls (or two RTP streams for the same call) to the same IP:port, where the streams can be demultiplexed by your application using the information in the header. Of course, it's still possible to ignore this header completely, for example, if sending forked media for different calls to different ports or IP addresses. In this case, simply strip 24 bytes (or use the second byte to find the header length) from the received UDP payload to get the RTP (RTP header and payload).

STREP Specification

  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |1 1|Version|L|D|    HeaderLen  |  reserved (2 bytes)           |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |       reserved (4 bytes, for UDP ports or anything else)      |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |               The call_leg_id                                 |
 |                   from Call Control                           |
 |                       (128 bits / 16 bytes)                   |
 |                           (this is binary data)               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

 11
   Static bits 11, always set to 11 to easily distinguish forked media
   from RTP (10) and T.38 media (usually 00) and SIP (which begins
   with a capital letter, so begins with bits 01). This is a magic number.

 Version
   Four bits to indicate the version number of the protocol, starting at 0001.

 L
   One bit to represent the leg of the call (A or B).
   0 represents the A (first) leg of the call.
   1 represents the B (second) leg of the call.

 D
   One bit to represent the direction of this RTP stream.
   0 represents media received by Telnyx.
   1 represents media transmitted by Telnyx.

 HeaderLen (1 byte)
   The length of the header in bytes.
   Note that this value does not include the length of the payload. The total
   size of the RTP can be calculated by subtracting the HeaderLen from the UDP
   length (minus 8 for the UDP header).
   In version 1, this value will always be 24.

 Reserved (6 bytes)
   Reserved for future use and to make sure that the header is a multiple of 32 bits

 Call Leg ID
   A 128-bit identifier for the call leg.
   This is the call_leg_id from Call Control.
telnyx.callForkStart({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required StartForkingRequest

Output

callForkStop

Stop forking a call.

Expected Webhooks:

  • call.fork.stopped
telnyx.callForkStop({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required StopForkingRequest

Output

callGatherStop

Stop current gather.

Expected Webhooks:

  • call.gather.ended
telnyx.callGatherStop({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required StopGatherRequest

Output

callGatherUsingAudio

Play an audio file on the call until the required DTMF signals are gathered to build interactive menus.

You can pass a list of valid digits along with an 'invalid_audio_url', which will be played back at the beginning of each prompt. Playback will be interrupted when a DTMF signal is received. The Answer command must be issued before the gather_using_audio command.

Expected Webhooks:

  • call.playback.started
  • call.playback.ended
  • call.dtmf.received (you may receive many of these webhooks)
  • call.gather.ended
telnyx.callGatherUsingAudio({
  "call_control_id": "",
  "body": {
    "audio_url": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required GatherUsingAudioRequest

Output

callGatherUsingSpeak

Convert text to speech and play it on the call until the required DTMF signals are gathered to build interactive menus.

You can pass a list of valid digits along with an 'invalid_payload', which will be played back at the beginning of each prompt. Speech will be interrupted when a DTMF signal is received. The Answer command must be issued before the gather_using_speak command.

Expected Webhooks:

  • call.dtmf.received (you may receive many of these webhooks)
  • call.gather.ended
telnyx.callGatherUsingSpeak({
  "call_control_id": "",
  "body": {
    "voice": "",
    "language": "",
    "payload": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required GatherUsingSpeakRequest

Output

callHangup

Hang up the call.

Expected Webhooks:

  • call.hangup
  • call.recording.saved
telnyx.callHangup({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required HangupRequest

Output

callPlaybackStart

Play an audio file on the call. If multiple play audio commands are issued consecutively, the audio files will be placed in a queue awaiting playback.

Notes:

  • When overlay is enabled, loop is limited to 1, and target_legs is limited to self.
  • A customer cannot Play Audio with overlay=true unless there is a Play Audio with overlay=false actively playing.

Expected Webhooks:

  • call.playback.started
  • call.playback.ended
telnyx.callPlaybackStart({
  "call_control_id": "",
  "body": {
    "audio_url": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required PlayAudioUrlRequest

Output

callPlaybackStop

Stop audio being played on the call.

Expected Webhooks:

  • call.playback.ended or call.speak.ended
telnyx.callPlaybackStop({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required PlaybackStopRequest

Output

callRecordPause

Pause recording the call. Recording can be resumed via Resume recording command.

Expected Webhooks:

There are no webhooks associated with this command.

telnyx.callRecordPause({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required PauseRecordingRequest

Output

callRecordResume

Resume recording the call.

Expected Webhooks:

There are no webhooks associated with this command.

telnyx.callRecordResume({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required ResumeRecordingRequest

Output

callRecordStart

Start recording the call. Recording will stop on call hang-up, or can be initiated via the Stop Recording command.

Expected Webhooks:

  • call.recording.saved
telnyx.callRecordStart({
  "call_control_id": "",
  "body": {
    "format": "",
    "channels": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required StartRecordingRequest

Output

callRecordStop

Stop recording the call.

Expected Webhooks:

  • call.recording.saved
telnyx.callRecordStop({
  "call_control_id": "",
  "body": {}
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required StopRecordingRequest

Output

callRefer

Initiate a SIP Refer on a Call Control call. You can initiate a SIP Refer at any point in the duration of a call.

Expected Webhooks:

  • call.refer.started
  • call.refer.completed
  • call.refer.failed
telnyx.callRefer({
  "call_control_id": "",
  "body": {
    "sip_address": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required ReferRequest

Output

callReject

Reject an incoming call.

Expected Webhooks:

  • call.hangup
telnyx.callReject({
  "call_control_id": "",
  "body": {
    "cause": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required RejectRequest

Output

callSendDTMF

Sends DTMF tones from this leg. DTMF tones will be heard by the other end of the call.

Expected Webhooks:

There are no webhooks associated with this command.

telnyx.callSendDTMF({
  "call_control_id": "",
  "body": {
    "digits": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required SendDTMFRequest

Output

callSpeak

Convert text to speech and play it back on the call. If multiple speak text commands are issued consecutively, the audio files will be placed in a queue awaiting playback.

Expected Webhooks:

  • call.speak.started
  • call.speak.ended
telnyx.callSpeak({
  "call_control_id": "",
  "body": {
    "payload": "",
    "voice": "",
    "language": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required SpeakRequest

Output

callTransfer

Transfer a call to a new destination. If the transfer is unsuccessful, a call.hangup webhook for the other call (Leg B) will be sent indicating that the transfer could not be completed. The original call will remain active and may be issued additional commands, potentially transfering the call to an alternate destination.

Expected Webhooks:

  • call.initiated
  • call.bridged to Leg B
  • call.answered or call.hangup
  • call.machine.detection.ended if answering_machine_detection was requested
  • call.machine.greeting.ended if answering_machine_detection was set to detect_beep, greeting_end or detect_words
telnyx.callTransfer({
  "call_control_id": "",
  "body": {
    "to": ""
  }
}, context)

Input

  • input object
    • call_control_id required string: Unique identifier and token for controlling the call
    • body required TransferCallRequest

Output

listConferences

Lists conferences. Conferences are created on demand, and will expire after all participants have left the conference or after 4 hours regardless of the number of active participants. Conferences are listed in descending order by expires_at.

telnyx.listConferences({}, context)

Input

  • input object
    • filtername string: If present, conferences will be filtered to those with a matching name attribute. Matching is case-sensitive
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

createConference

Create a conference from an existing call leg using a call_control_id and a conference name. Upon creating the conference, the call will be automatically bridged to the conference. Conferences will expire after all participants have left the conference or after 4 hours regardless of the number of active participants.

Expected Webhooks:

  • conference.created
  • conference.participant.joined
  • conference.participant.left
  • conference.ended
  • conference.recording.saved
telnyx.createConference({
  "body": {
    "call_control_id": "",
    "name": ""
  }
}, context)

Input

Output

listConferenceParticipants

Lists conference participants

telnyx.listConferenceParticipants({
  "conference_id": ""
}, context)

Input

  • input object
    • conference_id required string: Uniquely identifies the conference by id or name
    • filtermuted boolean: If present, participants will be filtered to those who are/are not muted
    • filteron_hold boolean: If present, participants will be filtered to those who are/are not put on hold
    • filterwhispering boolean: If present, participants will be filtered to those who are whispering or are not
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

retrieveConference

Retrieve an existing conference

telnyx.retrieveConference({
  "id": ""
}, context)

Input

  • input object
    • id required string: Uniquely identifies the conference by id or name

Output

conferenceDialParticipantIn

Dials a phone number and, when the call is answered, automatically joins them into the specified conference.

Expected Webhooks:

  • call.hangup
  • call.answered
  • conference.participant.joined
  • conference.participant.left
telnyx.conferenceDialParticipantIn({
  "id": "",
  "body": {
    "call_control_id": "",
    "from": "",
    "to": ""
  }
}, context)

Input

  • input object

Output

conferenceHoldParticipants

Hold a list of participants in a conference call

telnyx.conferenceHoldParticipants({
  "id": "",
  "body": {}
}, context)

Input

  • input object

Output

conferenceJoin

Join an existing call leg to a conference. Issue the Join Conference command with the conference ID in the path and the call_control_id of the leg you wish to join to the conference as an attribute.

Expected Webhooks:

  • conference.participant.joined
  • conference.participant.left
telnyx.conferenceJoin({
  "id": "",
  "body": {
    "call_control_id": ""
  }
}, context)

Input

  • input object

Output

conferenceMuteParticipants

Mute a list of participants in a conference call

telnyx.conferenceMuteParticipants({
  "id": "",
  "body": {}
}, context)

Input

  • input object

Output

conferencePlayAudio

Play audio to all or some participants on a conference call.

telnyx.conferencePlayAudio({
  "id": "",
  "body": {
    "audio_url": ""
  }
}, context)

Input

  • input object

Output

conferenceStartRecording

Start recording the conference. Recording will stop on conference end, or via the Stop Recording command.

Expected Webhooks:

  • conference.recording.saved
telnyx.conferenceStartRecording({
  "id": "",
  "body": {
    "format": "",
    "channels": ""
  }
}, context)

Input

  • input object

Output

conferenceStopRecording

Stop recording the conference.

Expected Webhooks:

  • conference.recording.saved
telnyx.conferenceStopRecording({
  "id": "",
  "body": {}
}, context)

Input

  • input object
    • id required string: Specifies the conference to stop the recording for by id or name
    • body required StopRecordingRequest

Output

conferenceSpeakText

Convert text to speech and play it to all or some participants.

telnyx.conferenceSpeakText({
  "id": "",
  "body": {
    "payload": "",
    "voice": "",
    "language": ""
  }
}, context)

Input

Output

conferenceUnholdParticipants

Unhold a list of participants in a conference call

telnyx.conferenceUnholdParticipants({
  "id": "",
  "body": {
    "call_control_ids": []
  }
}, context)

Input

  • input object

Output

conferenceUnmuteParticipants

Unmute a list of participants in a conference call

telnyx.conferenceUnmuteParticipants({
  "id": "",
  "body": {}
}, context)

Input

  • input object

Output

listConnections

Returns a list of your connections irrespective of type.

telnyx.listConnections({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterconnection_name string: If present, connections with connection_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • filteroutbound_voice_profile_id string: Identifies the associated outbound voice profile.
    • sort string (values: created_at, connection_name, active): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

retrieveConnection

Retrieves the high-level details of an existing connection. To retrieve specific authentication information, use the endpoint for the specific connection type.

telnyx.retrieveConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: IP Connection ID

Output

listCredentialConnections

Returns a list of your credential connections.

telnyx.listCredentialConnections({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterconnection_name string: If present, connections with connection_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • filteroutbound.outbound_voice_profile_id string: Identifies the associated outbound voice profile.
    • sort string (values: created_at, connection_name, active): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

createCredentialConnection

Creates a credential connection.

telnyx.createCredentialConnection({
  "body": {}
}, context)

Input

Output

deleteCredentialConnection

Deletes an existing credential connection.

telnyx.deleteCredentialConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

retrieveCredentialConnection

Retrieves the details of an existing credential connection.

telnyx.retrieveCredentialConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

updateCredentialConnection

Updates settings of an existing credential connection.

telnyx.updateCredentialConnection({
  "id": "",
  "body": {}
}, context)

Input

Output

listFaxApplications

This endpoint returns a list of your Fax Applications inside the 'data' attribute of the response. You can adjust which applications are listed by using filters. Fax Applications are used to configure how you send and receive faxes using the Programmable Fax API with Telnyx.

telnyx.listFaxApplications({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterapplication_name string: If present, applications with application_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • filteroutbound.outbound_voice_profile_id string: Identifies the associated outbound voice profile.
    • sort string (values: created_at, connection_name, active): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

CreateFaxApplication

Creates a new Fax Application based on the parameters sent in the request. The application name and webhook URL are required. Once created, you can assign phone numbers to your application using the /phone_numbers endpoint.

telnyx.CreateFaxApplication({
  "body": {
    "application_name": "",
    "webhook_event_url": ""
  }
}, context)

Input

Output

DeleteFaxApplication

Permanently deletes a Fax Application. Deletion may be prevented if the application is in use by phone numbers.

telnyx.DeleteFaxApplication({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

getFaxApplication

Return the details of an existing Fax Application inside the 'data' attribute of the response.

telnyx.getFaxApplication({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

UpdateFaxApplication

Updates settings of an existing Fax Application based on the parameters of the request.

telnyx.UpdateFaxApplication({
  "id": "",
  "body": {
    "application_name": "",
    "webhook_event_url": ""
  }
}, context)

Input

Output

ListFaxes

View a list of faxes

telnyx.ListFaxes({}, context)

Input

  • input object
    • filtercreated_at string: ISO 8601 date time for filtering faxes created after or on that date
    • filtercreated_at string: ISO 8601 date time for filtering faxes created after that date
    • filtercreated_at string: ISO 8601 formatted date time for filtering faxes created on or before that date
    • filtercreated_at string: ISO 8601 formatted date time for filtering faxes created before that date
    • filterdirection string: The direction, inbound or outbound, for filtering faxes sent from this account
    • filterfrom string: The phone number, in E.164 format for filtering faxes sent from this number
    • pagesize integer: Number of fax resourcxes for the single page returned
    • pagenumber integer: Number of the page to be retrieved

Output

  • output object
    • data array
    • meta object

SendFax

Send a fax

telnyx.SendFax({
  "body": {
    "connection_id": "",
    "media_url": "",
    "to": ""
  }
}, context)

Input

Output

  • output object

DeleteFax

Delete a fax

telnyx.DeleteFax({
  "id": ""
}, context)

Input

  • input object
    • id required string: The unique identifier of a fax.

Output

Output schema unknown

ViewFax

View a fax

telnyx.ViewFax({
  "id": ""
}, context)

Input

  • input object
    • id required string: The unique identifier of a fax.

Output

  • output object

listFqdnConnections

Returns a list of your FQDN connections.

telnyx.listFqdnConnections({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterconnection_name string: If present, connections with connection_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • sort string (values: created_at, connection_name, active): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

createFqdnConnection

Creates a FQDN connection.

telnyx.createFqdnConnection({
  "body": null
}, context)

Input

Output

deleteFqdnConnection

Deletes an FQDN connection.

telnyx.deleteFqdnConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: FQDN Connection ID

Output

retrieveFqdnConnection

Retrieves the details of an existing FQDN connection.

telnyx.retrieveFqdnConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: FQDN Connection ID

Output

updateFqdnConnection

Updates settings of an existing FQDN connection.

telnyx.updateFqdnConnection({
  "id": "",
  "body": null
}, context)

Input

Output

listFqdns

Get all FQDNs belonging to the user that match the given filters.

telnyx.listFqdns({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterconnection_id string: ID of the FQDN connection to which the FQDN belongs.
    • filterfqdn string: FQDN represented by the resource.
    • filterport integer: Port to use when connecting to the FQDN.
    • filterdns_record_type string: DNS record type used by the FQDN.

Output

  • output object
    • data array

createFqdn

Create a new FQDN object.

telnyx.createFqdn({}, context)

Input

Output

  • output object

deleteFqdn

Delete an FQDN.

telnyx.deleteFqdn({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

  • output object

retrieveFqdn

Return the details regarding a specific FQDN.

telnyx.retrieveFqdn({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the resource.

Output

  • output object

updateFqdn

Update the details of a specific FQDN.

telnyx.updateFqdn({
  "id": ""
}, context)

Input

Output

  • output object

listIpConnections

Returns a list of your IP connections.

telnyx.listIpConnections({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterconnection_name string: If present, connections with connection_name containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters.
    • filteroutbound.outbound_voice_profile_id string: Identifies the associated outbound voice profile.
    • sort string (values: created_at, connection_name, active): Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the - prefix.

Output

createIpConnection

Creates an IP connection.

telnyx.createIpConnection({
  "body": null
}, context)

Input

Output

deleteIpConnection

Deletes an existing IP connection.

telnyx.deleteIpConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the type of resource.

Output

retrieveIpConnection

Retrieves the details of an existing ip connection.

telnyx.retrieveIpConnection({
  "id": ""
}, context)

Input

  • input object
    • id required string: IP Connection ID

Output

updateIpConnection

Updates settings of an existing IP connection.

telnyx.updateIpConnection({
  "id": "",
  "body": null
}, context)

Input

Output

listIps

Get all IPs belonging to the user that match the given filters.

telnyx.listIps({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterconnection_id string: ID of the IP Connection to which this IP should be attached.
    • filterip_address string: IP adddress represented by this resource.
    • filterport integer: Port to use when connecting to this IP.

Output

  • output object
    • data array

createIp

Create a new IP object.

telnyx.createIp({}, context)

Input

Output

  • output object

deleteIp

Delete an IP.

telnyx.deleteIp({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the type of resource.

Output

  • output object

retrieveIp

Return the details regarding a specific IP.

telnyx.retrieveIp({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the type of resource.

Output

  • output object

updateIp

Update the details of a specific IP.

telnyx.updateIp({
  "id": ""
}, context)

Input

  • input object

Output

  • output object

createLedgerBillingGroupReport

Create a ledger billing group report

telnyx.createLedgerBillingGroupReport({
  "body": null
}, context)

Input

Output

retrieveLedgerBillingGroupReport

Retrieve a ledger billing group report

telnyx.retrieveLedgerBillingGroupReport({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the ledger billing group report

Output

createMessage

Send a message with a Phone Number, Alphanumeric Sender ID, Short Code or Number Pool.

This endpoint allows you to send a message with any messaging resource. Current messaging resources include: long-code, short-code, number-pool, and alphanumeric-sender-id.

telnyx.createMessage({}, context)

Input

Output

createLongCodeMessage

Send a long code message

telnyx.createLongCodeMessage({}, context)

Input

Output

createNumberPoolMessage

Send a message using number pool

telnyx.createNumberPoolMessage({}, context)

Input

Output

createShortCodeMessage

Send a short code message

telnyx.createShortCodeMessage({}, context)

Input

Output

retrieveMessage

Note: This API endpoint can only retrieve messages that are no older than 10 days since their creation. If you require messages older than this, please generate an MDR report.

telnyx.retrieveMessage({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the message

Output

listMessagingHostedNumberOrder

List messaging hosted number orders

telnyx.listMessagingHostedNumberOrder({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

createMessagingHostedNumberOrder

Create a messaging hosted number order

telnyx.createMessagingHostedNumberOrder({}, context)

Input

Output

retrieveMessagingHostedNumberOrder

Retrieve a messaging hosted number order

telnyx.retrieveMessagingHostedNumberOrder({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the type of resource.

Output

uploadFileMessagingHostedNumberOrder

Upload file required for a messaging hosted number order

telnyx.uploadFileMessagingHostedNumberOrder({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the type of resource.
    • bill string: Must be the last month's bill with proof of ownership of all of the numbers in the order in PDF format.
    • loa string: Must be a signed LOA for the numbers in the order in PDF format.

Output

deleteMessagingHostedNumber

Delete a messaging hosted number

telnyx.deleteMessagingHostedNumber({
  "id": ""
}, context)

Input

  • input object
    • id required string: Identifies the type of resource.

Output

listMessagingProfileMetrics

List messaging profile metrics

telnyx.listMessagingProfileMetrics({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • id string: The id of the messaging profile(s) to retrieve
    • time_frame string (values: 1h, 3h, 24h, 3d, 7d, 30d): The timeframe for which you'd like to retrieve metrics.

Output

listMessagingProfiles

List messaging profiles

telnyx.listMessagingProfiles({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

createMessagingProfile

Create a messaging profile

telnyx.createMessagingProfile({
  "body": {
    "name": ""
  }
}, context)

Input

Output

deleteMessagingProfile

Delete a messaging profile

telnyx.deleteMessagingProfile({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the messaging profile to retrieve

Output

retrieveMessagingProfile

Retrieve a messaging profile

telnyx.retrieveMessagingProfile({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the messaging profile to retrieve

Output

updateMessagingProfile

Update a messaging profile

telnyx.updateMessagingProfile({
  "id": "",
  "body": {}
}, context)

Input

Output

retrieveMessagingProfileDetailedMetrics

Retrieve messaging profile metrics

telnyx.retrieveMessagingProfileDetailedMetrics({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the messaging profile to retrieve
    • time_frame string (values: 1h, 3h, 24h, 3d, 7d, 30d): The timeframe for which you'd like to retrieve metrics.

Output

listMessagingProfilePhoneNumbers

List phone numbers associated with a messaging profile

telnyx.listMessagingProfilePhoneNumbers({
  "id": ""
}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • id required string: The id of the messaging profile to retrieve

Output

listMessagingProfileShortCodes

List short codes associated with a messaging profile

telnyx.listMessagingProfileShortCodes({
  "id": ""
}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • id required string: The id of the messaging profile to retrieve

Output

listMessagingUrlDomains

List messaging URL domains

telnyx.listMessagingUrlDomains({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page

Output

MobileOperatorNetworksGet

Telnyx has a set of GSM mobile operators partners that are available through our mobile network roaming. This resource is entirely managed by Telnyx and may change over time. That means that this resource won't allow any write operations for it. Still, it's available so it can be used as a support resource that can be related to other resources or become a configuration option.

telnyx.MobileOperatorNetworksGet({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filtername string: Filter by name starting with.
    • filtername string: Filter by name containing match.
    • filtername string: Filter by name ending with.
    • filtercountry_code string: Filter by exact country_code.
    • filtermcc string: Filter by exact MCC.
    • filtermnc string: Filter by exact MNC.
    • filtertadig string: Filter by exact TADIG.

Output

listNotificationChannels

List notification channels.

telnyx.listNotificationChannels({}, context)

Input

  • input object
    • pagenumber integer: The page number to load
    • pagesize integer: The size of the page
    • filterchannel_type_id string (values: webhook, sms, email, voice): Filter by the id of a channel type

Output

createNotificationChannels

Create a notification channel.

telnyx.createNotificationChannels({}, context)

Input

Output

deleteNotificationChannel

Delete a notification channel.

telnyx.deleteNotificationChannel({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the resource.

Output

retrieveNotificationChannel

Retrieve a notification channel.

telnyx.retrieveNotificationChannel({
  "id": ""
}, context)

Input

  • input object
    • id required string: The id of the resource.

Output

  • output object