> ## Documentation Index
> Fetch the complete documentation index at: https://docs.litmus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Exports

> Taking results out: datasets, Datadog-shaped files, the org's archive and mirror.

16 routes. Every example runs with `LITMUS_URL`, `LITMUS_TOKEN` and `LITMUS_ORG` (your org tag) set in your shell (see [Authentication](/authentication)). A `$NAME` in a path is an id you read from the listing route on this page; a `<field>` in a body is a value you supply, and every field the handler reads is shown, so send only the ones you need. Fields are what the handler's source reads and writes, listed mechanically; they are not a schema.

| Method | Path | Scope |
| - | - | - |
| GET | `/v0/orgs/{orgtag}/datasets` | `read` |
| POST | `/v0/orgs/{orgtag}/datasets/publish` | `push` |
| POST | `/v0/orgs/{orgtag}/deliveries/slack` | `push` |
| POST | `/v0/orgs/{orgtag}/runs/group/{gid}/pr-comment` | `push` |
| POST | `/v0/orgs/{orgtag}/deliveries/datadog` | `push` |
| POST | `/v0/orgs/{orgtag}/runs/{rid}/reexport` | `push` |
| GET | `/v0/orgs/{orgtag}/export` | `read` |
| POST | `/v0/exports/datadog` | `read` |
| POST | `/v0/exports/datadog-experiment` | `read` |
| POST | `/v0/exports/datadog-judges` | `read` |
| GET | `/v0/orgs/{orgtag}/archive` | `admin` |
| POST | `/v0/orgs/{orgtag}/mirror` | `admin` |
| GET | `/v0/orgs/{orgtag}/mirror` | `admin` |
| GET | `/v0/orgs/{orgtag}/mirror/{kind}` | `admin` |
| GET | `/v0/orgs/{orgtag}/mirror-in` | `admin` |
| POST | `/v0/orgs/{orgtag}/mirror-in/{kind}` | `admin` |

## `GET /v0/orgs/{orgtag}/datasets`

The datasets a run can be started over — one per environment, by the name LangFuse holds it under. The Runner's picker reads this, so the picker and LangFuse's dataset list are one set by name.

| | |
| - | - |
| Token scope | `read` (any org token) |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/datasets"]["GET"]` |
| CLI | — |

**Path parameters:** `orgtag`

**Query parameters the handler or its helper reads:** `field`, `value`

**Response:** JSON: a stored record or a helper's result, answered as it is, so its keys are not written in the source and none are listed.

```bash theme={null}
curl -sS "$LITMUS_URL/v0/orgs/$LITMUS_ORG/datasets" \
  -H "Authorization: Bearer $LITMUS_TOKEN"
```

## `POST /v0/orgs/{orgtag}/datasets/publish`

Send every environment of this org to LangFuse as a dataset. `push`: it sends the customer's task set to a system outside this workspace.

| | |
| - | - |
| Token scope | `push` or `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/datasets/publish"]["POST"]` |
| CLI | — |

**Path parameters:** `orgtag`

**Response fields written in the handler:** `org`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/datasets/publish" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## `POST /v0/orgs/{orgtag}/deliveries/slack`

The bug finding as one Slack message: `{group, channel?, against?, main?, thread_ts?, dry_run?, confirm?, weekly?}` → the blocks, and on a real post `{channel, ts, permalink}`.

| | |
| - | - |
| Token scope | `push` or `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/deliveries/slack"]["POST"]` |
| CLI | — |

**Path parameters:** `orgtag`

**Body fields the handler or its helper reads:** `against`, `channel`, `confirm`, `dry_run`, `group`, `main`, `thread_ts`, `weekly`

**Response fields written in the handler:** `channel`, `log`, `permalink`, `posted`, `ts`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/deliveries/slack" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"against": "<against>", "channel": "<channel>", "confirm": "<confirm>", "dry_run": "<dry_run>", "group": "<group>", "main": "<main>", "thread_ts": "<thread_ts>", "weekly": "<weekly>"}'
```

## `POST /v0/orgs/{orgtag}/runs/group/{gid}/pr-comment`

Post a landed run's result on its branch's open pull request: `{against?, console?, dry_run?}` → `{number, pr_url, comment_url, action, branch, verdict}`.

| | |
| - | - |
| Token scope | `push` or `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/runs/group/{gid}/pr-comment"]["POST"]` |
| CLI | — |

**Path parameters:** `orgtag`, `gid`

**Body fields the handler or its helper reads:** `against`, `console`, `dry_run`

