Skip to content

webex_byova.webhooks

webex_byova.webhooks

Webhook management.

__all__ module-attribute

__all__ = ['WebhookManager']

WebhookManager

Register and manage serviceApp webhooks via Integration bearer auth.

__init__

__init__(integration: IntegrationTokenManager, http: HttpClient) -> None

Initialize the webhook manager.

Parameters:

Name Type Description Default
integration IntegrationTokenManager

Integration token manager for bearer authentication.

required
http HttpClient

Shared HTTP client.

required

alist async

alist(*, max: int | None = None, owned_by: str | None = None) -> list[WebhookRegistration]

List all registered webhooks.

Parameters:

Name Type Description Default
max int | None

Maximum number of webhooks to return.

None
owned_by str | None

Filter by webhook owner.

None

Returns:

Type Description
list[WebhookRegistration]

List of webhook registrations.

aget async

aget(webhook_id: str) -> WebhookRegistration

Get a webhook by ID.

Parameters:

Name Type Description Default
webhook_id str

Unique webhook identifier.

required

Returns:

Type Description
WebhookRegistration

Webhook registration details.

alist_service_app_webhooks async

alist_service_app_webhooks(*, target_url: str | None = None, event: str | None = None) -> list[WebhookRegistration]

List serviceApp authorized/deauthorized webhooks.

Parameters:

Name Type Description Default
target_url str | None

Filter by target URL.

None
event str | None

Filter by event name (authorized or deauthorized).

None

Returns:

Type Description
list[WebhookRegistration]

Matching serviceApp webhook registrations.

acreate async

acreate(name: str, target_url: str, *, resource: str = 'serviceApp', event: str) -> WebhookRegistration

Create a new webhook.

Parameters:

Name Type Description Default
name str

Human-readable webhook name.

required
target_url str

HTTPS URL that receives webhook payloads.

required
resource str

Webhook resource type (default serviceApp).

'serviceApp'
event str

Event name (for example authorized).

required

Returns:

Type Description
WebhookRegistration

Created webhook registration.

aupdate async

aupdate(webhook_id: str, payload: WebhookUpdate | dict[str, Any]) -> WebhookRegistration

Update an existing webhook.

Parameters:

Name Type Description Default
webhook_id str

Unique webhook identifier.

required
payload WebhookUpdate | dict[str, Any]

Update payload as a model or dict.

required

Returns:

Type Description
WebhookRegistration

Updated webhook registration.

adelete async

adelete(webhook_id: str) -> None

Delete a webhook.

Parameters:

Name Type Description Default
webhook_id str

Unique webhook identifier.

required

aensure_service_app_webhooks async

aensure_service_app_webhooks(target_url: str) -> list[WebhookRegistration]

Create authorized and deauthorized webhooks if not already registered.

Idempotent: skips events that already have a webhook for target_url.

Parameters:

Name Type Description Default
target_url str

HTTPS URL for webhook delivery.

required

Returns:

Type Description
list[WebhookRegistration]

List of newly created webhook registrations (empty if all exist).

webex_byova.webhooks.manager.WebhookManager

Register and manage serviceApp webhooks via Integration bearer auth.

_integration instance-attribute

_integration = integration

_http instance-attribute

_http = http

__init__

__init__(integration: IntegrationTokenManager, http: HttpClient) -> None

Initialize the webhook manager.

Parameters:

Name Type Description Default
integration IntegrationTokenManager

Integration token manager for bearer authentication.

required
http HttpClient

Shared HTTP client.

required

alist async

alist(*, max: int | None = None, owned_by: str | None = None) -> list[WebhookRegistration]

List all registered webhooks.

Parameters:

Name Type Description Default
max int | None

Maximum number of webhooks to return.

None
owned_by str | None

Filter by webhook owner.

None

Returns:

Type Description
list[WebhookRegistration]

List of webhook registrations.

aget async

aget(webhook_id: str) -> WebhookRegistration

Get a webhook by ID.

Parameters:

Name Type Description Default
webhook_id str

Unique webhook identifier.

required

Returns:

Type Description
WebhookRegistration

Webhook registration details.

alist_service_app_webhooks async

alist_service_app_webhooks(*, target_url: str | None = None, event: str | None = None) -> list[WebhookRegistration]

List serviceApp authorized/deauthorized webhooks.

Parameters:

Name Type Description Default
target_url str | None

Filter by target URL.

None
event str | None

Filter by event name (authorized or deauthorized).

None

Returns:

Type Description
list[WebhookRegistration]

Matching serviceApp webhook registrations.

acreate async

acreate(name: str, target_url: str, *, resource: str = 'serviceApp', event: str) -> WebhookRegistration

Create a new webhook.

Parameters:

Name Type Description Default
name str

Human-readable webhook name.

required
target_url str

HTTPS URL that receives webhook payloads.

required
resource str

Webhook resource type (default serviceApp).

'serviceApp'
event str

Event name (for example authorized).

required

Returns:

Type Description
WebhookRegistration

Created webhook registration.

aupdate async

aupdate(webhook_id: str, payload: WebhookUpdate | dict[str, Any]) -> WebhookRegistration

Update an existing webhook.

Parameters:

Name Type Description Default
webhook_id str

Unique webhook identifier.

required
payload WebhookUpdate | dict[str, Any]

Update payload as a model or dict.

required

Returns:

Type Description
WebhookRegistration

Updated webhook registration.

adelete async

adelete(webhook_id: str) -> None

Delete a webhook.

Parameters:

Name Type Description Default
webhook_id str

Unique webhook identifier.

required

aensure_service_app_webhooks async

aensure_service_app_webhooks(target_url: str) -> list[WebhookRegistration]

Create authorized and deauthorized webhooks if not already registered.

Idempotent: skips events that already have a webhook for target_url.

Parameters:

Name Type Description Default
target_url str

HTTPS URL for webhook delivery.

required

Returns:

Type Description
list[WebhookRegistration]

List of newly created webhook registrations (empty if all exist).