---
title: "Export ledger slice"
url: https://hexelstudio.com/docs/api/titan/administration/export
---

# Export ledger slice

**GET** `/titan/admin/ledger/export`

One page of a session's Agent Ledger entries with the exact event bodies hashed into the deployment chain (RFC 8785 canonical JSON), each entry's prev_digest and entry_digest, the chain head and prune checkpoint read in the same snapshot and, when the Gateway has a slice signing key, an Ed25519 signature over the manifest's canonical bytes, so the pack can be re-hashed offline with titan-ledger-verify -pack. Entry digest = sha256(prev_digest || canonical event). The bodies are whole: ids, enums, digests and, on a file-result entry, the stored file's name, type and size, in every data mode; never message text, arguments or outputs. After authorization, NOT_FOUND unless the deployment has the export on.

## Query parameters

- `session_id: string`

  The session whose entries are exported (the entries' session_id).

- `after: optional integer`

  Only entries with a seq above this: the previous page's manifest.next_after.

  Default: `0`

- `limit: optional integer`

  Default: `500`

## Headers

- `Authorization: string`

  `Bearer <token>`. A Hexel Studio access token for a member or a service user of your organization (or send a service user's API key as X-API-Key).

- `Titan-Enforcement-Deployment: optional string`

  The enforcement deployment this call acts on (its td-... id). Required on the shared plane, where one Gateway serves many tenants and there is no default: a missing, unknown, repeated or other organization's deployment answers 403, like a failed authorization. Optional on a dedicated cell, which defaults to its one deployment.

## Returns

`200` Successful response; exact status varies by operation. (`object`)

- `entries: array of object`

  - `entry_digest: string`

  - `event: object`

    The entry's Agent Ledger event body: the RFC 8785 canonical JSON hashed into entry_digest.

  - `prev_digest: string`

  - `seq: integer`

- `manifest: object`

  - `after: integer`

  - `enforcement_deployment_id: string`

  - `entries: array of object`

    - `entry_digest: string`

    - `seq: integer`

  - `exported_at: string`

  - `head: object`

    - `digest: string`

    - `seq: integer`

  - `next_after: integer`

  - `organization_id: string`

  - `pruned_through: object`

    - `digest: string`

    - `seq: integer`

  - `session_id: string`

  - `type: string`

    One of: `"titan.ledger_slice"`

  - `v: integer`

    One of: `1`

- `signature: optional object`

  - `alg: string`

    One of: `"EdDSA"`

  - `key_id: string`

    The first 16 hex characters of the SHA-256 of the public key.

  - `sig: string`

    base64url Ed25519 signature over the manifest's RFC 8785 canonical bytes.

## Errors

- `400` Admin error
- `403` Admin error
- `404` Admin error
- `500` Admin error

## Example

```bash
curl --request GET \
  --url 'https://api.hexelstudio.com/v1/titan/admin/ledger/export?session_id=SESSION_ID' \
  --header "Authorization: Bearer $ACCESS_TOKEN"
```

### Response (200)

```json
{
  "entries": [
    {
      "entry_digest": "string",
      "event": {},
      "prev_digest": "string",
      "seq": 0
    }
  ],
  "manifest": {
    "after": 0,
    "enforcement_deployment_id": "string",
    "entries": [
      {
        "entry_digest": "string",
        "seq": 0
      }
    ],
    "exported_at": "2026-01-01T00:00:00Z",
    "head": {
      "digest": "string",
      "seq": 0
    },
    "next_after": 0,
    "organization_id": "string",
    "pruned_through": {
      "digest": "string",
      "seq": 0
    },
    "session_id": "string",
    "type": "titan.ledger_slice",
    "v": 1
  },
  "signature": {
    "alg": "EdDSA",
    "key_id": "string",
    "sig": "string"
  }
}
```

### Response (400)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (403)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (404)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```

### Response (500)

```json
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
```
