Skip to contentSkip to navigation

Assign or Remove Tags Beta

Attach or detach tags on up to 1,000 resources.

POST /api/v1/tags/toggle

Requires an API key with the write scope.

Attaches (assign: true) or detaches (assign: false) up to 10 tags on up to 1,000 leads, campaigns or email accounts in one call. Every tag must be of the matching type: lead tags for lead, campaign tags for campaign, account tags for email_account. A warmup tag, a tag of another workspace or a tag of the wrong type returns 422 and nothing changes. Resource ids that are not in the workspace (or are deleted leads) do not fail the call: they are listed in notFound and the rest apply. Attaching a tag that is already on a resource changes nothing. For more than 1,000 leads use Bulk Tag Leads. An audit.tag.assigned or audit.tag.unassigned entry records the tags and the counts.

Request Body

tagIds string[] body required
1 to 10 tag ids.
resourceType string body required
lead, campaign or email_account.
resourceIds string[] body required
1 to 1,000 ids.
assign boolean body required
true attaches, false detaches.

Response

assigned (or unassigned) is how many tag and resource pairs changed, matched how many of the ids were found, notFound the ids that were not.

Errors

StatusDescription
401Missing, invalid, revoked or expired API key
403API key does not have the required scope: write
422A tag is not a tag of this type in the workspace, a list is empty, or more than 1,000 resource ids were sent

Rate Limit

  • 120 requests per minute, shared by every write call in your workspace. Fixed 60-second window.
  • Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (unix epoch seconds) and X-RateLimit-Bucket (write).
  • A 429 response includes a Retry-After header (seconds until the bucket resets).

For client-side patterns, see Rate Limiting.

Was this page helpful?