import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const messagingOptouts = await client.messagingOptouts.list();
console.log(messagingOptouts.data);{
"data": [
{
"from": "<string>",
"to": "+E.164",
"messaging_profile_id": "<string>",
"keyword": "STOP",
"created_at": "2025-04-28 12:00:38.631252"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}Retrieve a list of opt-out blocks.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const messagingOptouts = await client.messagingOptouts.list();
console.log(messagingOptouts.data);{
"data": [
{
"from": "<string>",
"to": "+E.164",
"messaging_profile_id": "<string>",
"keyword": "STOP",
"created_at": "2025-04-28 12:00:38.631252"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
If receiving address (+E.164 formatted phone number) should be redacted
Consolidated filter parameter (deepObject style). Originally: filter[messaging_profile_id], filter[from]
Consolidated created_at parameter (deepObject style). Originally: created_at[gte], created_at[lte]
Successful response with opt-out list data
Show child attributes
Sending address (+E.164 formatted phone number, alphanumeric sender ID, or short code).
Receiving address (+E.164 formatted phone number or short code).
"+E.164"
Unique identifier for a messaging profile.
The keyword that triggered the opt-out.
"STOP"
The timestamp when the opt-out was created
"2025-04-28 12:00:38.631252"
Was this page helpful?