Contact Tags


Tag a contact within one of its groups, or remove the tag. Tags sub-segment a group — e.g. VIP, Purchased, Webinar attendee inside Newsletter — and you can target them with audience filters or filter Contacts — LIST by tagId.

Tags belong to a group: a tag is defined on one group, and a contact carries it on their membership in that group. Tags themselves (create, rename, delete) are managed in your Textingline dashboard; the API assigns and unassigns them.

Endpoints

MethodPathPurpose
POST/api/v1/contacts/by-phone/{phoneNumber}/groups/{groupId}/tags/{tagId}Tag a contact
DELETE/api/v1/contacts/by-phone/{phoneNumber}/groups/{groupId}/tags/{tagId}Remove the tag
POST/api/v1/contacts/{contactId}/groups/{groupId}/tags/{tagId}Tag, by contact ID
DELETE/api/v1/contacts/{contactId}/groups/{groupId}/tags/{tagId}Remove, by contact ID

The contact is identified by its phone number (E.164) or its ID (con_*); groupId (grp_*) and tagId (tag_*) come from Groups — GET, whose tags array lists the group's tags. Both forms behave identically. One tag per call — to apply several tags, make one call per tag.

Before you tag

  • The contact must be an active member of the group. A contact who isn't in the group — or whose CONFIRM enrollment is still pending — gets 404 with code 33047. Tagging never adds the contact to the group; add them first, then tag.
  • The tag must belong to that group. A tag from another group (or an unknown tag) gets 404 with code 33046.

POST — Tag a contact

curl -X POST \
  https://platform.textingline.com/api/v1/contacts/by-phone/+18005551234/groups/grp_7L1uzUXqj3eJvAwHi/tags/tag_ClyOhUtpAJb4anDpxZt3Ov \
  -u "your_key_id:your_key_secret"

No request body.

DELETE — Remove the tag

curl -X DELETE \
  https://platform.textingline.com/api/v1/contacts/by-phone/+18005551234/groups/grp_7L1uzUXqj3eJvAwHi/tags/tag_ClyOhUtpAJb4anDpxZt3Ov \
  -u "your_key_id:your_key_secret"

Removing a tag leaves the contact in the group — only the tag goes.

Response

Both return 200 OK with the full contact projection after the change. The membership in groups[] lists the contact's tags in that group:

{
  "id": "con_7J424HdkdtYdQcFfd",
  "phoneNumber": "+18005551234",
  "groups": [
    {
      "id": "grp_7L1uzUXqj3eJvAwHi",
      "name": "VIP Customers",
      "optInAt": "2026-04-01T00:00:00.000Z",
      "tags": [
        {
          "id": "tag_ClyOhUtpAJb4anDpxZt3Ov",
          "name": "Purchased",
          "createdAt": "2025-08-01T00:00:00.000Z",
          "updatedAt": "2025-08-02T00:00:00.000Z"
        }
      ]
    }
  ]
}

Idempotency

Both calls are safe to retry. Tagging a contact that already has the tag, or removing a tag the contact doesn't have, is a no-op that returns the current contact state (still 200).

Limits

A contact can hold up to 10,000 tag assignments in total across all their groups. Beyond that, POST returns 400 with code 33048; remove tags to add new ones.

Rate limit

EndpointLimitWindow
POST / DELETE /api/v1/contacts/by-phone/{phoneNumber}/groups/{groupId}/tags/{tagId} (write)150 requests60 seconds

These writes share the contactApiWrite bucket with Contacts and Group Membership writes. See Rate Limits.

Common errors

CodeHTTPDescription
33003400Invalid phone number.
33034400Invalid grp_* / tag_* (or, on the by-ID routes, con_*) ID.
33048400The contact has reached the tag assignment limit.
33030404Contact not found.
33031404Group not found (or not owned by your account).
33046404Tag not found in that group.
33047404Contact is not an active member of the group. Add them to the group first.

When several apply, the first in this order is returned: contact, group, tag, membership, limit.

See Error Codes for the full reference.


Did this page help you?