Skip to content
QwryAI
Documentation
Pages

Endpoints

Update a contact

Add or remove a contact's tags with the update_contact_tags tool

API v1's contact update has no full equivalent: through the API you can change a contact's tags, not their name, email, phone or custom attributes. Change tags with the Tools API's update_contact_tags tool, as on the Contacts page. Tags drive saved segments and Outbound audiences. The change returns a review, and nothing changes until you apply it.

POSThttps://api.qwryai.com/public/v1/tools/update_contact_tags

Authentication

Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Manage conversations and helpdesk. See Authentication.

Body parameters

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
contactobjectYesThe contact, named by exactly one of contact_id, email, phone (international format, such as +14155550123) or external_id (the id your own system gave them).
addarrayNoTags to add, up to 20, each 1 to 50 characters.
removearrayNoTags to remove, up to 20. Matched without regard to case.

Send at least one tag in add or remove.

Request example

Bash
curl -X POST 'https://api.qwryai.com/public/v1/tools/update_contact_tags' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "chatbotId": "YOUR_AGENT_ID",
    "contact": { "email": "sam.tester@example.com" },
    "add": ["vip"],
    "remove": ["trial"]
  }'

Response

JSON
{
  "success": true,
  "data": {
    "status": "review_required",
    "reviewId": "4c8e2a1f-7b3d-4e9a-a6f5-0b1c2d3e4f50",
    "tool": "update_contact_tags",
    "changes": [
      {
        "title": "Change tags of Sam Tester",
        "before": { "tags": ["trial", "newsletter"] },
        "after": { "tags": ["newsletter", "vip"] }
      }
    ],
    "unchanged": [],
    "expiresAt": "2026-12-01T10:15:00.000Z",
    "next": "Show these changes to the user. Call apply_change with this reviewId only after they approve; the review expires in 15 minutes."
  }
}

Apply it with POST https://api.qwryai.com/public/v1/reviews/{reviewId}/apply within 15 minutes. To edit a contact's other details, open them on the Contacts page; see Contacts.

Errors

HTTP statuscodeWhen
400INVALID_ARGUMENTScontact names none or more than one field, no tags were given, no contact matches, or the contact already has these tags.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Manage conversations and helpdesk.
409STALE_REVIEWOn apply: the contact's tags changed after the review. Call the tool again.

See Error Handling for authentication and rate-limit errors.

Explore the documentation