Create a tag
SDK platic.tags.create()
Create a tag to organize contacts and conversations. Send name; to let AI apply it, define criteria and enable automatic.
Example
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" }' await platic.tags.create({ name: "vip", criteria: "Bought more than three times" }); If your credential covers several workspaces, add ?workspace=<id> to say which one you work in (list workspaces); without it the answer is 400. A single-workspace credential never needs it.
Request body
{
"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
{
"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 |
{
"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.
Notes
ownersmust be sent as valid emails of users belonging to the workspace- If
automaticistrue, the AI applies the tag automatically to conversations based on the definedcriteria