HATO API

The Pigeon Post Office

📘 Manual Sign in Create account
API Reference →

Letterbox API

GET /api/v1/letterbox/
List Letterbox entries

Retrieve a cursor-paginated list of Letterbox response metadata, ordered newest first.

Headers
Authorizationrequired Bearer hato_live_...
If-None-Match Optional ETag for 304 conditional cache validation.
Query Parameters
ParameterDescription
limitinteger Number of records to return (1–100, default: 50).
cursorstring Opaque pagination cursor from previous response.
sinceISO-8601 Filter entries sent on or after datetime (e.g. 2026-08-01T00:00:00Z).
untilISO-8601 Filter entries sent on or before datetime.
letterflow_idinteger Filter entries by Letterflow ID.
run_idUUID Filter entries by run ID.
status_codeinteger Filter by HTTP/FTP response code (e.g. 200, 404, 500).
pinnedboolean Filter by pinned state: 'true' or 'false'.
Responses
200 OK Returns array of entries and optional next_cursor.
400 Bad Request Invalid parameter or cursor format.
401 Unauthorized Missing or invalid Bearer API key.
cURL
curl -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/?limit=20&pinned=true"
Response (200 OK)
{
  "data": [
    {
      "id": 42,
      "letterflow_id": 7,
      "letterflow_name": "Health Check",
      "source_type": "letter",
      "run_id": null,
      "steps_url": null,
      "request": {
        "method": "GET"
      },
      "response": {
        "status_code": 200
      },
      "duration_ms": 142,
      "sent_at": "2026-08-28T14:30:00+00:00",
      "request_sent_at": "2026-08-28T14:30:00.010000+00:00",
      "response_received_at": "2026-08-28T14:30:00.152000+00:00",
      "is_pinned": true,
      "bodies_pruned": false,
      "error_message": "",
      "region": "au",
      "spoke_id": "spoke-au-1",
      "artifact_available": true,
      "request_headers_url": "https://spoke-au.example/artifacts/...",
      "request_body_url": null,
      "response_headers_url": "https://spoke-au.example/artifacts/...",
      "response_body_url": "https://spoke-au.example/artifacts/..."
    }
  ],
  "next_cursor": "eyJzZW50X2F0IjoiMjAyNi0wOC0yOFQxNDozMDowMCIsImlkIjo0Mn0"
}
GET /api/v1/letterbox/{id}/
Get entry metadata

Retrieve full metadata for a single Letterbox response by ID, including fresh signed regional artifact URLs.

URI Parameters
idintegerrequired The unique ID of the Letterbox entry.
Responses
200 OK Entry metadata successfully returned.
404 Not Found Entry does not exist or belongs to another user.
cURL
curl -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/42/"
Response (200 OK)
{
  "data": {
    "id": 42,
    "letterflow_id": 7,
    "letterflow_name": "Health Check",
    "source_type": "letter",
    "run_id": null,
    "steps_url": null,
    "request": {
      "method": "GET"
    },
    "response": {
      "status_code": 200
    },
    "duration_ms": 142,
    "sent_at": "2026-08-28T14:30:00+00:00",
    "request_sent_at": "2026-08-28T14:30:00.010000+00:00",
    "response_received_at": "2026-08-28T14:30:00.152000+00:00",
    "is_pinned": false,
    "bodies_pruned": false,
    "error_message": "",
    "region": "au",
    "spoke_id": "spoke-au-1",
    "artifact_available": true,
    "request_headers_url": "https://spoke-au.example/artifacts/read?token=...",
    "request_body_url": null,
    "response_headers_url": "https://spoke-au.example/artifacts/read?token=...",
    "response_body_url": "https://spoke-au.example/artifacts/read?token=..."
  }
}

Inspect Letterflow steps

Use the component ID returned by the step list. IDs are case-sensitive and refer to the Letterflow as it was when the run was recorded.

GET /api/v1/letterbox/{id}/steps/
GET /api/v1/letterbox/{id}/steps/{step_id}/
GET /api/v1/letterbox/{id}/steps/{step_id}/input/
GET /api/v1/letterbox/{id}/steps/{step_id}/output/
POST /api/v1/letterbox/{id}/native-inspection/

