/api/orgs/{org_id}/spend-alerts支出アラートを作成する
org_monthly_spendは組織の当月の支出がthreshold_nano_usdに達するとメールを送ります。budget_fractionは予算が上限のthreshold_fractionに達するとメールを送ります。それぞれのkindは専用のフィールドだけを受け付けます。組織管理者またはプロビジョニングキーが必要です。
認証: AuthorizationヘッダーにBearer形式のAPIキー
パスパラメーター
org_idstring必須お客様の組織ID(uuid)。
GET /api/whoamiで取得できます。
リクエストボディ
kindenum必須threshold_nano_usdinteger | null整数のnano-USD。
budget_idstring | nullthreshold_fractionnumber | null予算の上限に対する割合。0.8は80%です。
notify_emailstring必須
レスポンス
201アラート。
レスポンス
alert_idstring必須kindenum必須threshold_nano_usdinteger | null必須budget_idstring | null必須threshold_fractionnumber | null必須notify_emailstring必須created_atstring必須last_eventobject | null必須いずれか
object
periodstring必須YYYY-MM。fired_atstring必須measured_nano_usdinteger必須threshold_nano_usdinteger必須delivered_atstring | null必須delivery_errorstring | null必須
401APIキーがない、不明、または失効しています。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
403キーがプロビジョニングキーではない(推論キーは読み取りを含めて拒否されます)か、顧客プランキーです。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
404不明な組織または予算です。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
409同一のアラートがすでにあります。
レスポンス
errorstring必須人が読めるメッセージ。
codestringエンドポイントが定義している場合の、安定した機械可読の理由(例:
pro_required)。actionstringエンドポイントが定義している場合の、安定した対処アクション。
detailsobject呼び出し元が対処するために必要な、顧客に提示して安全な文字列情報(推奨される識別子など)。
422kindに合わないフィールド、またはボディの検証に失敗しました。
リクエスト
curl -X POST 'https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend-alerts' \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"kind": "budget_fraction",
"budget_id": "c4a2e8f1-7b3d-4e9a-8c15-3f0d6b2a9e71",
"threshold_fraction": 0.8,
"notify_email": "finance@acme.example"
}'レスポンス
{
"alert_id": "3c5e7a9c-1e3b-4d5f-8a0c-2e4a6c8e0b69",
"kind": "budget_fraction",
"threshold_nano_usd": null,
"budget_id": "c4a2e8f1-7b3d-4e9a-8c15-3f0d6b2a9e71",
"threshold_fraction": 0.8,
"notify_email": "finance@acme.example",
"created_at": "2026-11-22T16:10:03Z",
"last_event": null
}https://api.experientiallabs.ai/api/orgs/3f6c2a1e-8b7d-4c2a-9e51-6a0d4b2f7c10/spend-alerts