Skip to main content
POST
/
texml
/
calls
/
{call_sid}
/
update
JavaScript
import Telnyx from 'telnyx';

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

const call = await client.texml.calls.update('call_sid');

console.log(call.data);
{
  "data": {
    "sid": "c46e06d7-b78f-4b13-96b6-c576af9640ff",
    "status": "accepted"
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

call_sid
string
required

The CallSid that identifies the call to update.

Body

application/json

Update Call request object

Status
string

The value to set the call status to. Setting the status to completed ends the call.

Example:

"completed"

Url
string

The URL where TeXML will make a request to retrieve a new set of TeXML instructions to continue the call flow.

Example:

"https://www.example.com/intruction-b.xml"

Method
enum<string>

HTTP request type used for Url.

Available options:
GET,
POST
Example:

"GET"

FallbackUrl
string

A failover URL for which Telnyx will retrieve the TeXML call instructions if the Url is not responding.

Example:

"https://www.example.com/intruction-c.xml"

FallbackMethod
enum<string>

HTTP request type used for FallbackUrl.

Available options:
GET,
POST
Example:

"GET"

StatusCallback
string

URL destination for Telnyx to send status callback events to for the call.

Example:

"https://www.example.com/callback"

StatusCallbackMethod
enum<string>

HTTP request type used for StatusCallback.

Available options:
GET,
POST
Example:

"GET"

Texml
string

TeXML to replace the current one with.

Example:

"<?xml version=\"1.0\" encoding=\"UTF-8\"?><Response><Say>Hello</Say></Response>"

Response

200 - application/json

Successful response upon updating a TeXML call.

data
TeXml REST Update Command Result · object
Example:
{
"sid": "c46e06d7-b78f-4b13-96b6-c576af9640ff",
"status": "accepted"
}