HATO API

비둘기 우체국

📘 매뉴얼 로그인 계정 만들기
API 레퍼런스 →

레터박스 API

GET /api/v1/letterbox/
레터박스 항목 목록 조회

최신순으로 정렬된 레터박스 응답 메타데이터의 커서 페이지네이션 목록을 조회합니다.

헤더
Authorization필수 Bearer hato_live_...
If-None-Match 304 조건부 캐시 검증을 위한 선택적 ETag.
쿼리 매개변수
매개변수설명
limitinteger 반환할 레코드 수(1~100, 기본값: 50).
cursorstring 이전 응답에서 반환된 페이지네이션 커서.
sinceISO-8601 지정된 일시 이후에 전송된 항목 필터링(예: 2026-08-01T00:00:00Z).
untilISO-8601 지정된 일시 이전에 전송된 항목 필터링.
letterflow_idinteger 레터플로 ID로 항목을 필터링합니다.
run_idUUID 실행 ID로 항목을 필터링합니다.
status_codeinteger HTTP/FTP 응답 코드로 필터링(예: 200, 404, 500).
pinnedboolean 고정 상태('true' 또는 'false')로 필터링.
응답
200 OK 항목 배열과 선택적 next_cursor를 반환합니다.
400 Bad Request 매개변수 또는 커서 형식이 잘못되었습니다.
401 Unauthorized Bearer API 키가 누락되었거나 유효하지 않습니다.
cURL
curl -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/?limit=20&pinned=true"
응답 (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}/
항목 메타데이터 조회

ID를 기반으로 단일 레터박스 응답의 전체 메타데이터(새로 서명된 리전 아티팩트 URL 포함)를 조회합니다.

URI 매개변수
idinteger필수 레터박스 항목의 고유 ID.
응답
200 OK 항목 메타데이터가 성공적으로 반환되었습니다.
404 Not Found 항목이 존재하지 않거나 다른 사용자에게 속해 있습니다.
cURL
curl -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/42/"
응답 (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=..."
  }
}

레터플로 단계 살펴보기

단계 목록에서 반환된 컴포넌트 ID를 사용하세요. ID는 대소문자를 구분하며 실행이 기록될 당시의 레터플로를 기준으로 합니다.

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/

단계 조회에는 letterbox:read가 필요하며 지정 리전으로 리다이렉트됩니다. 실행을 시도한 컴포넌트가 실행 순서로 표시된 후 건너뛴 컴포넌트가 표시됩니다. 건너뛴 입력은 읽을 수 있지만 생성되지 않은 출력은 404를 반환합니다. 저장된 결과는 다시 평가하지 않습니다.

검사 갱신 엔드포인트를 사용하면 선택한 컴포넌트에 다시 접근하거나 기록된 콘텐츠의 서명된 URL을 가져올 수 있습니다. 만료된 콘텐츠에는 HTTP 410이 반환됩니다.

레터 단계 메타데이터에는 기록된 http_version이 있으면 포함됩니다. 이는 클라이언트의 선호 설정이 아닌 최종 응답에서 협상된 프로토콜입니다.

Bearer 키는 Hato API에 보내세요. 리전의 서명된 URL에 접근할 때는 API 키를 전달하지 않고 별도로 요청하세요.

GET /api/v1/letterbox/{id}/{artifact}/
항목의 아티팩트 다운로드

항목 메타데이터에 아티팩트 링크가 있으면 이 엔드포인트를 사용하세요. 유효 기간이 짧은 리전 URL로 리디렉션됩니다. Location의 리전 URL은 API 키를 전달하지 않고 별도로 요청하세요. 개별 컴포넌트의 아티팩트는 단계 검사 엔드포인트를 사용하세요.

URI 매개변수
idinteger필수 레터박스 항목 ID.
artifactstring필수 다음 중 하나: request-headers, request-body, response-headers, response-body.
응답
302 Found 서명된 Spoke 직접 URL로 리다이렉트합니다(5분간 유효).
404 Not Found 아티팩트를 사용할 수 없거나 존재하지 않습니다.
410 Gone 아티팩트가 만료되었거나 보존 정책에 따라 제거되었습니다.
cURL(두 번의 요청)
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"
리다이렉트 헤더 (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}/
항목 고정 또는 고정 해제

레터박스 항목을 고정하거나 고정 해제합니다. 고정 시 응답 본문이 만료 및 FIFO 용량 삭제로부터 보호됩니다.

요청 본문
항목타입설명
is_pinned필수 boolean 고정하려면 true, 고정을 해제하려면 false로 설정합니다.
응답
200 OK 고정 상태가 성공적으로 업데이트되었습니다.
400 Bad Request 잘못된 JSON 페이로드이거나 용량 한도에 도달했습니다(용량이 가득 찼을 때 최소 1개의 응답은 고정되지 않은 상태여야 합니다).
404 Not Found 항목이 존재하지 않습니다.
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/"
응답 (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}/
단일 항목 삭제

단일 응답 레코드를 영구적으로 삭제하고 리전 Spoke에 저장된 아티팩트 정리를 트리거합니다.

URI 매개변수
idinteger필수 삭제할 레터박스 항목의 고유 ID.
응답
204 No Content 항목이 영구적으로 삭제되었습니다.
404 Not Found 항목이 존재하지 않습니다.
cURL
curl -X DELETE \
     -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/42/"
DELETE /api/v1/letterbox/
고정되지 않은 모든 항목 비우기

고정하지 않은 레터박스 결과를 모두 삭제하고 관련 리전 아티팩트도 삭제합니다. Spoke를 일시적으로 사용할 수 없으면 정리 작업을 재시도 큐에 넣습니다.

응답
204 No Content 고정되지 않은 모든 항목이 성공적으로 삭제되었습니다.
401 Unauthorized Bearer API 키가 누락되었거나 유효하지 않습니다.
cURL
curl -X DELETE \
     -H "Authorization: Bearer $HATO_API_KEY" \
     "https://hato-api.example/api/v1/letterbox/"