The metadata field’s shape depends on the bulk action’s type. Most types accept an ids list of the objects to act on; some require additional fields, documented below.
Selecting which objects to act on
The ids field accepts a few different forms:
- Specific objects — a list of object IDs, e.g.
["sub_abc123", "sub_def456"]. - Everything —
["all"]selects every object of the relevant type in your newsletter. You can narrow this with aparametersfield that mirrors the filters on the matching list endpoint (for example,{"status": ["draft"]}when acting on emails). - Everything except — prefix each ID with
-(e.g.["-sub_abc123"]) to act on all objects except those listed. Don’t mix negative and positive IDs in the same request.
A few rules apply across all types:
- You can act on at most 200 explicitly-listed IDs per request; more returns a
400with the codemax_bulk_actions_exceeded. (The["all"]form has no such limit.) - An invalid or malformed ID returns a
400with the codebulk_action_invalid_ids. - For most types, omitting
ids(or sending an empty list) acts on every object of the relevant type — it’s equivalent to["all"]. Because that makes an accidental delete-everything easy,delete_emailsanddelete_subscribersrequire a non-emptyids; a missing or empty list returns a400with the codebulk_action_invalid_ids. To delete everything intentionally, pass["all"]explicitly. send_emailsandsend_remindersrequire an active newsletter; calling them while your newsletter is disabled returns a403with the codeforbidden.
add_notes
Attaches a note to subscribers in bulk. The metadata field takes:
body— the note’s text. Required; omitting it, or passing an empty/whitespace-only or non-string value, returns a400with the codebulk_action_invalid_metadata.metadata— optional key-value pairs to attach to each note.ids— the subscribers to act on.
apply_metadata
Adds, sets, or removes subscriber metadata in bulk. The metadata field takes three pieces:
action— one ofset,add, orremove:setreplaces each subscriber’s entire metadata object with the payload.addmerges the payload into each subscriber’s existing metadata, overwriting only the keys you provide.removedeletes the keys you provide (here, the innermetadatais a list of key names rather than an object).
metadata— the key-value pairs to apply (or, forremove, the list of keys to delete).ids— the subscribers to act on.
Note the two nested metadata keys: the outer one is the bulk action’s parameters, and the inner one is the data being applied. Omitting action or the inner metadata, or passing an action other than set/add/remove, returns a 400 with the code bulk_action_invalid_metadata.
apply_tags
Adds or removes tags on subscribers. The metadata field takes:
tag_ids(a list) ortag_id(a single ID) — the tags to apply. One of the two is required; omitting both returns a400with the codebulk_action_invalid_ids.action—addorremove. Optional; defaults toadd.ids— the subscribers to act on.
change_tags_colors
Changes the display color of tags. The metadata field takes:
color— the new color, as a hex string. Required; omitting it returns a400with the codebulk_action_invalid_ids.ids— the tags to recolor.
modify_stripe_subscriptions
Moves paid subscribers onto a different Stripe price. The metadata field takes:
price_id— the target Stripe price. It must exist on your connected Stripe account and reference a recurring price; a missing, unrecognized, or one-time price returns a400with the codebulk_action_invalid_price.ids— the subscribers to act on.
rename_metadata
Renames subscriber metadata keys without touching their values. The metadata field takes:
rename_mapping— an object mapping old key names to new ones, e.g.{"name": "first_name"}. Required; omitting it returns a400with the codebulk_action_missing_rename_mapping.ids— the subscribers to act on.