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

console.log(target.id);
console.log(target.secret); // store immediately

Options

url
string
required
HTTPS URL that receives webhook deliveries.
org
string | undefined
Organization override.
name
string | undefined
Human-readable target name.
events
string[] | undefined
Event types to subscribe to. Defaults to ['push'] when omitted.
repo_ids
string[] | undefined
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
string
Webhook target ID.
name
string | null
Webhook target name, or null when unnamed.
url
string
Delivery URL.
events
string[]
Event names delivered to this target.
repo_ids
string[] | null
Repository allowlist, or null when the target receives events for all repositories.
created_at
string
Creation time.
updated_at
string
Last update time.
secret
string
Webhook signing secret. Store it immediately; it is shown only once.