file_url | string | No | - | UTF-8 CSV/TXT customer list, up to 500,000,000 bytes. CSV requires identifier headers: email, phone_number, email_sha256, phone_number_sha256, or gaid; TXT is one identifier per line without a header. Accepts direct URLs, Google Drive share links with sharing set to ‘Anyone with the link’, or files uploaded through Markifact. Uploaded automatically. Use this or file_id, not both. |
file_id | string | No | - | Previously uploaded custom-audience file ID. Use promptly. For create, also supply filename, mimetype, and file_size. Use this or file_url, not both. |
filename | string | No | - | Original .csv or .txt filename. Required with file_id on create; optional override with file_url, useful for Drive links. |
mimetype | string | No | - | File MIME type, normally text/csv or text/plain. Required with file_id on create; detected for file_url. |
file_size | integer | No | - | Exact uploaded file size in bytes. Required with file_id on create; measured automatically for file_url. |
identifier_type | enum (email, phone, email_sha256, phone_number_sha256, gaid) | No | - | Single-column file type: email (API default), phone, email_sha256, phone_number_sha256, or gaid. Phones use E.164 including +. For SHA-256, hash UTF-8 with no trailing newline: trim/lowercase emails, or normalize phones to E.164; send hexadecimal, not Base64. Do not strip email dots/plus tags. GAIDs must be raw, not hashed. |
identifier_resolution | enum (auto) | No | - | Use auto for a CSV containing multiple identifier columns. Omit for a single identifier type or an empty audience. |
audience_id | string | Yes | - | Custom audience to update. |
action | enum (add, remove, replace) | Yes | - | add/remove change only supplied members. replace swaps the whole membership from a file while keeping the audience ID. |
identifiers | array of AudienceIdentifier or string | No | - | Inline add/remove entries or a JSON array, e.g. [{“identifier_type”:“email”,“identifier”:“customer@example.com”}]. Each entry carries its own type; use inline identifiers or a file, not both. Requests must fit 16 MiB; prefer files for bulk updates. |
expected_revision | integer | No | - | Current membership_revision from get_custom_audience. Required for replace; optional for add/remove. Retrieve again after a completed change. |
idempotency_key | string | Yes | - | Unique key for this change. Save it with the original request; reuse only for retrying the identical action, audience, data, and revision. A replay may return the original operation without checking a changed body. |