**Response fields written in the handler:** `against`, `error`, `group`, `org`, `reason`, `verdict`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/runs/group/$GID/pr-comment" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"against": "<against>", "console": "<console>", "dry_run": "<dry_run>"}'
```

## `POST /v0/orgs/{orgtag}/deliveries/datadog`

POST /v0/orgs/\{orgtag}/deliveries/datadog \{group, against?, main?, bug?, kinds?, dry\_run?, confirm?, console?, format?} — one bug finding as Datadog payloads: an event, a notebook and the Experiments record, each citing the trace ids the compare carries and linking the finding's page (`?via=datadog`). `dry_run` is the default and answers the payloads; `format: zip` answers the import file (the payloads and the curl lines a customer runs with their own key). A real push needs the org's own `datadog_write` credential, by name and never the read key, and a member's confirm; with no write credential it answers why, in one sentence, and where the import file is.

| | |
| - | - |
| Token scope | `push` or `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/deliveries/datadog"]["POST"]` |
| CLI | — |

**Path parameters:** `orgtag`

**Body fields the handler or its helper reads:** `against`, `bug`, `confirm`, `console`, `dry_run`, `format`, `group`, `kinds`, `main`

**Response fields written in the handler:** `dry_run`, `error`, `log`, `reason`, `sent`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/deliveries/datadog" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"against": "<against>", "bug": "<bug>", "confirm": "<confirm>", "console": "<console>", "dry_run": "<dry_run>", "format": "<format>", "group": "<group>", "kinds": "<kinds>", "main": "<main>"}'
```

## `POST /v0/orgs/{orgtag}/runs/{rid}/reexport`

Re-export one stored run from the directory already on disk. 200 with the refreshed run row.

| | |
| - | - |
| Token scope | `push` or `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/runs/{rid}/reexport"]["POST"]` |
| CLI | — |

**Path parameters:** `orgtag`, `rid`

**Response fields written in the handler:** `bundle_version`, `key_verdicts_gained`, `reexported_at`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/runs/$RID/reexport" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## `GET /v0/orgs/{orgtag}/export`

Every world of one org, one tier, one target.

| | |
| - | - |
| Token scope | `read` (any org token) |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/export"]["GET"]` |
| CLI | — |

**Path parameters:** `orgtag`

**Query parameters the handler or its helper reads:** `environment`, `format`, `group`, `tier`

**Response:** A file, not JSON: `application/x-ndjson`, `application/zip`.

```bash theme={null}
curl -sS "$LITMUS_URL/v0/orgs/$LITMUS_ORG/export" \
  -H "Authorization: Bearer $LITMUS_TOKEN"
```

## `POST /v0/exports/datadog`

POST /v0/exports/datadog \{org, set, environment?} -> a zip of one set (ci-10 / smoke-20 / full) in Datadog's dataset shape. A per-org token's org fills `org`; `read` is enough, as for every other export.

| | |
| - | - |
| Token scope | `read` (any org token) |
| Org comes from | `org` in the JSON body; filled in from your token when you leave it out |
| Policy row | `apitokens.POLICY["/v0/exports/datadog"]["POST"]` |
| CLI | `litmus-ai experiment` |

**Body fields the handler or its helper reads:** `environment`, `org`, `set`

**Response:** A file, not JSON: `application/zip`.

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/exports/datadog" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"environment": "<environment>", "set": "<set>"}'
```

## `POST /v0/exports/datadog-experiment`

POST /v0/exports/datadog-experiment \{org, group} -> a zip of one landed run group in Datadog Experiments' shape. A per-org token's org fills `org`; `read` is enough, as for every other export.

| | |
| - | - |
| Token scope | `read` (any org token) |
| Org comes from | `org` in the JSON body; filled in from your token when you leave it out |
| Policy row | `apitokens.POLICY["/v0/exports/datadog-experiment"]["POST"]` |
| CLI | — |

**Body fields the handler or its helper reads:** `group`, `org`

**Response:** A file, not JSON: `application/zip`.

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/exports/datadog-experiment" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"group": "<group>"}'
```

## `POST /v0/exports/datadog-judges`

POST /v0/exports/datadog-judges \{org, environment?} -> a zip of judge definitions mirroring the dataset's verifiers, in Datadog's evaluation shape. A per-org token's org fills `org`; `read` is enough, as for every other export.

| | |
| - | - |
| Token scope | `read` (any org token) |
| Org comes from | `org` in the JSON body; filled in from your token when you leave it out |
| Policy row | `apitokens.POLICY["/v0/exports/datadog-judges"]["POST"]` |
| CLI | `litmus-ai experiment` |

**Body fields the handler or its helper reads:** `environment`, `org`

**Response:** A file, not JSON: `application/zip`.

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/exports/datadog-judges" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"environment": "<environment>"}'
```

## `GET /v0/orgs/{orgtag}/archive`

The whole org as one `tar.gz`, streamed.

| | |
| - | - |
| Token scope | `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/archive"]["GET"]` |
| CLI | `litmus-ai org` |

