Skip to contentSkip to navigationSkip to topbar
On this page

Deactivations Resource


This resource retrieves a list of United States phone numbers that have been deactivated by mobile carriers. These phone numbers are no longer in service for the subscriber who used to own that number. Twilio updates the set of available reports daily.

These reports should be used periodically to remove deactivated phone numbers from your opted-in subscriber list. For more information how to use these reports, see the "Handling Deactivated Phone Numbers" Help Center article(link takes you to an external page).

API requests to the Deactivations Resource are free of charge.


Deactivation Properties

deactivation-properties page anchor
Property nameTypeRequiredDescriptionChild properties
redirect_tostring<uri>

Optional

Not PII

Returns an authenticated url that redirects to a file containing the deactivated numbers for the requested day. This url is valid for up to two minutes.


Fetch a Deactivation resource

fetch-a-deactivation-resource page anchor
GET https://messaging.twilio.com/v1/Deactivations

Send a GET request to the Deactivations list resource to retrieve a list of deactivated numbers for a specific date.

You must include the Date parameter with a date value in YYYY-MM-DD format.

Twilio's response contains a redirect_to property with a signed URL for the requested date's deactivations list in .txt format.

Query parameters

query-parameters page anchor
Property nameTypeRequiredPIIDescription
Datestring<date>

Optional

The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format.

Fetch deactivations for August 13, 2023Link to code sample: Fetch deactivations for August 13, 2023
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchDeactivation() {
11
const deactivation = await client.messaging.v1
12
.deactivations()
13
.fetch({ date: "2023-08-13" });
14
15
console.log(deactivation.redirectTo);
16
}
17
18
fetchDeactivation();

Output

1
{
2
"redirect_to": "https://com-twilio-dev-messaging-deactivations.s3.amazonaws.com"
3
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.