Skip to content

Audit ​

The institution's event log, with statistics and export.

List the institution's audit events ​

GET /auditoria

Access: Requires the capability ADMINISTRAR, in some scope (the response only includes what the person can see). Success status: 200.

Query parameters

ParameterTypeRequiredConstraintsDescription
destringno^\d{4}-\d{2}-\d{2}$Window start date (YYYY-MM-DD), inclusive.
atestringno^\d{4}-\d{2}-\d{2}$Window end date (YYYY-MM-DD), inclusive.
acaostringno^[a-z][a-z0-9_.]{0,59}$Filter by event type (e.g. presenca.confirmada).
instituicaoIdstring (uuid)noInstitution id.
atorIdstring (uuid)noFilter by events made by this person.
fusostringno1–64 charactersIANA time zone used to group by day (e.g. America/Sao_Paulo).
cursorstringnoto 200 characters; ^[A-Za-z0-9_-]+$Cursor returned by the previous page.
limiteintegerno1…100; default: 50How many items per page (1 to 200; the default varies by route, usually 50).

Response

AuditoriaPagina

FieldTypeRequiredConstraintsDescription
itemslist of AuditoriaItemyes
proximostring or nullyes

On error: ErroApi model.

Example

bash
curl -X GET "$API/auditoria" -H "Authorization: Bearer $TOKEN"

Audit event statistics ​

GET /auditoria/estatisticas

Access: Requires the capability ADMINISTRAR, in some scope (the response only includes what the person can see). Success status: 200.

Query parameters

ParameterTypeRequiredConstraintsDescription
destringno^\d{4}-\d{2}-\d{2}$Window start date (YYYY-MM-DD), inclusive.
atestringno^\d{4}-\d{2}-\d{2}$Window end date (YYYY-MM-DD), inclusive.
acaostringno^[a-z][a-z0-9_.]{0,59}$Filter by event type (e.g. presenca.confirmada).
instituicaoIdstring (uuid)noInstitution id.
atorIdstring (uuid)noFilter by events made by this person.
fusostringno1–64 charactersIANA time zone used to group by day (e.g. America/Sao_Paulo).

Response

AuditoriaEstatisticas

FieldTypeRequiredConstraintsDescription
deDatayes
ateDatayes
totalintegeryes0…
porAcaolist of objectyes
porAcao[].acaostringyes
porAcao[].totalintegeryes0…
porDialist of objectyes
porDia[].diaDatayes
porDia[].totalintegeryes0…

On error: ErroApi model.

Example

bash
curl -X GET "$API/auditoria/estatisticas" -H "Authorization: Bearer $TOKEN"

Export the audit log as CSV ​

GET /auditoria/exportar

Access: Requires the capability ADMINISTRAR, in some scope (the response only includes what the person can see). Rate limit: up to 10 calls every 60 s per origin. Success status: 200.

Query parameters

ParameterTypeRequiredConstraintsDescription
destringno^\d{4}-\d{2}-\d{2}$Window start date (YYYY-MM-DD), inclusive.
atestringno^\d{4}-\d{2}-\d{2}$Window end date (YYYY-MM-DD), inclusive.
acaostringno^[a-z][a-z0-9_.]{0,59}$Filter by event type (e.g. presenca.confirmada).
instituicaoIdstring (uuid)noInstitution id.
atorIdstring (uuid)noFilter by events made by this person.
fusostringno1–64 charactersIANA time zone used to group by day (e.g. America/Sao_Paulo).

Response

CSV file (text/csv).

On error: ErroApi model.

Example

bash
curl -X GET "$API/auditoria/exportar" -H "Authorization: Bearer $TOKEN"

contato@presente.app.br