Claude Platform Docs

Webhooks

Unwrap
beta.webhooks.unwrap(payload, headers, key) -> BetaWebhookEvent
Function

Verifies the webhook signature from the webhook-id, webhook-timestamp and webhook-signature headers using your webhook signing key, then parses the payload into an event. Fails if the signature is missing or invalid.

Parse Unverified
beta.webhooks.parse_unverified(payload) -> BetaWebhookEvent
Function

Parses a webhook payload into an event without verifying its signature. Prefer unwrap() unless you have already verified the signature yourself.

Models
class BetaWebhookAgentArchivedEventData: type: "agent.archived"; id; organization_id; workspace_id
type: Literal["agent.archived"]
id: str

ID of the agent that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookAgentCreatedEventData: type: "agent.created"; id; organization_id; workspace_id
type: Literal["agent.created"]
id: str

ID of the agent that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookAgentDeletedEventData: type: "agent.deleted"; id; organization_id; workspace_id
type: Literal["agent.deleted"]
id: str

ID of the agent that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookAgentUpdatedEventData: type: "agent.updated"; id; organization_id; workspace_id
type: Literal["agent.updated"]
id: str

ID of the agent that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentArchivedEventData: type: "deployment.archived"; id; organization_id; workspace_id
type: Literal["deployment.archived"]
id: str

ID of the deployment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentCreatedEventData: type: "deployment.created"; id; organization_id; workspace_id
type: Literal["deployment.created"]
id: str

ID of the deployment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentDeletedEventData: type: "deployment.deleted"; id; organization_id; workspace_id
type: Literal["deployment.deleted"]
id: str

ID of the deployment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentPausedEventData: type: "deployment.paused"; id; organization_id; workspace_id
type: Literal["deployment.paused"]
id: str

ID of the deployment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentRunFailedEventData: type: "deployment_run.failed"; id; organization_id; workspace_id
type: Literal["deployment_run.failed"]
id: str

ID of the deployment run that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentRunStartedEventData: type: "deployment_run.started"; id; organization_id; workspace_id
type: Literal["deployment_run.started"]
id: str

ID of the deployment run that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentRunSucceededEventData: type: "deployment_run.succeeded"; id; organization_id; workspace_id
type: Literal["deployment_run.succeeded"]
id: str

ID of the deployment run that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentUnpausedEventData: type: "deployment.unpaused"; id; organization_id; workspace_id
type: Literal["deployment.unpaused"]
id: str

ID of the deployment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookDeploymentUpdatedEventData: type: "deployment.updated"; id; organization_id; workspace_id
type: Literal["deployment.updated"]
id: str

ID of the deployment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookEnvironmentArchivedEventData: type: "environment.archived"; id; organization_id; workspace_id
type: Literal["environment.archived"]
id: str

ID of the environment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookEnvironmentCreatedEventData: type: "environment.created"; id; organization_id; workspace_id
type: Literal["environment.created"]
id: str

ID of the environment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookEnvironmentDeletedEventData: type: "environment.deleted"; id; organization_id; workspace_id
type: Literal["environment.deleted"]
id: str

ID of the environment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookEnvironmentUpdatedEventData: type: "environment.updated"; id; organization_id; workspace_id
type: Literal["environment.updated"]
id: str

ID of the environment that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookEvent: type: "event"; id; created_at; data
type: Literal["event"]

Object type. Always event for webhook payloads.

id: str

Unique event identifier for idempotency.

created_at: datetime

RFC 3339 timestamp when the event occurred.

formatdate-time
One of the following:
type BetaWebhookEventData = ...
One of the following:
class BetaWebhookMemoryStoreArchivedEventData: type: "memory_store.archived"; id; organization_id; workspace_id
type: Literal["memory_store.archived"]
id: str

ID of the memory store that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookMemoryStoreCreatedEventData: type: "memory_store.created"; id; organization_id; workspace_id
type: Literal["memory_store.created"]
id: str

ID of the memory store that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookMemoryStoreDeletedEventData: type: "memory_store.deleted"; id; organization_id; workspace_id
type: Literal["memory_store.deleted"]
id: str

