Skip to content

API reference/phone

Remove numbers from the phone suppression list

DELETE/api/v1/phone/suppressions

authentication
Secret API key as a bearer token
billing
Free.

Removes up to 1,000 numbers per request by the number itself, for a caller that knows the number but not the id it was filed under. Each value is read to E.164 first, against country when it carries no calling code, so 07911 012345 with country: "GB" removes the entry filed as +447911012345.

The answer names every number it was given, spelled the way you sent it: removed are the ones that were on the list and no longer are, not_found the ones that were not on it — including a number that is not a valid subscriber number, and one that is on another account's list.

The cap is 1,000 rather than the import's 10,000 because the answer names every value back: a request over the cap is a 422 and removes nothing. Removing an entry means the number is looked up fresh the next time a batch, bulk or monitor run meets it.

Request body

field type description
valuesrequiredstring[]1 to 1,000 numbers, each in any notation.
countrystring | nullThe region values written without a calling code are read against.

Example request

curl -X DELETE https://spaw.co/api/v1/phone/suppressions \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "values": [
    "07911 012345",
    "+14152010142"
  ],
  "country": "GB"
}'
const response = await fetch('https://spaw.co/api/v1/phone/suppressions', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer sk_live_…',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "values": [
      "07911 012345",
      "+14152010142"
    ],
    "country": "GB"
  }),
});
const result = await response.json();
import requests

response = requests.delete(
    'https://spaw.co/api/v1/phone/suppressions',
    headers={'Authorization': 'Bearer sk_live_…'},
    json={
        'values': [
            '07911 012345',
            '+14152010142'
        ],
        'country': 'GB'
    },
)
result = response.json()
$ch = curl_init('https://spaw.co/api/v1/phone/suppressions');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer sk_live_…', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'values' => [
            '07911 012345',
            '+14152010142'
        ],
        'country' => 'GB'
    ]),
]);
$result = json_decode(curl_exec($ch), true);
from spaw import Client

client = Client('sk_live_…')
result = client.remove_phone_suppressions([
    '07911 012345',
    '+14152010142'
], country='GB')
import Spaw from 'spaw';

const spaw = new Spaw({ apiKey: 'sk_live_…' });
const result = await spaw.removePhoneSuppressions([
    '07911 012345',
    '+14152010142'
], {
    country: 'GB'
});
use Spaw\Client;

$spaw = new Client('sk_live_…');
$result = $spaw->removePhoneSuppressions([
    '07911 012345',
    '+14152010142'
], country: 'GB');

This endpoint has no console on its page. It writes to your account. A documentation page can show you the request; making the change is for the dashboard or for a call you make yourself.

Responses

200Which of the numbers were on the list and which were not.

{
    "success": true,
    "data": {
        "removed": [
            "07911 012345"
        ],
        "not_found": [
            "+14152010142"
        ]
    }
}

401The key is missing, malformed, or revoked.

{
    "success": false,
    "error": {
        "code": "UNAUTHENTICATED",
        "message": "Provide a valid API key as a bearer token.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

422The request body could not be validated; `error.errors` lists the fields.

{
    "success": false,
    "error": {
        "code": "VALIDATION_FAILED",
        "message": "The email field is required.",
        "errors": {
            "email": [
                "The email field is required."
            ]
        },
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

429Over 5 requests per second for the key. Retry after the limit resets.

{
    "success": false,
    "error": {
        "code": "RATE_LIMITED",
        "message": "Too many requests. Retry after the limit resets.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

Error codes

Failures answer { success: false, error: { code, message, request_id } }. Each code has its own page.

markdown version·openapi.json