API Documentation

Integração para n8n, WhatsApp e apps futuros

API Documentation

Documentação interativa estilo Swagger/Postman para o ecossistema Simuzap.

Contacts API
POST/contacts

Creates a new contact in Simuzap.

Query Params
None
Body Example
{
  "name": "André Wilckay",
  "email": "andre@simulazap.com",
  "phone": "31999999999",
  "school": "PUC Campinas",
  "grade": "Superior",
  "totalQuestions": 0,
  "totalCorrect": 0
}
cURL Example

                  
Response Example
{
  "id": "uuid",
  "createdAt": "date"
}
GET/contacts

Returns all contacts.

Query Params
school=Objetivo&grade=3º EM (future filter example)
Body Example
None
cURL Example

                  
Response Example
[
  {
    "id": "uuid",
    "name": "André Wilckay"
  }
]
GET/contacts/:id

Returns contact by id.

Query Params
None
Body Example
None
cURL Example

                  
Response Example
{
  "id": "uuid",
  "name": "André Wilckay"
}
PATCH/contacts/:id

Updates a contact dynamically.

Query Params
None
Body Example
{
  "school": "UNICAMP",
  "grade": "Superior",
  "totalCorrect": 12
}
cURL Example

                  
Response Example
{
  "id": "uuid",
  "school": "UNICAMP"
}
DELETE/contacts/:id

Removes a contact from database.

Query Params
None
Body Example
None
cURL Example

                  
Response Example
{
  "message": "Contato removido com sucesso."
}
Sessions API (future)
POST/sessions/login

Future endpoint for token-based session authentication.

Query Params
None
Body Example
{
  "email": "admin@simulazap.com",
  "password": "********"
}
cURL Example
curl -X POST "http://localhost:3000/sessions/login" -H "Content-Type: application/json"
Response Example
{
  "token": "jwt",
  "expiresIn": 3600
}
Webhook Integration
POST/webhooks/n8n/test

Future endpoint to dispatch test event to n8n and WhatsApp automations.

Query Params
None
Body Example
{
  "event": "test_connection",
  "platform": "Simuzap"
}
cURL Example
curl -X POST "http://localhost:3000/webhooks/n8n/test"
Response Example
{
  "status": "queued"
}