GDPR

To help you meet GDPR (and Turkey’s KVKK) obligations, the Nooknear API offers three endpoints: export all data in your account, delete all of it, and read the audit log. All three work with your API key and only for your own tenantId.

This page covers the technical side; for the legal framework, see our legal pages.

Data export (NDJSON)

GET /v1/tenants/:tenantId/data-export streams your account’s data as NDJSON (one JSON object per line). The response is sent as a file attachment (Content-Type: application/x-ndjson).

curl https://api.nooknear.com/v1/tenants/$TENANT_ID/data-export \
  -H "X-API-Key: $NOOKNEAR_API_KEY" \
  -o nooknear-export.ndjson

Every line has a type field and a data object (fields trimmed for brevity):

{"type":"tenant","data":{"id":"…","name":"…","email":"…","plan":"…","createdAt":"…"}}
{"type":"usage","data":{"tenantId":"…","totalStorageBytes":52428800,"totalUploads":312,"totalDownloads":0}}
{"type":"asset","data":{"id":"…","resourceType":"product","resourceId":"42","originalFilename":"cover.jpg","status":"ready","createdAt":"…"}}
{"type":"audit_log","data":{"id":"…","action":"upload","assetId":"…","ipAddress":"203.0.113.10","userAgent":"…","timestamp":"…"}}
type Contents
tenant Account details.
usage Usage summary.
asset One line per image: resource type, ID, file name, status, variant info.
audit_log Audit log entries.

The export contains metadata, not the image files themselves. To get the files too, list them with GET /v1/media and download the variant or original URLs. Exports can be large, so process them line by line:

import { createInterface } from 'node:readline';
import { Readable } from 'node:stream';

const res = await fetch(`https://api.nooknear.com/v1/tenants/${process.env.TENANT_ID}/data-export`, {
  headers: { 'X-API-Key': process.env.NOOKNEAR_API_KEY }
});

const lines = createInterface({ input: Readable.fromWeb(res.body) });
for await (const line of lines) {
  if (!line) continue;
  const { type, data } = JSON.parse(line);
  if (type === 'asset') console.log(data.id, data.originalFilename);
}

Data deletion

POST /v1/tenants/:tenantId/data-delete queues a job that deletes your entire account. This is not for removing a single image; for that, use DELETE /v1/media/:assetId (see Listing and filtering).

curl -X POST https://api.nooknear.com/v1/tenants/$TENANT_ID/data-delete \
  -H "X-API-Key: $NOOKNEAR_API_KEY"

Response, 202 Accepted:

{
  "deletionJobId": "58",
  "estimatedCompletion": "2026-12-06T13:00:00.000Z"
}

What happens:

  1. The account immediately moves to a “deleting” state. Your API key stops working at that moment.
  2. A background job deletes every image file (originals and variants) from storage.
  3. Asset records, usage data and stored idempotency responses are deleted from the database, followed by the account record.
  4. Audit log entries are anonymized: IP address, user agent and details are cleared. Anonymized entries are removed after a 90-day retention period.

estimatedCompletion is approximate (today it’s computed as one hour after the request). This cannot be undone. We recommend downloading your data with data-export first. A second request for an account that’s already being deleted returns 400.

Audit log

GET /v1/tenants/:tenantId/audit-log returns a record of actions in your account. Use it to see who did what, when and from which IP address, or to investigate a suspected key leak.

Parameter Description
action upload, download, delete, access, plan_change, api_key_rotate, failure.
from Start time, ISO 8601 (for example 2026-12-01T00:00:00Z).
to End time, ISO 8601.
page Page number. Default 1.
limit Items per page, up to 100. Default 20.
curl "https://api.nooknear.com/v1/tenants/$TENANT_ID/audit-log?action=delete&from=2026-12-01T00:00:00Z" \
  -H "X-API-Key: $NOOKNEAR_API_KEY"
{
  "logs": [
    {
      "id": "…",
      "tenantId": "…",
      "action": "delete",
      "assetId": "3f6c2a8e-1b4d-4c1e-9a77-5e2f0d8b9c10",
      "details": { "jobId": "1287" },
      "ipAddress": "203.0.113.10",
      "userAgent": "curl/8.7.1",
      "timestamp": "2026-12-05T09:41:12.000Z"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20
}

Examples of recorded actions: upload requests (upload), reading an asset and updating tags or metadata (access), deletes (delete), key rotation (api_key_rotate) and failed image processing (failure).

The audit log can contain personal data such as IP addresses and user agents. If you copy it into your own systems, set your retention period accordingly.