Tema Escuro
Tags
A API de tags permite gerenciar as tags da sua empresa. Tags podem ser vinculadas a contatos e chats para organização e segmentação.
Listar Tags
GEThttps://chat.mehub.app/api/v1/tagsRetorna todas as tags da empresa autenticada.
Headers
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| Authorization | string | Sim | Token de autenticação. Ex: Bearer seu_token |
Query Parameters
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| page | integer | Não | Número da página. Default: 1 |
| per_page | integer | Não | Registros por página (máx: 100). Default: 50 |
| search | string | Não | Buscar por texto da tag |
Exemplo de requisição
bash
curl -X GET "https://chat.mehub.app/api/v1/tags?search=cliente" \
-H "Authorization: Bearer SEU_TOKEN"Response
json
{
"success": true,
"data": [
{
"id": 1,
"text": "Cliente VIP",
"emoji": "⭐",
"color": "#FFD700",
"created_at": "2025-10-29T10:30:00.000000Z"
},
{
"id": 2,
"text": "Cliente Novo",
"emoji": "🆕",
"color": "#4CAF50",
"created_at": "2025-10-28T15:45:00.000000Z"
}
],
"pagination": {
"total": 2,
"per_page": 50,
"current_page": 1,
"last_page": 1
}
}Campos do Response
| Campo | Tipo | Descrição |
|---|---|---|
| id | integer | ID único da tag |
| text | string | Texto da tag |
| emoji | string/null | Emoji da tag |
| color | string | Cor da tag em hexadecimal |
| created_at | string | Data de criação |
Visualizar Tag
GEThttps://chat.mehub.app/api/v1/tags/{id}Retorna os detalhes de uma tag específica.
Headers
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| Authorization | string | Sim | Token de autenticação. Ex: Bearer seu_token |
Path Parameters
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| id | integer | Sim | ID da tag |
Exemplo de requisição
bash
curl -X GET "https://chat.mehub.app/api/v1/tags/1" \
-H "Authorization: Bearer SEU_TOKEN"Response
json
{
"success": true,
"data": {
"id": 1,
"text": "Cliente VIP",
"emoji": "⭐",
"color": "#FFD700",
"created_at": "2025-10-29T10:30:00.000000Z"
}
}Criar Tag
POSThttps://chat.mehub.app/api/v1/tagsCria uma nova tag.
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| text | string | Sim | Texto da tag |
| emoji | string | Não | Emoji da tag |
| color | string | Não | Cor da tag em hexadecimal. Default: #000000 |
Exemplo de requisição
bash
curl -X POST "https://chat.mehub.app/api/v1/tags" \
-H "Authorization: Bearer SEU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"text": "Cliente VIP",
"emoji": "⭐",
"color": "#FFD700"
}'Response
json
{
"success": true,
"message": "Tag criada com sucesso.",
"data": {
"id": 1,
"text": "Cliente VIP",
"emoji": "⭐",
"color": "#FFD700",
"created_at": "2025-10-29T10:30:00.000000Z"
}
}Erros
json
{
"success": false,
"message": "Erro de validação",
"errors": [
{
"code": "FIELD_REQUIRED",
"field": "text",
"message": "O campo text é obrigatório."
}
]
}Atualizar Tag
PUThttps://chat.mehub.app/api/v1/tags/{id}Atualiza os dados de uma tag existente.
Path Parameters
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| id | integer | Sim | ID da tag |
Request Body
| Campo | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| text | string | Não | Texto da tag |
| emoji | string | Não | Emoji da tag |
| color | string | Não | Cor da tag em hexadecimal |
Exemplo de requisição
bash
curl -X PUT "https://chat.mehub.app/api/v1/tags/1" \
-H "Authorization: Bearer SEU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"text": "Cliente Premium",
"color": "#C0A000"
}'Response
json
{
"success": true,
"message": "Tag atualizada com sucesso.",
"data": {
"id": 1,
"text": "Cliente Premium",
"emoji": "⭐",
"color": "#C0A000",
"created_at": "2025-10-29T10:30:00.000000Z"
}
}Erros
json
{
"success": false,
"message": "Tag não encontrada."
}Excluir Tag
DELETEhttps://chat.mehub.app/api/v1/tags/{id}Remove uma tag. A tag será desvinculada automaticamente de todos os contatos e chats.
Path Parameters
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
| id | integer | Sim | ID da tag |
Exemplo de requisição
bash
curl -X DELETE "https://chat.mehub.app/api/v1/tags/1" \
-H "Authorization: Bearer SEU_TOKEN"Response
json
{
"success": true,
"message": "Tag excluída com sucesso."
}Erros
json
{
"success": false,
"message": "Tag não encontrada."
}