Skip to content
Anagen
PT EN
Request assessment

Guide 1/12

Introduction and use cases

The AnagenSys API lets any other system — website, CRM, accounting, BI, laboratory or partner — read and write clinic data with the same rules as the team: the permission matrix, the scope of each credential and an immutable audit log.

What you can do

  • Generic resources (/r/<resource>): list, read, create, update, archive and run actions on every record type (leads, appointments, payments, tasks…). One definition drives the web app, the mobile app and this API, so they always behave the same.
  • Module endpoints: dashboards, indicators, tasks, chat, notices and everything each module documents in the reference.
  • Webhooks: the clinic tells your system when something happens (lead created, payment received, surgery closed…), signed with HMAC-SHA256.

Typical integrations

1. Receive leads from the website and ads

Your form backend (or ad platform connector) creates the lead with the origin and UTM tags. Duplicates are detected; the lead enters the pipeline and the sales rules (assignment, SLA, sequences) run as if typed by the team. Use an Idempotency-Key so a retry never creates a second lead. Scope: crm.leads:editar.

curl -X POST "https://anagen.pt/api/v1/r/leads" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: form-2026-10-28-0412" \
  -d '{"nome":"Rita Matos","email":"rita@exemplo.pt","telefone":"+351912345678","origem":"site","utm_source":"google","utm_campaign":"fue-outono"}'

2. Sync appointments with an external calendar

Read the week's appointments and subscribe to marcacao.criada to stay current without polling. Scope: agenda:ver.

curl "https://anagen.pt/api/v1/r/marcacoes?f[inicio][de]=2026-11-01&f[inicio][ate]=2026-11-07&ordem=inicio:asc&por_pagina=100" \
  -H "Authorization: Bearer $TOKEN"

3. Send payments to accounting

Fetch the payments received in the month (with method, amount and fiscal document) and subscribe to pagamento.recebido. Invoices are issued by the certified invoicing programme; the API never exposes diagnoses on financial records. Scope: financeiro.pagamentos:ver.

curl "https://anagen.pt/api/v1/r/pagamentos?f[estado]=pago&f[pago_em][de]=2026-10-01&f[pago_em][ate]=2026-10-31&por_pagina=100&pagina=1" \
  -H "Authorization: Bearer $TOKEN"

4. Export indicators to BI

Each indicator group returns KPIs with the previous period and the change, plus the chart series, filtered by period, doctor, sales rep, lead origin and procedure. For spreadsheet tools the team can also issue personal read tokens (CSV/JSON). Scope: indicadores.vendas:ver (and the other groups).

curl "https://anagen.pt/api/v1/indicadores/vendas?periodo=12m" \
  -H "Authorization: Bearer $TOKEN"

5. Receive events by webhook

The clinic registers your HTTPS endpoint, picks the events and receives a secret shown once. Every delivery is signed; see Webhooks for verification code in PHP, JavaScript, Python and C#.