Reference
Errors
HTTP statusで大分類し、typeとcodeで原因を特定し、request_idで一つのリクエストを追跡します。
Error properties
| Property | Meaning |
|---|---|
type | authentication_errorなどの大分類 |
code | invalid_source_urlなどの具体的原因 |
message | 利用者向けの説明 |
request_id | 問い合わせとログ照合に使うID |
param | 問題のある入力項目 |
Example error
400 response
{ "error": { "type": "validation_error", "code": "invalid_source_url", "message": "The source URL could not be fetched.", "request_id": "req_preview_01", "param": "input.url" }}Retryability
| Status | Example | Retry? |
|---|---|---|
400 | 入力が不正 | No — 入力を修正 |
401 | 認証失敗 | No — 鍵を確認 |
404 | リソースなし | No |
409 | 現在状態と競合 | 条件を再取得 |
429 | 一時的な上限超過 | Yes — backoff |
503 | 一時的な停止 | Yes — backoff + jitter |
Backoff
Preview retry
const delayMs = Math.min(1000 * 2 ** attempt, 30000);const jitterMs = Math.random() * delayMs * 0.5;await sleep(delayMs + jitterMs);
