Pular para o conteúdo principal

Tags

Gerenciamento de tags para organização de versões no Decision Engine.

Endpoints

MétodoEndpointDescriçãoPermissão
POST/api/v1/tagsCriar tagDECISION_TAGS_MANAGE
GET/api/v1/tagsListar tagsDECISION_TAGS_MANAGE
GET/api/v1/tags/:idObter tagDECISION_TAGS_MANAGE
PATCH/api/v1/tags/:idAtualizar tagDECISION_TAGS_MANAGE
DELETE/api/v1/tags/:idExcluir tagDECISION_TAGS_MANAGE

Criar Tag

POST /api/v1/tags

Cria uma nova tag para organizar decisões.

Request

CampoTipoObrigatórioDescrição
namestringSimNome da tag (1-100 chars)
colorstringSimCor em hexadecimal (#RRGGBB)
curl -X POST 'https://decision-engine.stg.catalisa.app/api/v1/tags' \
-H 'Authorization: Bearer SEU_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Producao",
"color": "#22C55E"
}'

Response (201 Created)

{
"data": {
"type": "tags",
"id": "880e8400-e29b-41d4-a716-446655440003",
"attributes": {
"name": "Producao",
"color": "#22C55E",
"createdAt": "2024-01-15T10:30:00Z"
},
"links": {
"self": "/api/v1/tags/880e8400-e29b-41d4-a716-446655440003"
}
}
}

Listar Tags

GET /api/v1/tags

Lista todas as tags da organização.

Query Parameters

ParâmetroTipoDescrição
page[number]integerNúmero da página
page[size]integerItens por página
curl 'https://decision-engine.stg.catalisa.app/api/v1/tags' \
-H 'Authorization: Bearer SEU_TOKEN'

Response (200 OK)

{
"data": [
{
"type": "tags",
"id": "880e8400-e29b-41d4-a716-446655440003",
"attributes": {
"name": "Producao",
"color": "#22C55E"
}
},
{
"type": "tags",
"id": "880e8400-e29b-41d4-a716-446655440004",
"attributes": {
"name": "Homologação",
"color": "#EAB308"
}
},
{
"type": "tags",
"id": "880e8400-e29b-41d4-a716-446655440005",
"attributes": {
"name": "Desenvolvimento",
"color": "#3B82F6"
}
}
],
"meta": {
"totalItems": 3,
"totalPages": 1,
"currentPage": 1
}
}

Obter Tag

GET /api/v1/tags/:tagId

Obtém detalhes de uma tag específica.

curl 'https://decision-engine.stg.catalisa.app/api/v1/tags/880e8400-e29b-41d4-a716-446655440003' \
-H 'Authorization: Bearer SEU_TOKEN'

Atualizar Tag

PATCH /api/v1/tags/:tagId

Atualiza uma tag existente.

Request

CampoTipoObrigatórioDescrição
namestringNãoNovo nome
colorstringNãoNova cor
curl -X PATCH 'https://decision-engine.stg.catalisa.app/api/v1/tags/880e8400-e29b-41d4-a716-446655440003' \
-H 'Authorization: Bearer SEU_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Producao v2",
"color": "#16A34A"
}'

Excluir Tag

DELETE /api/v1/tags/:tagId

Remove uma tag do sistema.

curl -X DELETE 'https://decision-engine.stg.catalisa.app/api/v1/tags/880e8400-e29b-41d4-a716-446655440003' \
-H 'Authorization: Bearer SEU_TOKEN'

Response (204 No Content)

Sem corpo de resposta.


Usando Tags em Decisoes

Ao criar ou atualizar uma decisão, você pode associar tags:

// Criar decisão com tags
const response = await fetch('https://decision-engine.stg.catalisa.app/api/v1/decisions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
projectId: 'project-uuid',
name: 'Score Check',
key: 'score-check',
tagIds: ['tag-uuid-1', 'tag-uuid-2'],
}),
});

Erros Comuns

CódigoErroDescrição
400VALIDATIONNome vazio ou cor invalida
404NOT_FOUNDTag não encontrada
409CONFLICTNome de tag duplicado