---
docId: doc_e141cf9f10b64ae09b2e1e3c77f302db
title: Update a tag
description: "Updates the tag fields you send."
api:
  group: etiquetas
  auth: bearer
  operations:
    - operationId: updateTag
      method: PATCH
      path: '/v1/tags/{tagId}'
      postmanName: Update a tag
---

<script>
  import { Ways } from '$lib/components';
</script>

# Update a tag

Change a tag’s criteria, automatic application or owners. Send only the fields you want to update; other fields keep their values.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X PATCH https://api.platic.ai/v1/tags/$TAG_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "automatic": true }'
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.tags.update("tag_123", { automatic: true });
```

</Ways.Way>
</Ways>

If your credential covers several workspaces, add `?workspace=<id>` to say which one you work in ([list workspaces](/api-reference/workspaces)); without it the answer is `400`. A single-workspace credential never needs it.

## URL parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|-----------|
| `tagId` | string | Unique identifier of the tag | ✓ |

## Request body

```json
{
  "criteria": "Apply this tag to customers with an active premium membership.",
  "automatic": true,
  "owners": ["support@acme.com"]
}
```

## Body parameters

All parameters are optional. Only the fields included in the request are updated.

| Parameter | Type | Description |
|-----------|------|-------------|
| `criteria` | string | Criteria or description for when to apply the tag (max 500 characters) |
| `automatic` | boolean | Whether the AI should apply the tag automatically to conversations |
| `owners` | array | List of responsible-user emails |

## Response

```json
{
  "status": "success",
  "message": "Tag updated successfully",
  "data": {
    "id": "tag_abc123"
  }
}
```

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | `criteria` is longer than 500 characters or an item in `owners` is not an email. `details.issues` says which field |
| `400` | `INVALID_REQUEST` | An email in `owners` does not belong to a member of the workspace. `details.message` says which ones |
| `400` | `INVALID_REQUEST` | Your credential covers several workspaces and you did not send `?workspace=`, or you sent one it does not cover. `details.available` lists the ones you can use |
| `401` | `UNAUTHENTICATED` | The credential is missing or invalid |
| `403` | `FORBIDDEN` | The credential does not have the Contacts module (`Missing contacts permission`), or it is an OAuth token without the `platica:write` scope |
| `404` | `TAG_NOT_FOUND` | The tag does not exist in the workspace or was deleted |

```json
{
  "code": 404,
  "error": "Not Found - The resource doesn't exist",
  "details": {
    "code": "TAG_NOT_FOUND",
    "message": "Tag tag_abc123 not found in this workspace"
  }
}
```

The general error format is in [Errors](/api-reference/errors).

## Notes

- `owners` must be sent as valid emails of users in the workspace
