建立組織 Webhook 端點
POST/v1/organizations/webhooks
Requires
anthropic-beta: webhooks-2026-10-07. Learn how to send beta headers.建立組織 webhook 端點。
組織 webhook 端點屬於組織,而非其中某個工作區。一個組織最多可擁有 32 個組織 webhook 端點(無論已啟用或已停用)。
回應中包含端點的簽署密鑰。任何讀取操作都不會傳回此密鑰,因此請在收到時妥善儲存。
每個請求都必須包含 beta 標頭 anthropic-beta: webhooks-2026-10-07。未包含此標頭的請求會傳回 404,就如同此 API 不存在一樣。Anthropic 會為每個組織個別開啟組織 webhook 端點功能;在您的組織開啟之前,請求也會傳回 404。組織 webhook 端點目前為 beta 版,且不適用於已啟用 HIPAA 就緒的組織。
Parameters
Returns
建立組織 Webhook 端點
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.webhooks.BetaNewOrganizationWebhookEndpoint;
import com.anthropic.models.beta.organization.webhooks.WebhookCreateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
WebhookCreateParams params = WebhookCreateParams.builder()
.addEnabledEvent(WebhookCreateParams.EnabledEvent.USER_PROFILE_ENFORCEMENT_ACTION_OPENED)
.addEnabledEvent(WebhookCreateParams.EnabledEvent.USER_PROFILE_ENFORCEMENT_ACTION_RESOLVED)
.url("https://example.com/anthropic-webhooks")
.build();
BetaNewOrganizationWebhookEndpoint betaNewOrganizationWebhookEndpoint = client.beta().organization().webhooks().create(params);
}
}Response 200
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"disabled_reason": "disabled_reason",
"enabled_events": [
"external_key.failed"
],
"name": "name",
"signing_secret": "signing_secret",
"state": "disabled",
"updated_at": "2019-12-27T18:11:19.117Z",
"url": "url"
}Returns Examples
Response 200
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"description": "description",
"disabled_reason": "disabled_reason",
"enabled_events": [
"external_key.failed"
],
"name": "name",
"signing_secret": "signing_secret",
"state": "disabled",
"updated_at": "2019-12-27T18:11:19.117Z",
"url": "url"
}