Webhook

変更を、だれが・なぜ変えたかと一緒に受け取る

GET/v1/webhook-endpoints

Webhook の送り先を一覧する

このキーを発行した人の送り先を返します。署名の鍵は返しません。

返る項目data の中身 · 200

  • idstring
  • urlstring
  • descriptionstring | null
  • eventTypesstring[]
  • statusenum

    disabled のあいだは集めも送りもしない

    activedisabled
  • disabledReasonstring | null

    Tooon が止めた理由(キーが無効になった・続けて届かなかった など)

  • apiKeyIdstring

    結び付いた API キー

  • createdAtstring (date-time)

起こりうるエラー共通のエラー

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

GET/v1/webhook-endpoints
curl https://tooon.app/api/v1/webhook-endpoints \
  -H "Authorization: Bearer $TOOON_API_KEY"
レスポンス
{
  "data": [
    {
      "id": "clx8k2m0a0001",
      "url": "https://tooon.app/…",
      "description": "…",
      "eventTypes": [
        "…"
      ],
      "status": "active",
      "disabledReason": "…",
      "apiKeyId": "clx8k2m0a0001",
      "createdAt": "2026-11-01T09:00:00.000Z"
    }
  ]
}
POST/v1/webhook-endpoints

Webhook の送り先を登録する

このキーに結び付けて送り先を登録します。登録したあとに起きた変更から、約1分後に送ります。応答の signingSecret はこのときだけ返します。ワークスペースで10件まで。

送る項目JSON · 3項目

  • urlstring必須

    送り先(https:// で始まる公開されたURL)

    2,000文字まで

  • descriptionstring | null

    200文字まで

  • eventTypesstring[]

    受け取る種類(変更の記録の type の前方一致。例 task は task.status も含む)。空ならすべて。画面での操作も API と同じ type で届く: partner_invoice_request.sent / submitted / approved / revision_requested / payment_scheduled / paid / canceled、invoice.issued / paid / payment_unmatched、settlement.paid / unpaid

    20以下件

返る項目data の中身 · 201

  • idstring
  • urlstring
  • descriptionstring | null
  • eventTypesstring[]
  • statusenum

    disabled のあいだは集めも送りもしない

    activedisabled
  • disabledReasonstring | null

    Tooon が止めた理由(キーが無効になった・続けて届かなかった など)

  • apiKeyIdstring

    結び付いた API キー

  • createdAtstring (date-time)
  • signingSecretstring | null

    署名の鍵(whsec_…)。この応答でだけ返します。同じ Idempotency-Key での再送では null(鍵は控えに残しません)

起こりうるエラー共通のエラー

  • 400invalid_request

    送った値が正しくない。message にどこが違うかが入ります

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

POST/v1/webhook-endpoints
curl -X POST https://tooon.app/api/v1/webhook-endpoints \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://tooon.app/…"
}'
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "url": "https://tooon.app/…",
    "description": "…",
    "eventTypes": [
      "…"
    ],
    "status": "active",
    "disabledReason": "…",
    "apiKeyId": "clx8k2m0a0001",
    "createdAt": "2026-11-01T09:00:00.000Z",
    "signingSecret": "…"
  }
}
GET/v1/webhook-endpoints/{id}

Webhook の送り先を取得する

パスの値

  • idstring必須

    100文字まで

返る項目data の中身 · 200

  • idstring
  • urlstring
  • descriptionstring | null
  • eventTypesstring[]
  • statusenum

    disabled のあいだは集めも送りもしない

    activedisabled
  • disabledReasonstring | null

    Tooon が止めた理由(キーが無効になった・続けて届かなかった など)

  • apiKeyIdstring

    結び付いた API キー

  • createdAtstring (date-time)

起こりうるエラー共通のエラー

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

GET/v1/webhook-endpoints/{id}
curl https://tooon.app/api/v1/webhook-endpoints/clx8k2m0a0001 \
  -H "Authorization: Bearer $TOOON_API_KEY"
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "url": "https://tooon.app/…",
    "description": "…",
    "eventTypes": [
      "…"
    ],
    "status": "active",
    "disabledReason": "…",
    "apiKeyId": "clx8k2m0a0001",
    "createdAt": "2026-11-01T09:00:00.000Z"
  }
}
PATCH/v1/webhook-endpoints/{id}

Webhook の送り先を変える・止める・また動かす

status: disabled で止め、active でまた動かします。また動かしたときは、その時点より後の変更から送ります(止めていたあいだの変更はさかのぼって送りません)。

パスの値

  • idstring必須

    100文字まで

送る項目JSON · 4項目

  • urlstring

    送り先(https:// で始まる公開されたURL)

    2,000文字まで

  • descriptionstring | null

    200文字まで

  • eventTypesstring[]

    受け取る種類(変更の記録の type の前方一致。例 task は task.status も含む)。空ならすべて。画面での操作も API と同じ type で届く: partner_invoice_request.sent / submitted / approved / revision_requested / payment_scheduled / paid / canceled、invoice.issued / paid / payment_unmatched、settlement.paid / unpaid

    20以下件

  • statusenum
    activedisabled

返る項目data の中身 · 200

  • idstring
  • urlstring
  • descriptionstring | null
  • eventTypesstring[]
  • statusenum

    disabled のあいだは集めも送りもしない

    activedisabled
  • disabledReasonstring | null

    Tooon が止めた理由(キーが無効になった・続けて届かなかった など)

  • apiKeyIdstring

    結び付いた API キー

  • createdAtstring (date-time)

起こりうるエラー共通のエラー

  • 400invalid_request

    送った値が正しくない。message にどこが違うかが入ります

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

PATCH/v1/webhook-endpoints/{id}
curl -X PATCH https://tooon.app/api/v1/webhook-endpoints/clx8k2m0a0001 \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://tooon.app/…",
  "description": "…",
  "eventTypes": [
    "…"
  ]
}'
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "url": "https://tooon.app/…",
    "description": "…",
    "eventTypes": [
      "…"
    ],
    "status": "active",
    "disabledReason": "…",
    "apiKeyId": "clx8k2m0a0001",
    "createdAt": "2026-11-01T09:00:00.000Z"
  }
}
GET/v1/webhook-endpoints/{id}/deliveries

