---
title: Bulk JSON-LD tenant export
description: Full workspace export as one JSON-LD document — every product, passport, and template reference. Dashboard JWT only (admin role); not API-key reachable.
canonical: "https://www.tracepass.eu/docs/tenant-export"
locale: en
source: "https://www.tracepass.eu/docs/tenant-export"
---

# Bulk JSON-LD tenant export

> Full workspace export as one JSON-LD document — every product, passport, and template reference. Dashboard JWT only (admin role); not API-key reachable.

```http
GET /api/exports/tenant
```

Returns every product, every passport (regardless of status), and every referenced category template the workspace owns, as one JSON-LD document. The shape mirrors the public passport viewer's per-passport JSON-LD emission, wrapped in a tenant envelope with metadata about the export run.

**Not API-key reachable.** Auth is dashboard JWT (admin role) + paying-customer gate — same trust level as deleting the company. The pragmatic flow is: open Settings → Data export in the dashboard and click "Export tenant". Programmatic access requires a session cookie issued by `/api/auth/login`.

Synchronous response with `Content-Disposition: attachment; filename="tracepass-tenant-export-<companyId>-<YYYY-MM-DD>.jsonld"`. Includes evidence-document URLs but not the document bytes themselves; fetch those separately if you need offline copies. No pagination — all-or-nothing.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Cookie` | header | string | yes | Dashboard session cookie (`tp_session=...`) issued by `/api/auth/login`. Browsers attach it automatically when the export is initiated from the dashboard. |
| `Accept` | header | string | no | `application/ld+json` (default) or `application/json`. Byte-equivalent — only the response Content-Type changes. |

## Examples

```bash
# In practice: open Settings -> Data export in the dashboard.
# For curl, capture the session cookie after a login first:
curl -sS -L \
  --cookie "tp_session=$TRACEPASS_SESSION_COOKIE" \
  -H "Accept: application/ld+json" \
  -o tenant-export.jsonld \
  https://app.tracepass.eu/api/exports/tenant
```

```typescript
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { finished } from "node:stream/promises";

// session cookie captured from a prior /api/auth/login call
const cookie = process.env.TRACEPASS_SESSION_COOKIE!;

const res = await fetch("https://app.tracepass.eu/api/exports/tenant", {
  headers: {
    Cookie: `tp_session=${cookie}`,
    Accept: "application/ld+json",
  },
});
if (!res.ok || !res.body) throw new Error(`Export failed: ${res.status}`);

const dest = createWriteStream("tenant-export.jsonld");
await finished(Readable.fromWeb(res.body).pipe(dest));
```

```python
import os, requests

cookie = os.environ["TRACEPASS_SESSION_COOKIE"]
with requests.get(
    "https://app.tracepass.eu/api/exports/tenant",
    cookies={"tp_session": cookie},
    headers={"Accept": "application/ld+json"},
    stream=True,
) as res:
    res.raise_for_status()
    with open("tenant-export.jsonld", "wb") as fh:
        for chunk in res.iter_content(chunk_size=1024 * 64):
            fh.write(chunk)
```

## Responses

### 200 — OK

```json
{
  "@context": "https://app.tracepass.eu/schemas/tenant-export-v1.jsonld",
  "@type": "TenantExport",
  "exportedAt": "2026-05-09T12:00:00.000Z",
  "company": { "_id": "...", "name": "Acme Batteries Ltd", "country": "DE" },
  "counts": { "products": 12, "passports": 4327, "templates": 3 },
  "products": [ { "...": "...one entry per product..." } ],
  "passports": [ { "...": "...one entry per passport, with full fieldValues + parties..." } ],
  "templates": [ { "id": "...", "category": "batteries", "version": "v3" } ]
}
```

### 401 — Not signed in

```json
{ "error": "Authentication required" }
```

### 402 — Subscription required

```json
{ "error": "Active paid subscription required" }
```

### 403 — Forbidden

```json
{ "error": "admin role required" }
```

## Related

- [Create a passport](https://www.tracepass.eu/docs/create-passport.md)
