Pular para conteúdo

API Backend — Chronicle

Visao Geral

O backend expoe tres camadas: BFF (/bff/*), API Publica (/api/v1/*) e WebSocket (/ws/*).

Base URL: http://localhost:8080


BFF (/bff/*)

Auth

Metodo Path Descricao
POST /bff/auth/login Login (email + senha)
POST /bff/auth/signup Cadastro
POST /bff/auth/otp/request Solicitar OTP
POST /bff/auth/otp/verify Verificar OTP
POST /bff/auth/oauth2/authorize Iniciar OAuth2
POST /bff/auth/refresh Refresh token
GET /bff/auth/me Dados do usuario

Organizations

Metodo Path Descricao
GET /bff/organizations Listar organizacoes
GET /bff/organizations/{id} Obter organizacao
POST /bff/organizations Criar organizacao
PUT /bff/organizations/{id} Atualizar
DELETE /bff/organizations/{id} Deletar
GET /bff/organizations/{id}/members Listar membros
POST /bff/organizations/{id}/members/invite Convidar membro
PUT /bff/organizations/{id}/members/{memberId} Atualizar role
DELETE /bff/organizations/{id}/members/{memberId} Remover membro

Pipes

Metodo Path Descricao
GET /bff/organizations/{orgId}/pipes Listar pipes
GET /bff/pipes/{id} Obter pipe
POST /bff/organizations/{orgId}/pipes Criar pipe
PUT /bff/pipes/{id} Atualizar
POST /bff/pipes/{id}/archive Arquivar
POST /bff/pipes/{id}/restore Restaurar

Stages

Metodo Path Descricao
GET /bff/pipes/{pipeId}/stages Listar estagios
POST /bff/pipes/{pipeId}/stages Criar estagio
PUT /bff/stages/{id} Atualizar
DELETE /bff/stages/{id} Deletar
POST /bff/pipes/{pipeId}/stages/reorder Reordenar

Cards

Metodo Path Descricao
GET /bff/cards/pipe/{pipeId} Listar cards do pipe
GET /bff/cards/{id} Obter card
POST /bff/cards/pipe/{pipeId} Criar card
PUT /bff/cards/{id} Atualizar card
POST /bff/cards/{id}/move Mover card
POST /bff/cards/{id}/archive Arquivar
POST /bff/cards/{id}/restore Restaurar
GET /bff/cards/pipe/{pipeId}/search Buscar cards
GET /bff/cards/{id}/timeline Timeline de eventos
GET /bff/cards/{id}/history Historico de mudancas

Card Files

Metodo Path Descricao
GET /bff/cards/{id}/files Listar arquivos
POST /bff/cards/{id}/files Upload arquivo
DELETE /bff/cards/{cardId}/files/{fileId} Deletar arquivo

Card Comments

Metodo Path Descricao
GET /bff/cards/{id}/comments Listar comentarios
POST /bff/cards/{id}/comments Criar comentario
PUT /bff/comments/{id} Editar comentario
DELETE /bff/comments/{id} Deletar comentario

Card Emails

Metodo Path Descricao
GET /bff/cards/{id}/emails Listar emails
POST /bff/cards/{id}/emails Enviar email

Card Dependencies

Metodo Path Descricao
GET /bff/cards/{id}/dependencies Listar dependencias
POST /bff/cards/{id}/dependencies Criar dependencia
DELETE /bff/dependencies/{id} Remover dependencia

Fields

Metodo Path Descricao
GET /bff/pipes/{pipeId}/fields Listar campos
POST /bff/pipes/{pipeId}/fields Criar campo
PUT /bff/fields/{id} Atualizar campo
DELETE /bff/fields/{id} Deletar campo
POST /bff/pipes/{pipeId}/fields/reorder Reordenar

Labels

Metodo Path Descricao
GET /bff/pipes/{pipeId}/labels Listar labels
POST /bff/pipes/{pipeId}/labels Criar label
PUT /bff/labels/{id} Atualizar label
DELETE /bff/labels/{id} Deletar label

Automations

Metodo Path Descricao
GET /bff/automations/pipe/{pipeId} Listar automacoes
GET /bff/automations/{id} Obter automacao
POST /bff/automations/pipe/{pipeId} Criar
PUT /bff/automations/{id} Atualizar
POST /bff/automations/{id}/toggle Ativar/desativar
DELETE /bff/automations/{id} Deletar
GET /bff/automations/{id}/executions Historico de execucoes

Reports

Metodo Path Descricao
GET /bff/reports/organization/{orgId} Stats da org
GET /bff/reports/pipe/{pipeId} Stats do pipe
GET /bff/reports/pipe/{pipeId}/timeline Timeline de cards
GET /bff/reports/pipe/{pipeId}/movements Movimentacoes

API Publica (/api/v1/*)

Autenticacao via header X-API-Key.

Metodo Path Descricao
POST /api/v1/pipes/{pipeId}/cards Criar card
GET /api/v1/cards/{id} Obter card
GET /api/v1/pipes/{pipeId}/cards/code/{code} Buscar por codigo
PUT /api/v1/cards/{id} Atualizar card
POST /api/v1/cards/{id}/move Mover card

WebSocket

ws://host/ws/board/{pipeId}

Eventos recebidos:

Evento Descricao
CARD_CREATED Novo card adicionado
CARD_UPDATED Card atualizado
CARD_MOVED Card movido entre estagios
CARD_ARCHIVED Card arquivado
CARD_UNARCHIVED Card restaurado
CARD_DELETED Card deletado

Formularios Publicos

Metodo Path Auth Descricao
GET /forms/{slug}/schema Nao Schema do formulario
POST /forms/{slug}/submit Nao Submeter formulario

Autenticacao

BFF: Authorization: Bearer {jwt} + X-Organization-Id: {orgId}

API Publica: X-API-Key: {key}