Webhook を送った記録を一覧する

新しい順。届かなかったものは lastError に理由が入ります。

パスの値

  • idstring必須

    100文字まで

クエリ

  • statusenum
    pendingsucceededfailed
  • cursorstring

    100文字まで

  • limitinteger

    1〜100

返る項目data の中身 · 200

  • idstring
  • eventIdstring

    変更の記録の id(送り直しても同じ)

  • typestring
  • statusenum
    pendingsucceededfailed
  • attemptsinteger
  • nextAttemptAtstring (date-time) | null
  • lastStatusCodeinteger | null
  • lastErrorstring | null
  • deliveredAtstring (date-time) | null
  • createdAtstring (date-time)

起こりうるエラー共通のエラー

  • 400invalid_request

    送った値が正しくない。message にどこが違うかが入ります

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

GET/v1/…/{id}/deliveries
curl https://tooon.app/api/v1/webhook-endpoints/clx8k2m0a0001/deliveries \
  -H "Authorization: Bearer $TOOON_API_KEY"
レスポンス
{
  "data": [
    {
      "id": "clx8k2m0a0001",
      "eventId": "clx8k2m0a0001",
      "type": "…",
      "status": "pending",
      "attempts": 0,
      "nextAttemptAt": "2026-11-01T09:00:00.000Z",
      "lastStatusCode": 0,
      "lastError": "…",
      "deliveredAt": "2026-11-01T09:00:00.000Z",
      "createdAt": "2026-11-01T09:00:00.000Z"
    }
  ],
  "nextCursor": null
}
POST/v1/webhook-endpoints/{id}/rotate-secret

Webhook の署名の鍵を作り直す

新しい鍵をこの応答でだけ返します。前の鍵で署名したものは、この後は送りません。

パスの値

  • idstring必須

    100文字まで

返る項目data の中身 · 200

  • idstring
  • urlstring
  • descriptionstring | null
  • eventTypesstring[]
  • statusenum

    disabled のあいだは集めも送りもしない

    activedisabled
  • disabledReasonstring | null

    Tooon が止めた理由(キーが無効になった・続けて届かなかった など)

  • apiKeyIdstring

    結び付いた API キー

  • createdAtstring (date-time)
  • signingSecretstring | null

    署名の鍵(whsec_…)。この応答でだけ返します。同じ Idempotency-Key での再送では null(鍵は控えに残しません)

起こりうるエラー共通のエラー

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

POST/v1/…/{id}/rotate-secret
curl -X POST https://tooon.app/api/v1/webhook-endpoints/clx8k2m0a0001/rotate-secret \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "url": "https://tooon.app/…",
    "description": "…",
    "eventTypes": [
      "…"
    ],
    "status": "active",
    "disabledReason": "…",
    "apiKeyId": "clx8k2m0a0001",
    "createdAt": "2026-11-01T09:00:00.000Z",
    "signingSecret": "…"
  }
}
POST/v1/webhook-endpoints/{id}/test

Webhook の送り先に確認を1件送る

type: ping を署名つきで1件送り、相手の返事を返します。記録には残しません。

パスの値

  • idstring必須

    100文字まで

返る項目data の中身 · 200

  • okboolean
  • statusCodeinteger | null
  • errorstring | null

起こりうるエラー共通のエラー

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

POST/v1/…/{id}/test
curl -X POST https://tooon.app/api/v1/webhook-endpoints/clx8k2m0a0001/test \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
レスポンス
{
  "data": {
    "ok": true,
    "statusCode": 0,
    "error": "…"
  }
}
POST/v1/webhook-endpoints/{id}/deliveries/{deliveryId}/retry

届かなかった Webhook を送り直す

届かなかった(failed)1件を、次の送信(約1分以内)で送り直します。送り先が止まっているときは送りません。

パスの値

  • idstring必須

    100文字まで

  • deliveryIdstring必須

    100文字まで

返る項目data の中身 · 200

  • idstring
  • status"pending"

起こりうるエラー共通のエラー

  • 403insufficient_scope

    キーにこの入口の権限(scope)が付いていない。requiredScopes に必要な権限が入ります

  • 404not_found

    対象がない、またはこのワークスペースのものではない

POST/v1/…/{id}/deliveries/{deliveryId}/retry
curl -X POST https://tooon.app/api/v1/webhook-endpoints/clx8k2m0a0001/deliveries/clx8k2m0a0001/retry \
  -H "Authorization: Bearer $TOOON_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
レスポンス
{
  "data": {
    "id": "clx8k2m0a0001",
    "status": "pending"
  }
}