Skip to main content
POST
/
support
/
tags
curl -X POST "https://worker.thenewscc.com/support/tags" \
  -H "Authorization: Bearer seu_token_jwt" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Urgente",
    "color": "#FF0000"
  }'
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Urgente",
    "color": "#FF0000",
    "isDefault": false,
    "createdAt": "2024-03-20T10:00:00Z",
    "updatedAt": "2024-03-20T10:00:00Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.thenewscc.com.br/llms.txt

Use this file to discover all available pages before exploring further.

Descrição

Cria uma nova tag de suporte para categorização de tickets. Requer autenticação.

Headers

Authorization
string
required
Bearer token JWT para autenticação
Content-Type
string
required
application/json

Body Parameters

name
string
required
Nome da tag (deve ser único no sistema)
color
string
required
Cor em formato hexadecimal (ex: #FF0000, #00FF00)
isDefault
boolean
default:"false"
Define se esta é a tag padrão. Apenas uma tag pode ser padrão por vez - ao definir uma nova tag como padrão, a anterior é automaticamente desativada.

Response

success
boolean
required
Indica se a operação foi bem-sucedida
data
object

Regras de Negócio

Tag Padrão Única: Apenas uma tag pode ter isDefault = true. Quando uma nova tag é marcada como padrão, todas as outras são automaticamente desativadas.
Nomes Únicos: O campo name possui constraint de unicidade no banco de dados. Tentar criar uma tag com nome existente resultará em erro.
curl -X POST "https://worker.thenewscc.com/support/tags" \
  -H "Authorization: Bearer seu_token_jwt" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Urgente",
    "color": "#FF0000"
  }'
{
  "success": true,
  "data": {
    "id": 1,
    "name": "Urgente",
    "color": "#FF0000",
    "isDefault": false,
    "createdAt": "2024-03-20T10:00:00Z",
    "updatedAt": "2024-03-20T10:00:00Z"
  }
}