> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# webhookTargets.create()

> Register a webhook delivery target.

Create a webhook target. The response includes the signing secret once.

**Required scope: `admin`**

```ts theme={null}
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.

**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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.