Step inspection requires letterbox:read and redirects to the selected region. Attempted components appear in execution order, followed by skipped components. Skipped inputs remain readable; unproduced outputs return 404. Stored results are never re-evaluated.

Use the inspection renewal endpoint to refresh access to a component selection or retrieve a signed URL for its recorded content. Expired content returns HTTP 410.

Letter step metadata includes the recorded http_version when available. This is the final response's negotiated protocol, not the client's preference.

Send the Bearer key to Hato API. Fetch signed regional URLs with a separate request without forwarding your API key.

GET /api/v1/letterbox/{id}/{artifact}/
Download entry artifacts

Use this endpoint when entry metadata provides an artifact link. It redirects to a short-lived regional URL. Fetch the regional Location separately without forwarding your API key. For artifacts from individual components, use the step inspection endpoints.

URI Parameters
idintegerrequired Letterbox entry ID.
artifactstringrequired One of: request-headers, request-body, response-headers, response-body.
Responses
302 Found Redirects to signed direct Spoke URL (valid for 5 minutes).
404 Not Found The artifact is unavailable or does not exist.
410 Gone The artifact has expired or been removed under the retention policy.
cURL (two requests)
curl -sS -D - -o /dev/null -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/42/response-body/"

curl -o response_payload.json "REGIONAL_LOCATION_URL"
Redirect Headers (302 Found)
HTTP/1.1 302 Found
Location: https://spoke-au.example/artifacts/read?token=ey...
Cache-Control: private, no-store
PATCH /api/v1/letterbox/{id}/
Pin or unpin entry

Pin or unpin a Letterbox entry. Pinning protects the response body from expiration and FIFO capacity pruning.

Request Body
FieldTypeDescription
is_pinnedrequired boolean Set true to pin, false to unpin.
Responses
200 OK Pin state successfully updated.
400 Bad Request Invalid JSON payload or capacity limit reached (at least 1 response must remain unpinned when at capacity).
404 Not Found Entry does not exist.
cURL
curl -X PATCH \
     -H "Authorization: Bearer $HATO_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"is_pinned": true}' \
     "https://hato-api.example/api/v1/letterbox/42/"
Response (200 OK)
{
  "data": {
    "id": 42,
    "letterflow_id": 7,
    "letterflow_name": "Health Check",
    "source_type": "letter",
    "run_id": null,
    "steps_url": null,
    "request": {
      "method": "GET"
    },
    "response": {
      "status_code": 200
    },
    "duration_ms": 142,
    "sent_at": "2026-08-28T14:30:00+00:00",
    "request_sent_at": "2026-08-28T14:30:00.010000+00:00",
    "response_received_at": "2026-08-28T14:30:00.152000+00:00",
    "is_pinned": true,
    "bodies_pruned": false,
    "error_message": "",
    "region": "au",
    "spoke_id": "spoke-au-1",
    "artifact_available": true,
    "request_headers_url": "https://spoke-au.example/artifacts/read?token=...",
    "request_body_url": null,
    "response_headers_url": "https://spoke-au.example/artifacts/read?token=...",
    "response_body_url": "https://spoke-au.example/artifacts/read?token=..."
  }
}
DELETE /api/v1/letterbox/{id}/
Delete single entry

Permanently deletes a single response record and triggers cleanup of stored artifacts from the regional Spoke.

URI Parameters
idintegerrequired The unique ID of the Letterbox entry to delete.
Responses
204 No Content Entry permanently deleted.
404 Not Found Entry does not exist.
cURL
curl -X DELETE \
     -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/42/"
DELETE /api/v1/letterbox/
Clear all unpinned entries

Deletes all unpinned Letterbox responses and immediately deletes their artifacts from regional storage. If a Spoke is temporarily unavailable, cleanup is queued for retry.

Responses
204 No Content All unpinned entries were successfully cleared.
401 Unauthorized Missing or invalid Bearer API key.
cURL
curl -X DELETE \
     -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/"