API Reference
Account
GDPR and account management
Account
GDPR and account management
Get data export status
GET /api/v1/account/data-exportReturns the status of a pending data export request
Operation ID: getDataExportStatus · Authentication: Authorization: Bearer <token>
Responses
| Status | Description | Body |
|---|---|---|
200 | Export status | DataExportStatusResponse |
401 | Authentication required | Error |
Response body (200)
| Field | Type | Description |
|---|---|---|
status | enum (none, pending, ready, expired) | |
requested_at | string (date-time) | |
expires_at | string (date-time) |
Example
curl -X GET "https://api.keyenv.dev/api/v1/account/data-export" \
-H "Authorization: Bearer $KEYENV_TOKEN"Request data export
POST /api/v1/account/data-export/requestRequests a GDPR data export
Operation ID: requestDataExport · Authentication: Authorization: Bearer <token>
Responses
| Status | Description | Body |
|---|---|---|
200 | Export requested | DataExportRequestResponse |
401 | Authentication required | Error |
409 | Resource already exists | Error |
Response body (200)
| Field | Type | Description |
|---|---|---|
status | string | |
message | string |
Example
curl -X POST "https://api.keyenv.dev/api/v1/account/data-export/request" \
-H "Authorization: Bearer $KEYENV_TOKEN"Download data export
GET /api/v1/account/data-export/downloadDownloads the completed data export
Operation ID: downloadDataExport · Authentication: Authorization: Bearer <token>
Responses
| Status | Description | Body |
|---|---|---|
200 | Export data | UserDataExport |
401 | Authentication required | Error |
404 | Resource not found | Error |
Response body (200)
| Field | Type | Description |
|---|---|---|
user | object | |
teams | object[] | |
exported_at | string (date-time) |
Example
curl -X GET "https://api.keyenv.dev/api/v1/account/data-export/download" \
-H "Authorization: Bearer $KEYENV_TOKEN"Delete account
DELETE /api/v1/accountPermanently deletes the user account and all associated data
Operation ID: deleteAccount · Authentication: Authorization: Bearer <token>
Request body
application/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
confirmation | string | yes | Must be "DELETE" |
Responses
| Status | Description | Body |
|---|---|---|
200 | Account deleted | DeleteAccountResponse |
400 | Invalid request | Error |
401 | Authentication required | Error |
Response body (200)
| Field | Type | Description |
|---|---|---|
success | boolean | |
message | string |
Example
curl -X DELETE "https://api.keyenv.dev/api/v1/account" \
-H "Authorization: Bearer $KEYENV_TOKEN" \
-H "Content-Type: application/json" \
-d '{"confirmation":"string"}'