Export My Data

POST /v1/user/data-export

Export the calling user's personal data — profile, the usage and balance of the accounts they own, and recent sign-ins — as a single JSON file. Useful for GDPR data-portability requests.

Account resources (endpoints, tunnels, domains, firewall policies, …) are not in it: they belong to the account, not to the member who created them, and stay with the account when a member leaves. A member of the account reads them through their own API routes (for example GET /v1/endpoints).

Unlike most POST endpoints, this streams the export inline as a JSON download (Content-Type: application/json, Content-Disposition: attachment, file name easytunnel-data-export-<your user uuid>-<date>.json); there's no async queue. Individual sections that fail to load are logged server-side and left empty — the export always completes with whatever data was readable.

Request body

None — pass {} or omit the body entirely. The export covers the authenticated user.

Response (200 OK)

JSON document, returned as a streaming download. Every object carries its public uuid and every reference its <thing>_uuid — the same ids the rest of the API uses. Top-level keys:

exported_at datetime
RFC 3339 UTC timestamp of when the export was generated.
user object
{uuid, username, email, plan, status, created_at}.
usage object
{accounts: [{account_uuid, account_name, period_requests, period_bytes_in, …}]} — one entry per account you own.
balance object
{accounts: [{account_uuid, account_name, balance_cents, transactions: [{uuid, type, amount_cents, description, created_at}]}], total_balance_cents} — the last 100 ledger rows per account you own.
login_history array
The last 100 sign-ins: {ip_address, user_agent, success, created_at}.

Deprecated: the export still carries the integer id and account_id fields next to the uuids. They are removed at the sunset; use the uuid fields.

Errors

401 Unauthorized
Missing auth.
500
Top-level encoding error. Section-level failures don't fail the request — the section is left empty.
Request
curl -X POST "https://api.ngris.com/v1/user/data-export" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -o my-ngris-export.json
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") data = client._post_raw("/user/data-export", {}) import json with open("export.json", "w") as f: json.dump(data, f, indent=2)
Response — 200 OK (excerpt)
{ "exported_at": "2026-04-29T13:00:00Z", "user": {"uuid": "019a52c2-ca1e-78ba-ab5c-50362cc29134", "username": "alice", "email": "alice@example.com", "plan": "team"}, "balance": { "accounts": [ {"account_uuid": "019a52c2-cb07-7a3e-9f10-2d4b8c6e1a90", "account_name": "Acme", "balance_cents": 500, "transactions": [{"uuid": "019d0b6e-4f21-7c88-a3d5-0e9b2c7f4a16", "type": "topup", "amount_cents": 500}]} ], "total_balance_cents": 500 }, "login_history": [ {"ip_address": "203.0.113.42", "success": true, "created_at": "2026-04-29T08:15:00Z"} ] }
Was this helpful?
On this page
Export My Data
Was this helpful?