OrgCommunicationsBackfill

Import mail history from a connected mailbox

Reads back through a connected mailbox and files the correspondence that belongs to a district. A message is kept when the person is already a contact, is in the corpus, or writes from a domain that belongs to exactly one district; anyone new is created as a contact and recorded against the org. Everything else is left alone. Idempotent — a second sweep over the same window writes nothing.

POST
/org/communications/backfill

Reads back through a connected mailbox and files the correspondence that belongs to a district. A message is kept when the person is already a contact, is in the corpus, or writes from a domain that belongs to exactly one district; anyone new is created as a contact and recorded against the org. Everything else is left alone. Idempotent — a second sweep over the same window writes nothing.

AuthorizationBearer <token>

API key (sk_live_... prefix). Generate keys in the UI under Settings > API Keys, then send it as Authorization: Bearer sk_live_...

In: header

Request Body

application/json

months?integer

How far back to read. Defaults to 12.

Range1 <= value <= 60
mailbox_account_id?string

One mailbox, when several are connected.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
max_messages?integer

Ceiling on messages examined. Defaults to 5000.

Range1 <= value <= 50000

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/org/communications/backfill" \  -H "Content-Type: application/json" \  -d '{}'
{
  "data": {
    "accounts": -9007199254740991,
    "scanned": -9007199254740991,
    "imported": -9007199254740991,
    "skipped": -9007199254740991,
    "peopleAdded": -9007199254740991,
    "entitiesTouched": -9007199254740991,
    "truncated": true,
    "errors": [
      "string"
    ]
  }
}
{
  "error": "string",
  "message": "string",
  "statusCode": -9007199254740991
}
{
  "error": "string",
  "message": "string",
  "statusCode": -9007199254740991
}
{
  "error": "module_required",
  "module": "string",
  "message": "string",
  "contact": "string"
}