Skip to content

Request a personal data export.

POST
/api/user/data-export
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/user/data-export \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "sections": [ "profile", "consents" ], "format": "json" }'

Creates a GDPR data portability export for the authenticated user. Small exports can complete synchronously; larger exports return a pending request for later polling.

Media type application/json
object
sections
Array<string>
Allowed values: profile consents sessions auth_history custom_claims
format
string
Allowed values: json csv
Example
{
"sections": [
"profile",
"consents"
],
"format": "json"
}

Successful JSON response.

Media type application/json
One of:
object
status
required
string
Allowed values: completed
requestId
required
string
format
required
string
Allowed values: json csv
data
required
object
key
additional properties
exportedAt
required
integer
Example
{
"status": "pending",
"requestId": "export_123",
"message": "Export request created. Use GET /api/user/data-export/:id to check status.",
"estimatedWaitSeconds": 30
}

Successful JSON response.

Media type application/json
One of:
object
status
required
string
Allowed values: completed
requestId
required
string
format
required
string
Allowed values: json csv
data
required
object
key
additional properties
exportedAt
required
integer
Example
{
"status": "pending",
"requestId": "export_123",
"message": "Export request created. Use GET /api/user/data-export/:id to check status.",
"estimatedWaitSeconds": 30
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}