---
title: "Upload offline local evidence"
url: https://hexelstudio.com/docs/api/titan-agent/local-device/offline-events
---

# Upload offline local evidence

**POST** `/titan/agent/local/offline-events`

Device-authenticated (titan_device_key bindings only, assurance A2 or higher). The batch must be a contiguous valid hash chain; every entry is bound to the caller's own session scope. Request body at most 256 KiB; issues no grant.

## Headers

- `Authorization: string`

  `Bearer <token>`. Runtime identity token from the identity exchange. Through the public edge, device-bound callers (titand) and workloads of the deployment's attached customer Kubernetes clusters are served. A device-bound caller's requests also carry a Titan-Device-Proof over the path below /v1 (or below the cell prefix), i.e. the /titan/agent/... path; an attached cluster's carry none.

- `Content-Type: string`

  Exact media type with exactly one version parameter.

  One of: `"application/vnd.titan.offline-events+json;version=1"`

- `Accept: string`

  Exact media type: type and subtype case-insensitive, exactly one version parameter.

  One of: `"application/vnd.titan.offline-events+json;version=1"`

- `Titan-Device-Proof: string`

  Per-request EdDSA device proof; this surface serves titan_device_key bindings only.

## Body parameters

- `events: array of object or object or object`

- `version: integer`

  One of: `1`

## Returns

`200` Count of entries appended to the Agent Ledger. (`AgentOfflineEventsResult`)

- `appended: integer`

  Entries appended; over-cap entries are dropped and recorded once.

- `version: integer`

  One of: `1`

## Errors

- `400` INVALID_REQUEST: a header outside the allowlist, a duplicate singleton or control character, framing, or a body/argument that fails strict JSON or the closed contract; IDEMPOTENCY_KEY_FORBIDDEN: an Idempotency-Key where the revision (or route) takes none.
- `401` UNAUTHENTICATED: a missing or invalid runtime token, device proof, or mTLS peer, an ineligible session, or assurance below A2.
- `404` NOT_FOUND: an unknown, hidden, or inaccessible capability or object, a query string, or a malformed id; on the Session Store also durable sessions off for the caller's agent deployment; on swarm routes also swarm coordination off for it, or another mission's task, key or session.
- `406` NOT_ACCEPTABLE: an Accept other than the exact media type(s).
- `413` PAYLOAD_TOO_LARGE: more than 32 counted headers, a header value over 4 KiB (Authorization 12 KiB), 24 KiB of headers, or an oversized body.
- `415` UNSUPPORTED_MEDIA_TYPE: a Content-Type other than the exact media type.
- `503` SERVICE_UNAVAILABLE: required local state, the store, the signer, audit capacity, or the executor path is unavailable before safe acceptance (on content access also: no Titan content store configured under full capture).

## Example

```bash
curl --request POST \
  --url 'https://api.hexelstudio.com/v1/titan/agent/local/offline-events' \
  --header "Authorization: Bearer $ACCESS_TOKEN" \
  --header 'Content-Type: CONTENT_TYPE' \
  --header 'Accept: ACCEPT' \
  --header 'Titan-Device-Proof: TITAN_DEVICE_PROOF' \
  --header 'Content-Type: application/json' \
  --data '{
  "events": [
    {
      "count": 0,
      "event_type": "decision",
      "outcome": "allow"
    }
  ],
  "version": 1
}'
```

### Response (200)

```json
{
  "appended": 0,
  "version": 1
}
```

### Response (400)

```json
{
  "error": {
    "code": "INVALID_REQUEST",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (401)

```json
{
  "error": {
    "code": "UNAUTHENTICATED",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (404)

```json
{
  "error": {
    "code": "NOT_FOUND",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (406)

```json
{
  "error": {
    "code": "NOT_ACCEPTABLE",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (413)

```json
{
  "error": {
    "code": "PAYLOAD_TOO_LARGE",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (415)

```json
{
  "error": {
    "code": "UNSUPPORTED_MEDIA_TYPE",
    "message": "string",
    "request_id": "string",
    "retryable": false
  }
}
```

### Response (503)

```json
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "string",
    "request_id": "string",
    "retryable": true
  }
}
```
