⚠️ Porta is in beta — APIs and features may change before v1.0
Skip to content

Data Export API

The data export API enables downloading entity data in CSV or JSON format. Exports exclude sensitive data (passwords, secrets, keys).

Endpoints

MethodPathPermissionDescription
GET/api/admin/export/usersuser:readExport users
GET/api/admin/export/organizationsorg:readExport organizations
GET/api/admin/export/clientsclient:readExport clients
GET/api/admin/export/rolesrole:readExport roles
GET/api/admin/export/auditaudit:readExport audit log

Query Parameters

ParameterTypeDefaultDescription
formatstringjsonExport format: json or csv
organizationIdUUIDRequired for users, clients, audit exports
applicationIdUUIDRequired for roles export
startDateISO datetimeStart date filter (audit only)
endDateISO datetimeEnd date filter (audit only)

Export Users

http
GET /api/admin/export/users?format=csv&organizationId=uuid
Authorization: Bearer <token>

Exported Fields

FieldDescription
idUser UUID
emailEmail address
statusAccount status
given_nameFirst name
family_nameLast name
nicknameNickname
localePreferred locale
email_verifiedEmail verification status
phone_numberPhone number
created_atCreation timestamp
updated_atLast update timestamp
last_login_atLast login timestamp
login_countTotal login count

Security: Password hashes, secrets, and other sensitive fields are never included in exports.

Export Organizations

http
GET /api/admin/export/organizations?format=json
Authorization: Bearer <token>

No organizationId parameter required — exports all organizations.

Export Audit Log

http
GET /api/admin/export/audit?format=csv&organizationId=uuid&startDate=2026-01-01T00:00:00Z&endDate=2026-01-31T23:59:59Z
Authorization: Bearer <token>
  • Limited to 10,000 rows per export
  • Date range filtering via startDate and endDate

Response Headers

All export responses include:

http
Content-Type: text/csv
Content-Disposition: attachment; filename="users-export-2026-01-15T10-30-00.csv"

CSV Format

  • First row is the column header
  • Values containing commas, quotes, or newlines are properly escaped
  • Null values are represented as empty strings
  • Dates are formatted as ISO 8601

JSON Format

json
{
  "data": [...],
  "exportedAt": "2026-01-15T10:30:00Z",
  "total": 42
}

Released under the MIT License.