Skip to content

Tag or untag contacts

POST
/organizations/{organizationId}/tags/{tagId}/contacts
curl --request POST \
--url https://api.sendwing.app/api/organizations/example/tags/example/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "add": [ "example" ], "remove": [ "example" ] }'

Adds the tag to contacts and removes it from others, by ID, up to 1000 at a time. Adding a tag a contact has, or removing one it doesn’t, changes nothing.

organizationId
required
string

The workspace, like org_…. An OAuth access token works in the one the member picked when connecting, which GET /me returns.

tagId
required
string

Like tag_…

Media typeapplication/json
object
add

Contacts to tag, by ID

Array<string>
<= 1000 items
remove

Contacts to untag, by ID

Array<string>
<= 1000 items

Example generated

{
"add": [
"example"
],
"remove": [
"example"
]
}

What changed

Media typeapplication/json
object
added
required

Contacts tagged by this request

integer
>= -9007199254740991 <= 9007199254740991
removed
required

Contacts untagged by this request

integer
>= -9007199254740991 <= 9007199254740991
notFound
required

IDs that aren’t contacts in this workspace

Array<string>

Example generated

{
"added": 1,
"removed": 1,
"notFound": [
"example"
]
}

The request isn’t valid; issues lists each problem

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

The API key or access token is missing, invalid or expired

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

The API key’s permissions, or the app’s scopes and the member’s role, don’t allow this

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Not found in this workspace

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}

Too many requests; wait for the seconds in Retry-After

Media typeapplication/json
object
error
required

What went wrong, in words you can show people

string
issues

For a 400: each invalid field, by its path in the request, like events.0.name

Array<object>
object
path
required
string
message
required
string
requestId

For a 5xx: quote it when contacting support

string

Example generated

{
"error": "example",
"issues": [
{
"path": "example",
"message": "example"
}
],
"requestId": "example"
}