Skip to main content
Create a webhook target. The response includes the signing secret once. Required scope: admin
target = await mesa.webhook_targets.create(
    url="https://example.com/mesa/webhook",
    name="production-webhook",
    events=["push", "change.created"],
    repo_ids=["repo_123"],
)

print(target.id)
print(target.secret)  # store immediately

Options

url
str
required
HTTPS URL that receives webhook deliveries.
org
str | None
Organization override.
name
str | None
Human-readable target name.
events
list[str] | None
Event types to subscribe to. Defaults to ['push'] when omitted.
repo_ids
list[str] | None
Restrict deliveries to specific repository IDs. Omit to receive events for all repositories in the organization.

Event names

Supported event names include repo.created, repo.updated, repo.deleted, bookmark.created, bookmark.deleted, bookmark.moved, bookmark.merged, change.created, change.evolved, push, sync.queued, sync.in_progress, sync.completed, and sync.failed.

Response

id
str
Webhook target ID.
name
str | None
Webhook target name, or null when unnamed.
url
str
Delivery URL.
events
list[str]
Event names delivered to this target.
repo_ids
list[str] | None
Repository allowlist, or null when the target receives events for all repositories.
created_at
datetime
Creation time.
updated_at
datetime
Last update time.
secret
str
Webhook signing secret. Store it immediately; it is shown only once.