Check out our upcoming events and meetups! View events →
Update the settings for a specific short code. To unbind a short code from a profile, set the messaging_profile_id to null or an empty string.
To add or update tags, include the tags field as an array of strings.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const shortCode = await client.shortCodes.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
messaging_profile_id: 'abc85f64-5717-4562-b3fc-2c9600000000',
});
console.log(shortCode.data);{
"data": {
"record_type": "short_code",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"short_code": "12345",
"country_code": "US",
"messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tags": [
"test_customer"
],
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z"
}
}Documentation Index
Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The id of the short code
Short code update
Successful response with details about a short code.
Show child attributes
{
"record_type": "short_code",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"short_code": "12345",
"country_code": "US",
"messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tags": ["test_customer"],
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z"
}
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const shortCode = await client.shortCodes.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
messaging_profile_id: 'abc85f64-5717-4562-b3fc-2c9600000000',
});
console.log(shortCode.data);{
"data": {
"record_type": "short_code",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"short_code": "12345",
"country_code": "US",
"messaging_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"tags": [
"test_customer"
],
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z"
}
}