Skip to content

API reference/email

Change one or more rules of the sending policy

PUT/api/v1/email/policy

authentication
Secret API key as a bearer token
billing
Free.

Names only the rules that change; the rest stay as they were, and the change applies to the account's next lookup. max_risk_score: null ignores the score, block_signals: [] blocks on no signal. A body naming none of the three rules is refused with a 422 keyed policy, because that is the shape a misspelled key takes.

Request body

field type description
max_risk_scoreinteger | nullBlock when risk_score is above this; null ignores the score.
block_signalsstring[] | nullSignals that block whenever they fire, whatever the score.
min_mailbox_confidenceinteger | nullBlock an unconfirmed mailbox whose mailbox_confidence is below this; null ignores it.

Example request

curl -X PUT https://spaw.co/api/v1/email/policy \
  -H "Authorization: Bearer sk_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "max_risk_score": 40,
  "block_signals": [
    "disposable",
    "likely_typo",
    "parked_domain",
    "mx_blocklisted",
    "no_reply",
    "catch_all"
  ]
}'
const response = await fetch('https://spaw.co/api/v1/email/policy', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer sk_live_…',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "max_risk_score": 40,
    "block_signals": [
      "disposable",
      "likely_typo",
      "parked_domain",
      "mx_blocklisted",
      "no_reply",
      "catch_all"
    ]
  }),
});
const result = await response.json();
import requests

response = requests.put(
    'https://spaw.co/api/v1/email/policy',
    headers={'Authorization': 'Bearer sk_live_…'},
    json={
        'max_risk_score': 40,
        'block_signals': [
            'disposable',
            'likely_typo',
            'parked_domain',
            'mx_blocklisted',
            'no_reply',
            'catch_all'
        ]
    },
)
result = response.json()
$ch = curl_init('https://spaw.co/api/v1/email/policy');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer sk_live_…', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => json_encode([
        'max_risk_score' => 40,
        'block_signals' => [
            'disposable',
            'likely_typo',
            'parked_domain',
            'mx_blocklisted',
            'no_reply',
            'catch_all'
        ]
    ]),
]);
$result = json_decode(curl_exec($ch), true);
from spaw import Client

client = Client('sk_live_…')
result = client.update_email_policy(max_risk_score=40, block_signals=[
    'disposable',
    'likely_typo',
    'parked_domain',
    'mx_blocklisted',
    'no_reply',
    'catch_all'
])
import Spaw from 'spaw';

const spaw = new Spaw({ apiKey: 'sk_live_…' });
const result = await spaw.updateEmailPolicy({
    maxRiskScore: 40,
    blockSignals: [
        'disposable',
        'likely_typo',
        'parked_domain',
        'mx_blocklisted',
        'no_reply',
        'catch_all'
    ]
});
use Spaw\Client;

$spaw = new Client('sk_live_…');
$result = $spaw->updateEmailPolicy([
    'max_risk_score' => 40,
    'block_signals' => [
        'disposable',
        'likely_typo',
        'parked_domain',
        'mx_blocklisted',
        'no_reply',
        'catch_all'
    ]
]);

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

200The policy now in force.

Error codes

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

markdown version·openapi.json