Endpoints v1
Base URL: https://api2.monisat.online/v1 · Auth: Authorization: Bearer <jwt>
Auth
POST
/v1/auth/loginBody:
{ email, password }. Retorna jwt_token, company_id.POST
/v1/auth/refreshRenovar JWT. Body:
{ refresh_token }.Veículos & Motoristas
GET
/v1/vehiclestype == "V" para placas, type == "R" para reboques.GET
/v1/driversCampos:
id, name, cpf.Viagens
GET
/v1/tripsQuery:
page, status, vehicle_id, driver_id, policy_id, start_date, end_date.GET
/v1/trips/{id}Detalhe completo incluindo entregas e situações.
POST
/v1/tripsCriar viagem. Campos em inglês snake_case.
PUT
/v1/trips/{id}Atualizar viagem existente.
POST
/v1/trips/{id}/analyzeAnálise — retorna alertas e confirmações.
Pontos de Entrega
GET
/v1/delivery-points?_detail=true&nome=...&cnpj=...name_city_id retorna "CIDADE - UF". Não requer enrich separado.Apólices & Perfis
GET
/v1/policiesCampos:
id, name, expiration_days (string). Legado usava _id/nome.GET
/v1/profilesPerfis de viagem.
Checklist
GET
/v1/checklists?_start_from={unix}_start_from em Unix epoch Int64. name_applicant e name_doer já vêm na lista.GET
/v1/checklists/{id}Detalhe do checklist.
POST
/v1/checklists/scheduleAgendamento com validação PHP-parity.
Rotas & Rotogramas
GET
/v1/routesRotas cadastradas.
GET
/v1/rotograms/{routeId}data[0].rotogram_route.coordinates + instruções.Desconsideração
POST
/v1/disregardsBody:
{ trip_ids, reason, event_type, location }.Erros Comuns
| Código | Causa | Solução |
|---|---|---|
| 400 | _start_from como ISO 8601 | Int64(date.timeIntervalSince1970) |
| 401 | JWT expirado | ensureValidTokenForAPICall() |
| 429 | Muitas chamadas paralelas | RequestThrottle — máx 3 concorrentes |