**Path parameters:** `orgtag`

**Response fields written in the handler:** `error`, `retry_after`, `status`

```bash theme={null}
curl -sS "$LITMUS_URL/v0/orgs/$LITMUS_ORG/archive" \
  -H "Authorization: Bearer $LITMUS_TOKEN"
```

## `POST /v0/orgs/{orgtag}/mirror`

`POST /v0/orgs/{org}/mirror {to?, kinds?, since?, replace?, dry_run?}` — start a round sending this org's records to the workspace this one mirrors into. Answers 202 with the job.

| | |
| - | - |
| Token scope | `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/mirror"]["POST"]` |
| CLI | — |

**Path parameters:** `orgtag`

**Body fields the handler or its helper reads:** `dry_run`, `kinds`, `replace`, `since`, `to`

**Response fields written in the handler:** `error`, `job`, `status`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/mirror" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"dry_run": "<dry_run>", "kinds": "<kinds>", "replace": "<replace>", "since": "<since>", "to": "<to>"}'
```

## `GET /v0/orgs/{orgtag}/mirror`

`GET /v0/orgs/{org}/mirror[?since=&kinds=a,b]` — what a round from this workspace would send, in order, with each member's digest and size, and what it holds back with why. `litmus-ai mirror` reads this on the source. Ids, digests and counts; no record body.

| | |
| - | - |
| Token scope | `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/mirror"]["GET"]` |
| CLI | `litmus-ai mirror` |

**Path parameters:** `orgtag`

**Query parameters the handler or its helper reads:** `kinds`, `since`

**Response fields written in the handler:** `members`, `order`, `tier`

```bash theme={null}
curl -sS "$LITMUS_URL/v0/orgs/$LITMUS_ORG/mirror" \
  -H "Authorization: Bearer $LITMUS_TOKEN"
```

## `GET /v0/orgs/{orgtag}/mirror/{kind}`

`GET /v0/orgs/{org}/mirror/{kind}?id=` — one listed member's bytes, as stored: what `litmus-ai mirror` streams from the source into the receiver's door. Another org's member and an unknown one are one 404.

| | |
| - | - |
| Token scope | `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/mirror/{kind}"]["GET"]` |
| CLI | — |

**Path parameters:** `orgtag`, `kind`

**Query parameters the handler or its helper reads:** `id`

**Response:** A file, not JSON: `application/octet-stream`.

```bash theme={null}
curl -sS "$LITMUS_URL/v0/orgs/$LITMUS_ORG/mirror/$KIND" \
  -H "Authorization: Bearer $LITMUS_TOKEN"
```

## `GET /v0/orgs/{orgtag}/mirror-in`

`GET /v0/orgs/{org}/mirror-in[?wait=1]` — what this workspace holds of the org, as `{"<kind>/<id>": sha256}`, for a sender to diff against, and what it refused at which digest, so a refusal is named again and not re-sent. Answered at once from the digests a background fill stored, with `pending`: how many members it has no current digest for. `?wait=1` waits up to `mirror.WAIT_S` for the fill first. The start of a round: refused unless the caller's identity is on `LITMUS_MIRROR_FROM`.

| | |
| - | - |
| Token scope | `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/mirror-in"]["GET"]` |
| CLI | `litmus-ai mirror` |

**Path parameters:** `orgtag`

**Query parameters the handler or its helper reads:** `wait`

**Response fields written in the handler:** `filled_at`, `filling`, `held`, `org`, `pending`, `refused`, `tier`

```bash theme={null}
curl -sS "$LITMUS_URL/v0/orgs/$LITMUS_ORG/mirror-in" \
  -H "Authorization: Bearer $LITMUS_TOKEN"
```

## `POST /v0/orgs/{orgtag}/mirror-in/{kind}`

`POST /v0/orgs/{org}/mirror-in/{kind}?id=&sha256=[&bundle=][&replace=1]` — admit ONE member of a mirror round. The body is its bytes, read as it uploads and never held.

| | |
| - | - |
| Token scope | `admin` |
| Org comes from | the `{orgtag}` path segment; a token for another org is refused with 403 |
| Policy row | `apitokens.POLICY["/v0/orgs/{orgtag}/mirror-in/{kind}"]["POST"]` |
| CLI | `litmus-ai mirror` |

**Path parameters:** `orgtag`, `kind`

**Query parameters the handler or its helper reads:** `bundle`, `id`, `replace`, `sha256`

**Response fields written in the handler:** `error`, `result`

This call changes state in the org.

```bash theme={null}
curl -sS -X POST "$LITMUS_URL/v0/orgs/$LITMUS_ORG/mirror-in/$KIND" \
  -H "Authorization: Bearer $LITMUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.