Tags
Tags are your own labels for contacts: make, rename, or delete them, and tag or untag contacts in bulk. This page is generated from the OpenAPI document of release main-6976024, the one the API serves, so it lists only what the API has.
How to authenticate, where errors are explained, and the other resources are in the API reference.
Make a tag, or find the one with its name
POST /v1/tags
Answers the tag with this name, ignoring case: 201 if this request made it, 200 if the account had it. So a retry is safe.
Its API key needs contacts:write.
Request body
A application/json body.
| Field | What it is |
|---|---|
name (required) | text, up to 100 characters. |
Answers
- 200: The account already had it
- 201: Made
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
name (required) | text. |
contacts (required) | a whole number. How many contacts have it. |
created_at (required) | a date and time (RFC 3339). |
What a 201 answers
| Field | What it is |
|---|---|
id (required) | text. |
name (required) | text. |
contacts (required) | a whole number. How many contacts have it. |
created_at (required) | a date and time (RFC 3339). |
Rename a tag
PATCH /v1/tags/{tag_id}
Its contacts keep it.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
tag_id (required) | text, up to 64 characters, in the path. The tag’s id (tag_…). |
Request body
A application/json body.
| Field | What it is |
|---|---|
name (required) | text, up to 100 characters. |
Answers
- 200: The tag as it now is
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Tag not found (
tag_not_found)
- Tag not found (
- 409:
- Tag name already in use (
tag_name_taken)
- Tag name already in use (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
id (required) | text. |
name (required) | text. |
contacts (required) | a whole number. How many contacts have it. |
created_at (required) | a date and time (RFC 3339). |
Delete a tag
DELETE /v1/tags/{tag_id}
Takes it off every contact that has it. It can’t be undone, so it counts toward the account's contact-irreversible limit, its own, which unsubscribing a contact shares.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
tag_id (required) | text, up to 64 characters, in the path. The tag’s id (tag_…). |
Answers
- 204: Deleted
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Tag not found (
tag_not_found)
- Tag not found (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
Tag contacts
POST /v1/tags/{tag_id}/contacts
Gives the tag to each contact named; one that has it already is left as it is. All or none.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
tag_id (required) | text, up to 64 characters, in the path. The tag’s id (tag_…). |
Request body
A application/json body.
| Field | What it is |
|---|---|
contact_ids (required) | a list of up to 1,000, each text. The contacts (ct_…), at most 1000. |
Answers
- 200: Tagged
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Tag not found (
tag_not_found) - Contact not found (
contact_not_found)
- Tag not found (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
tagged (required) | a whole number. How many didn’t have it before. |
Untag contacts
POST /v1/tags/{tag_id}/contacts/remove
Takes the tag off each contact named; one without it is left as it is.
Its API key needs contacts:write.
Parameters
| Parameter | What it is |
|---|---|
tag_id (required) | text, up to 64 characters, in the path. The tag’s id (tag_…). |
Request body
A application/json body.
| Field | What it is |
|---|---|
contact_ids (required) | a list of up to 1,000, each text. The contacts (ct_…), at most 1000. |
Answers
- 200: Untagged
- 400:
- Malformed request (
malformed_request)
- Malformed request (
- 401:
- API key missing (
api_key_missing) - Invalid API key (
api_key_invalid) - API key revoked (
api_key_revoked) - API key expired (
api_key_expired)
- API key missing (
- 403:
- Account closed (
account_closed) - Missing scope (
api_key_scope_missing) - Test keys can't do this (
test_key_not_allowed)
- Account closed (
- 404:
- Tag not found (
tag_not_found)
- Tag not found (
- 413:
- Request body too large (
payload_too_large)
- Request body too large (
- 415:
- Unsupported media type (
unsupported_media_type)
- Unsupported media type (
- 422:
- Validation failed (
validation_failed)
- Validation failed (
- 429:
- Too many requests (
rate_limited)
- Too many requests (
- 500:
- Internal error (
internal)
- Internal error (
- 503:
- API keys unavailable (
api_keys_unavailable) - Contacts unavailable (
contacts_unavailable)
- API keys unavailable (
What a 200 answers
| Field | What it is |
|---|---|
untagged (required) | a whole number. How many had it. |