# renameContactTag

Rename a FREE-FORM contact tag in place (tagId from searchContactTags `tags`). THIS IS THE CORRECT WAY TO FIX A TAG NAME: deleteContactTags plus createContactTag is irreversible and drops the tag off every contact, while a rename keeps the id, so every contact, saved filter and workflow referencing it still points at it. Applied synchronously; returns the org tag catalog with the new name. FREE-FORM TAGS ONLY: a LIST id is refused (renameContactList) and so is a custom-field id (updateContactCustomField). Names are unique in the organization, case- and whitespace-insensitively, so renaming onto an existing tag's name, or the tag's own current name, is rejected, as is a name a custom field holds. A rename does not merge tags: to consolidate, tag the contacts with the survivor first, then delete the loser.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "renameContactTag", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `tagId`: `ID!` (required)
- `newName`: `String!` (required)

## Response (data, an example)

```json
{
  "contactMutation": {
    "renameFreeFormTag": {
      "contactTags": [
        {
          "id": "<ID>",
          "name": "…"
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "renameContactTag",
    "variables": {
      "tagId": "<tagId>",
      "newName": "<String>"
    }
  }'
```
