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

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

ParameterTypeDescriptionRequiredDefault
namestringTag name (1-100 characters)✓—
criteriastringCriteria or description for when to apply the tag (max 500 characters)—""
automaticbooleanWhether the AI should apply the tag automatically to conversations—false
ownersarrayList of responsible-user emails—[]

Response

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

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTname 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
400INVALID_REQUESTAn email in owners does not belong to a member of the workspace. details.message says which ones
400INVALID_REQUESTYour 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
401UNAUTHENTICATEDThe credential is missing or invalid
403FORBIDDENThe 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

  • 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