Guides

Neighborhood Mail over the API

Send the addresses to mail around, and get the homes found and mailed for each one.

How it works

On a Neighborhood Mail campaign, each address you send is a center, not a recipient: the center itself is never mailed. Inside the request, we find the homes within the campaign's radius around each center, apply the campaign's filters, fit them to its budget, and mail them, except on a campaign with property filters, where homes are found after the response.

  • Send centers to POST /api/v1/recipients with your Full access key, exactly as you would send recipients. See the Dynamic Audience API reference.
  • The custom fields you send with a center apply to every home around it.
  • Each center's result reports homesFound (the homes within the radius) and homesMailed (the homes mailed), except a homes_pending center (below).
  • A center with no homes within the radius comes back not_mailed with no_homes_found.
  • When the budget or the request's home limit stops part of a center's homes, the center is still mailed, and its detail says how many of the homes found were mailed and why the rest were not. When neither leaves room for any of its homes, it comes back not_mailed with budget_exceeded or request_capacity_reached.
  • On a campaign with property filters, homes are found after the response: each center comes back not_mailed with homes_pending, and its homes show in the campaign's Recipients received list once they are mailed.
  • On a campaign with property filters, a new center comes back not_mailed with budget_exceeded while the campaign's remaining budget cannot cover one home, and with request_capacity_reached while the campaign already holds as many centers whose homes are still being found as it can.
curl https://www.postaged.com/api/v1/recipients \
  -H "Authorization: Bearer $POSTAGED_SEND_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "campaign_id": "PA-4H2K9C",
    "recipients": [
      {
        "reference": "listing-118",
        "address_1": "118 Maple Ave",
        "city": "West Hartford",
        "state": "CT",
        "zip": "06107"
      },
      {
        "reference": "listing-204",
        "address_1": "204 Ridge Rd",
        "city": "Avon",
        "state": "CT",
        "zip": "06001"
      }
    ]
  }'
Response200 OK
{
  "summary": { "received": 2, "mailed": 1, "notMailed": 1 },
  "results": [
    {
      "reference": "listing-118",
      "address": "118 Maple Ave, West Hartford, CT 06107-2614",
      "status": "mailed",
      "homesFound": 42,
      "homesMailed": 42,
      "detail": "42 homes around this address."
    },
    {
      "reference": "listing-204",
      "address": "204 Ridge Rd, Avon, CT 06001-3901",
      "status": "not_mailed",
      "reason": "no_homes_found",
      "detail": "No homes inside the radius around this address."
    }
  ]
}

Limits

  • 250 centers per request.
  • 10,000 homes mailed per request. Homes past that limit are not mailed in this request: send their centers again in another request.
  • On a campaign with property filters, no home is mailed in the request, so the homes limit does not apply. Instead, a campaign can hold a limited number of centers whose homes are still being found at one time: send a center refused with request_capacity_reached again once the homes around earlier centers have been found.
  • Every other Dynamic Audience API limit applies, including 4.25 MB per request body and 60 requests per minute per API key. See Rate limits.

Check before you send

Which homes are found depends on the address data for the area you mail. Run a payload through Send test request in the campaign's API / Webhook setup first: a test reports the homes found around each center, and never mails or charges. See Testing.

On a campaign with property filters, a test reports about how many homes match around each center, from a free count, and buys nothing.