bird contacts batch
Usage
कोड उदाहरण
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
कोड उदाहरण
# print the body shape (no credentials needed)
bird contacts batch --example
# the body it prints:कोड उदाहरण
{
"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"
}
]
}कोड उदाहरण
# 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-runOptions
Matching
| Name | Description |
|---|---|
| --match-on | Force 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
| Name | Description |
|---|---|
| --body-file | Read the JSON request body from this file; "-" reads stdin |
| --example | Print a complete example request body, then exit |
| --dry-run | Print the resolved request without sending it, then exit |
| --idempotency-key | Deduplication key; a retry with the same key won't act twice |
Options
| Name | Description |
|---|---|
| --response-schema | Print the fields this command returns, then exit |
Related
| Name | Description |
|---|---|
| bird contacts create | Create a contact by email address, phone number, or both |
| bird contacts delete | Delete a contact |
| bird contacts get | Get a contact |
| bird contacts list | List contacts |
| bird contacts update | Update a contact's name, email, phone-number, external-id, or custom data |