ID of the memory store that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionArchivedEventData: type: "session.archived"; id; organization_id; workspace_id
type: Literal["session.archived"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionBudgetReachedEventData: type: "session.budget_reached"; id; organization_id; workspace_id
type: Literal["session.budget_reached"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionCreatedEventData: type: "session.created"; id; organization_id; workspace_id
type: Literal["session.created"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionDeletedEventData: type: "session.deleted"; id; organization_id; workspace_id
type: Literal["session.deleted"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionIdledEventData: type: "session.idled"; id; organization_id; workspace_id
type: Literal["session.idled"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionOutcomeEvaluationEndedEventData: type: "session.outcome_evaluation_ended"; id; organization_id; workspace_id
type: Literal["session.outcome_evaluation_ended"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionPendingEventData: type: "session.pending"; id; organization_id; workspace_id
type: Literal["session.pending"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionRequiresActionEventData: type: "session.requires_action"; id; organization_id; workspace_id
type: Literal["session.requires_action"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionRunningEventData: type: "session.running"; id; organization_id; workspace_id
type: Literal["session.running"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionStatusIdledEventData: type: "session.status_idled"; id; organization_id; workspace_id
type: Literal["session.status_idled"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionStatusRescheduledEventData: type: "session.status_rescheduled"; id; organization_id; workspace_id
type: Literal["session.status_rescheduled"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionStatusRunStartedEventData: type: "session.status_run_started"; id; organization_id; workspace_id
type: Literal["session.status_run_started"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionStatusTerminatedEventData: type: "session.status_terminated"; id; organization_id; workspace_id
type: Literal["session.status_terminated"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookSessionThreadCreatedEventData: type: "session.thread_created"; id; organization_id; ... # 2 more
type: Literal["session.thread_created"]
id: str

ID of the session that triggered the event.

organization_id: str
session_thread_id: str

ID of the session thread this event refers to.

workspace_id: str
class BetaWebhookSessionThreadIdledEventData: type: "session.thread_idled"; id; organization_id; ... # 2 more
type: Literal["session.thread_idled"]
id: str

ID of the session that triggered the event.

organization_id: str
session_thread_id: str

ID of the session thread this event refers to.

workspace_id: str
class BetaWebhookSessionThreadTerminatedEventData: type: "session.thread_terminated"; id; organization_id; ... # 2 more
type: Literal["session.thread_terminated"]
id: str

ID of the session that triggered the event.

organization_id: str
session_thread_id: str

ID of the session thread this event refers to.

workspace_id: str
class BetaWebhookSessionUpdatedEventData: type: "session.updated"; id; organization_id; workspace_id
type: Literal["session.updated"]
id: str

ID of the session that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookUserProfileEnforcementActionOpenedEventData: type: "user_profile.enforcement_action_opened"; id; enforcement_action_id; organization_id
type: Literal["user_profile.enforcement_action_opened"]
id: str

ID of the user profile the enforcement action is on.

enforcement_action_id: str

ID (enac_...) of the enforcement action that was opened or resolved.

organization_id: str
class BetaWebhookUserProfileEnforcementActionResolvedEventData: type: "user_profile.enforcement_action_resolved"; id; enforcement_action_id; organization_id
type: Literal["user_profile.enforcement_action_resolved"]
id: str

ID of the user profile the enforcement action is on.

enforcement_action_id: str

ID (enac_...) of the enforcement action that was opened or resolved.

organization_id: str
class BetaWebhookVaultArchivedEventData: type: "vault.archived"; id; organization_id; workspace_id
type: Literal["vault.archived"]
id: str

ID of the vault that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookVaultCreatedEventData: type: "vault.created"; id; organization_id; workspace_id
type: Literal["vault.created"]
id: str

ID of the vault that triggered the event.

organization_id: str
workspace_id: str
class BetaWebhookVaultCredentialArchivedEventData: type: "vault_credential.archived"; id; organization_id; ... # 2 more
type: Literal["vault_credential.archived"]
id: str

ID of the vault credential that triggered the event.

organization_id: str
vault_id: str

ID of the vault that owns this credential.

workspace_id: str
class BetaWebhookVaultCredentialCreatedEventData: type: "vault_credential.created"; id; organization_id; ... # 2 more
type: Literal["vault_credential.created"]
id: str

ID of the vault credential that triggered the event.

organization_id: str
vault_id: str

ID of the vault that owns this credential.

workspace_id: str
class BetaWebhookVaultCredentialDeletedEventData: type: "vault_credential.deleted"; id; organization_id; ... # 2 more
type: Literal["vault_credential.deleted"]
id: str

ID of the vault credential that triggered the event.

organization_id: str
vault_id: str

ID of the vault that owns this credential.

workspace_id: str
class BetaWebhookVaultCredentialRefreshFailedEventData: type: "vault_credential.refresh_failed"; id; organization_id; ... # 2 more
type: Literal["vault_credential.refresh_failed"]
id: str

ID of the vault credential that triggered the event.

organization_id: str
vault_id: str

ID of the vault that owns this credential.

workspace_id: str
class BetaWebhookVaultDeletedEventData: type: "vault.deleted"; id; organization_id; workspace_id
type: Literal["vault.deleted"]
id: str

ID of the vault that triggered the event.

organization_id: str
workspace_id: str