GET /admin/data-export
Authentication: browser session with the ADMIN role, or the tenant API key (x-api-key or Authorization: Bearer <api_key>): an API key is always treated as ADMIN.
Query params:
| Param |
Type |
Description |
format |
string |
json (default) or zip |
format=json: returns the JSON with all of the tenant's models (historical behavior, unchanged). It does not include the evidence binary files, only the metadata.
format=zip: generates, as a stream (without buffering the whole ZIP in memory, via archiver@7), a .zip with:
manifest.json: the same JSON as format=json, plus the applicable Data Act article and the list of included files;
evidence/<id>/<original-name>: the content of each evidence item with an attached file. ZIP entry names are sanitized.
- The audit log is exported without truncation, in batches of 5,000 records (cursor).
Rate limit: format=json: 4 exports/hour per tenant. format=zip: 1 export/hour per tenant (reads all evidence files from storage, which is heavier).
GET /admin/data-export/inventory
Returns the inventory of the tenant's exportable data (single source shared with the route above). It is designed to feed a public data portability page without exposing real tenant data.
Authentication: authenticated session or API key, with no restriction to ADMIN (it only returns metadata about what is exportable). Rate limit: 60 req/min per tenant.
Response:
{
"dataActArticle": "Art. 25.º(2)(e) Data Act: inventário de dados exportáveis",
"inventory": [ /* lista de modelos exportáveis */ ]
}