Apply a tag to matching contacts
POST
/api/v3/contacts/tags/{tagId}/apply
const url = 'https://api.tryletterhead.com/api/v3/contacts/tags/1/apply';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api":true,"channelId":42,"status":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/contacts/tags/1/apply \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api": true, "channelId": 42, "status": 1 }'Applies the tag to every contact matching the supplied filter β the same filter shape as Search contacts (query, tags, channelId, status). Omit all filters to apply the tag to your entire audience.
Authorizations
Section titled βAuthorizations βParameters
Section titled β Parameters βPath Parameters
Section titled βPath Parameters β tagId
required
integer
The tagβs numeric identifier.
Request Body required
Section titled βRequest Body required β Media type application/json
object
api
Required. Set to true to authenticate with an API key.
boolean
query
string
tags
Array<string>
channelId
integer
status
integer
Example
{ "api": true, "channelId": 42, "status": 1}Responses
Section titled β Responses β200 OK
Media type application/json
object
items
object
matched
Contacts matching the filter.
integer
updated
Contacts the tag was actually added to (matched minus contacts that already carried it).
integer
message
string
total
integer
Example
{ "items": { "matched": 1204, "updated": 980 }, "message": "Tag applied.", "total": 1}Still can’t find what you need? Contact support.