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

# webhook_targets.create()

> Register a webhook delivery target.

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

**Required scope: `admin`**

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

<ParamField path="url" type="str" required>
  HTTPS URL that receives webhook deliveries.
</ParamField>

<ParamField path="org" type="str | None">
  Organization override.
</ParamField>

<ParamField path="name" type="str | None">
  Human-readable target name.
</ParamField>

<ParamField path="events" type="list[str] | None">
  Event types to subscribe to. Defaults to `['push']` when omitted.
</ParamField>

<ParamField path="repo_ids" type="list[str] | None">
  Restrict deliveries to specific repository IDs. Omit to receive events for all repositories in the organization.
</ParamField>

## 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

<ResponseField name="id" type="str">
  Webhook target ID.
</ResponseField>

<ResponseField name="name" type="str | None">
  Webhook target name, or null when unnamed.
</ResponseField>

<ResponseField name="url" type="str">
  Delivery URL.
</ResponseField>

<ResponseField name="events" type="list[str]">
  Event names delivered to this target.
</ResponseField>

<ResponseField name="repo_ids" type="list[str] | None">
  Repository allowlist, or null when the target receives events for all repositories.
</ResponseField>

<ResponseField name="created_at" type="datetime">
  Creation time.
</ResponseField>

<ResponseField name="updated_at" type="datetime">
  Last update time.
</ResponseField>

<ResponseField name="secret" type="str">
  Webhook signing secret. Store it immediately; it is shown only once.
</ResponseField>
