ドキュメント
API リファレンス
基本
- URL
https://api.webhookadmin.com/v1- 認証
Authorization: Bearer sk_live_…かsk_test_…。キーの 環境の 中だけを 読み 書きします - 形式
- JSON。
時刻は Unix ミリ秒、 ID は 接頭辞付きの 文字列 - 本文の
上限 - 1.1MB
(超えると 413 too_large) - 一覧
?cursor=&limit=( limitは1〜100、 既定 50) 。 返りは { items, next_cursor }
一覧のcursor とcursor は
エラー
{ "error": "<code>", "message": "<説明>" }| HTTP | error | 内容 |
|---|---|---|
| 401 | unauthorized | キーが |
| 402 | plan_limit | プランの |
| 403 | forbidden | キーの |
| 404 | not_found | 見つからない |
| 409 | conflict | ほかの |
| 413 | too_large | 本文が |
| 422 | invalid | 入力の |
| 429 | rate_limited | 回数制限を |
回数制限
1 分
| プラン | 1 分 |
|---|---|
| Free | 600 |
| Starter | 3,000 |
| Pro | 12,000 |
| Business | 20,000 |
| 応答ヘッダー | 内容 |
|---|---|
x-ratelimit-limit | 1 分 |
x-ratelimit-remaining | この |
x-ratelimit-reset | この |
retry-after | 429 の |
エンドポイント
| メソッド | パス | 権限 |
|---|---|---|
| POST | /v1/messages | messages:send |
| GET | /v1/messages | logs:read |
| GET | /v1/messages/{id} | logs:read |
| POST | /v1/deliveries/{id}/retry | messages:retry |
| GET | /v1/consumers | logs:read |
| POST | /v1/consumers | consumers:write |
| POST | /v1/consumers/{id}/portal | endpoints:write |
| GET | /v1/endpoints | logs:read |
| POST | /v1/endpoints | endpoints:write |
| GET | /v1/endpoints/{id} | logs:read |
| PATCH | /v1/endpoints/{id} | endpoints:write |
| DELETE | /v1/endpoints/{id} | endpoints:write |
| POST | /v1/endpoints/{id}/rotate-secret | endpoints:write |
| POST | /v1/endpoints/{id}/recover | messages:retry |
| GET | /v1/endpoints/{id}/recoveries/{recovery_id} | logs:read |
| GET | /v1/event-types | 不要 |
| POST | /v1/event-types | endpoints:write |
メッセージの送信
POST /v1/messages権限: messages:send
| 入力 | 型 | 内容 |
|---|---|---|
consumer | string | 顧客のexternal_id |
event_type | string | イベントの_ . : -、 |
payload | JSON | 送る |
Idempotency-Key | string | 任意。 |
返り: 202 { id, deliveries }。deliveries は
- 同じ
Idempotency-Keyは24 時間の あいだ 同じ idを返します (本文が 違っても 最初の もの) 。 consumerの顧客が 無ければ、 その 場で 作ります (送信先が 無いので deliveriesは0) 。 - 応答ヘッダー
x-usage-monthに、組織の 今月 (UTC) の 本番の 送信数が 入ります。 - テスト環境の
送信と 試しの 送信は 料金の 対象外で、 1 つの 環境で 1 日 (UTC) 1,000 通までです。 超えると 402 plan_limit。
メッセージの一覧
GET /v1/messages権限: logs:read
クエリ: statuspending / retrying / success / failed)event_type・q・sincecursor・limit。
q はexternal_id・Idempotency-Key の
q・status・event_type をsince を
返り: { items: MessageRow[], next_cursor }。
メッセージの詳細
GET /v1/messages/{id}権限: logs:read
返り: MessageDetail
送信のやり直し
POST /v1/deliveries/{id}/retry権限: messages:retry
id はDelivery の
顧客の一覧
GET /v1/consumers権限: logs:read
クエリ: cursor・limit。{ items: Consumer[], next_cursor }。
顧客の作成
POST /v1/consumers権限: consumers:write
| 入力 | 型 | 内容 |
|---|---|---|
external_id | string | 送る |
name | string | 任意。 |
返り: 201 Consumer。external_id のconflict。
顧客向けの設定画面のリンクの作成
POST /v1/consumers/{id}/portal権限: endpoints:write
| 入力 | 型 | 内容 |
|---|---|---|
frame_origin | string | 任意。https://app.example.com。 |
locale | ja・en | 任意。 |
返り: 201 { url, expires_at }。url はplan_limit、
自社のsrc はurl)
<iframe
src="https://app.webhookadmin.com/portal/eyJlIjoi…?lang=ja"
title="Webhook"
allow="clipboard-write"
style="display: block; width: 100%; height: 900px; border: 0"
></iframe>- 埋め込めるのは
frame_originのオリジンだけです。 frame_originの無いリンクは iframe の 中に 表示されません ( Content-Security-Policy: frame-ancestors)。 - 画面は
クッキーを 使わず、 リンクの トークンで 動きます。 別の ドメインの iframe (Safari を 含む) の 中でも 使えます。 - 顧客が
できる こと: 送信先の 登録・編集・ 一時停止・削除、 受け取る イベントの 選択、 署名の 鍵の 表示と 切り 替え、 試しの 送信、 配信記録と 再送。 urlにクエリ theme=darkを足すと 暗い 配色に なります。
送信先の一覧
GET /v1/endpoints権限: logs:read
クエリ: consumer_id{ items: Endpoint[] }。
送信先の作成
POST /v1/endpoints権限: endpoints:write
| 入力 | 型 | 内容 |
|---|---|---|
consumer_id | string | 顧客のidcon_…) |
url | string | 送信先の |
event_types | string[] | 任意。 |
fixed_ip | boolean | 任意。 |
description | string | 任意。 |
retry | object | 任意。 |
compat_signature | object | 任意。 |
返り: 201 Endpoint とsecret
- URL は
https (ポート 443 か 8443) 。 - IP アドレスを
直接書いた URL・社内向けの 名前・社内アドレスを 指す名前・名前が 引けない ものは 422。 - 1 つの
顧客に 登録できる 送信先は 20 までです。 超えると 422。
送信先の詳細
GET /v1/endpoints/{id}権限: logs:read
返り: Endpoint とrecent: AttemptRow[]・retrying_count・recoverynull)
送信先の変更
PATCH /v1/endpoints/{id}権限: endpoints:write
入力url・event_types・statusactive / paused)description・retry・compat_signature。Endpoint。
pausedにした送信先あての 送信は 保留に なり、 activeに戻すと 今月と 先月の 保留分を まとめて 送ります。 - 自動で
止まった 送信先 ( disabled)は、 statusをactiveにすると 戻ります。 retryはnullで既定に 戻り、 compat_signatureはnullで外れます。
送信先の削除
DELETE /v1/endpoints/{id}権限: endpoints:write
返り: 204。
署名の鍵の切り替え
POST /v1/endpoints/{id}/rotate-secret権限: endpoints:write
返り: { secret }。
まとめて再送
POST /v1/endpoints/{id}/recover権限: messages:retry
| 入力 | 型 | 内容 |
|---|---|---|
since | number | Unix ミリ秒。 |
返り: 202 Recovery。
- この
送信先に 届かずに 失敗で 終わった 送信を、 同じ メッセージ (同じ webhook-id)のまま 送り直します (まとめて 再送 )。 - 送信先が
activeでないときは 409 conflict。再開してから 呼びます。 - 1 つの
送信先で 動けるのは 1 つだけです。 動いている あいだは 409 conflict。
まとめて再送の状態
GET /v1/endpoints/{id}/recoveries/{recovery_id}権限: logs:read
返り: Recovery。status はrunningdonestopped
イベントの種類の一覧
GET /v1/event-types権限: 不要
返り: { items: EventType[] }
イベントの種類の登録
POST /v1/event-types権限: endpoints:write
| 入力 | 型 | 内容 |
|---|---|---|
name | string | イベントの_ . : -、 |
description | string | 任意。 |
返り: 201 EventType。name のconflict。
登録した
再送の設定
再送のretry)
| 項目 | 選べる |
|---|---|
count | 0・1・2・3・5・7・120 は |
interval | progressive1m・5m・30m・1h・6h |
{ "retry": { "count": 3, "interval": "5m" } }- 既定は
count: 7・interval: progressiveです(最初の 送信を 含めて 最大 8 回、 約 28 時間) 。 retry: nullで既定に 戻ります。 - 最初の
送信から 最後の 再送までが 3 日を 超える 組み合わせは 選べません (422) 。 当たるのは progressiveと12の組み合わせです。 - 失敗が
5 日続いた 送信先の 自動停止は、 再送の 設定とは 別に 数えます。
まとめて再送
送信先のwebhook-id)
- 管理画面
- 送信先の
詳細 - API
POST /v1/endpoints/{id}/recover(入力と 返り )- MCP
recover_endpoint・get_recovery- 顧客向けの
設定画面 - 顧客が
自分の 送信先に ついて 実行できます
- キューで
少しずつ 送ります (10 秒ごとに 50 通) 。 送信先の 同時接続の 枠が 埋まっている あいだは 待ちます。 - 対象は、
始めた 時点で 失敗で 終わっていた 送信です。 その後に 失敗した ものや、 1 通ずつ送り直した ものは 含みません。 - 自動で
止まっていた ( disabled)あいだの メッセージは、 送信先あての 記録が 無いため対象に なりません。 一時停止 ( paused)の あいだの 送信は 保留に なっており、 再開した ときに 送ります。 - 途中で
送信先を 止める ・削除すると、 そこで 終わります ( stopped)。 - 使用量には
数えません。
失敗の通知の条件
失敗のupdate_alert_conditions で
| 条件 | 選べる | 既定 |
|---|---|---|
| 送信の | 最初の | 60 分 |
| 自動停止 | 失敗が | — |
| 再送待ちの | 環境の | 1,000 通 |
| 使用量 | 今月の | 80% |
- 送信の
失敗は、 どの 設定でも 再送を 使い 切った ときに 知らせます。 同じ 送信先の 通知は 1 時間に 1 回までです。 - 同じ
組織への 送信の 失敗の 通知は、 1 時間に 1 通まですぐ 送ります。 その 1 時間に 失敗し始めた ほかの 送信先は、 1 時間ごとに 1 通に まとめて 送ります。 - 再送待ちの
件数は 送信先ごとではなく、 環境の 合計で 数えます。 - 組織の
owner には、 この 条件とは 別に、 使用量が 上限の 80%・100% に 届いた ときに メールで 知らせます。
型
MessageRow = { id, event_type, consumer: { id, external_id, name }, created_at,
status: 'success' | 'retrying' | 'failed' | 'pending', attempts, endpoint_url }
MessageDetail = { id, event_type, consumer, created_at, idempotency_key, payload, deliveries: Delivery[] }
Delivery = { id, endpoint_id, url, status: 'pending' | 'success' | 'retrying' | 'failed',
attempt_count, next_attempt_at, attempts: AttemptRow[] }
AttemptRow = { id, at, response_status, response_head, duration_ms, error,
via: 'direct' | 'relay', source_ip }
Consumer = { id, external_id, name, created_at, endpoint_count }
Endpoint = { id, consumer_id, url, description, event_types: string[] | null, fixed_ip,
status: 'active' | 'paused' | 'disabled', disabled_reason, failing_since, created_at,
retry: RetryPolicy, compat_signature: CompatSignature | null }
RetryPolicy = { count: 0 | 1 | 2 | 3 | 5 | 7 | 12,
interval: 'progressive' | '1m' | '5m' | '30m' | '1h' | '6h' }
CompatSignature = { header, content: 'body' | 'timestamp_body', encoding: 'hex' | 'base64', prefix }
Recovery = { id, endpoint_id, since, status: 'running' | 'done' | 'stopped',
total, queued, created_at, finished_at }
EventType = { name, description, archived_at }