Documentation
Sign inGet started

bird contacts batch

Usage

Przykład kodu
bird contacts batch [flags]

Description

Create or update many contacts in one request, matched by the identifiers each entry carries
Bulk upsert takes a JSON body. Pass --body-file with a "contacts" array (each entry the same shape as create) and an optional "audience_ids" array that every contact is added to. Each entry is matched automatically against every identifier it supplies (email, phone_number, external_id): no match creates a contact, one match updates it, and identifiers that belong to two different contacts fail that entry alone. Pass --match-on (or "match_on" in the body) to force one key instead, which every entry must then carry. Up to 1,000 contacts per request; per-contact results come back in submission order.
Build the request from flags, a JSON ContactUpsertRequest body via --body-file ("-" reads stdin), or both — a flag overrides the matching body field. Run --example to print a ready-to-edit body, or --dry-run to print the resolved request without sending it.

Examples

Przykład kodu
# print the body shape (no credentials needed)
bird contacts batch --example

# the body it prints:
Przykład kodu
{
  "audience_ids": ["adn_01krdgeqcxet5s7t44vh8rt9mg"],
  "contacts": [
    {
      "email": "alice@acme.com",
      "first_name": "Alice",
      "last_name": "Anderson"
    },
    {
      "email": "bob@acme.com",
      "first_name": "Bob",
      "last_name": "Baker"
    }
  ]
}
Przykład kodu
# upsert contacts from a file
bird contacts batch --body-file contacts.json

# force matching by your own identifier
bird contacts batch --body-file contacts.json --match-on external_id

# preview the resolved request without sending
bird contacts batch --body-file contacts.json --dry-run

Options

Matching

NameDescription
--match-onForce every entry to match existing contacts by this one field: email, phone_number, or external_id. Omit to match each entry automatically on every identifier it carries

Request

NameDescription
--body-fileRead the JSON request body from this file; "-" reads stdin
--examplePrint a complete example request body, then exit
--dry-runPrint the resolved request without sending it, then exit
--idempotency-keyDeduplication key; a retry with the same key won't act twice

Options

NameDescription
--response-schemaPrint the fields this command returns, then exit
NameDescription
bird contacts createCreate a contact by email address, phone number, or both
bird contacts deleteDelete a contact
bird contacts getGet a contact
bird contacts listList contacts
bird contacts updateUpdate a contact's name, email, phone-number, external-id, or custom data