---
docId: doc_3be825de6c1d42f4929d7a9264487b57
title: Create a tag
description: Create a new tag in your workspace.
api:
  group: etiquetas
  auth: bearer
  operations:
    - operationId: createTag
      method: POST
      path: /v1/tags
      postmanName: Create a tag
---

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

# Create a tag

Create a tag to organize contacts and conversations. Send `name`; to let AI apply it, define `criteria` and enable `automatic`.

## Example

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

```bash
curl https://api.platic.ai/v1/tags \
  -H "Authorization: Bearer $PLATIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "vip", "criteria": "Bought more than three times" }'
```

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

```ts
await platic.tags.create({ name: "vip", criteria: "Bought more than three times" });
```

</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.

## Request body

```json
{
  "name": "VIP",
  "criteria": "Apply this tag to customers with a high purchase volume.",
  "automatic": true,
  "owners": ["support@acme.com"]
}
```

## Body parameters

| Parameter | Type | Description | Required | Default |
|-----------|------|-------------|-----------|-------------------|
| `name` | string | Tag name (1-100 characters) | ✓ | — |
| `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 | — | `false` |
| `owners` | array | List of responsible-user emails | — | `[]` |

## Response

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

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `400` | `INVALID_REQUEST` | `name` is missing or longer than 100 characters, `criteria` is longer than 500, 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 |

```json
{
  "code": 400,
  "error": "Bad Request - The request has validation errors",
  "details": {
    "code": "INVALID_REQUEST",
    "message": "The following owner emails do not match any users in this workspace: luis@other-company.com"
  }
}
```

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

## Notes

- `owners` must be sent as valid emails of users belonging to the workspace
- If `automatic` is `true`, the AI applies the tag automatically to conversations based on the defined `criteria`
