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

# Webhooks

> Create and manage webhook endpoints

Webhook endpoints receive event notifications from StellarTools when things happen in your account. See the [Webhooks guide](/webhooks) for the full list of event types and how to handle deliveries.

## The webhook object

<ResponseField name="id" type="string">
  Unique identifier. Prefixed with `wh_`.
</ResponseField>

<ResponseField name="object" type="string">
  Always `"webhook"`.
</ResponseField>

<ResponseField name="name" type="string">
  A label for this endpoint.
</ResponseField>

<ResponseField name="url" type="string">
  The HTTPS URL that receives event POSTs.
</ResponseField>

<ResponseField name="events" type="array">
  List of event types this endpoint is subscribed to.
</ResponseField>

<ResponseField name="is_disabled" type="boolean">
  When `true`, deliveries to this endpoint are suspended.
</ResponseField>

<ResponseField name="description" type="string">
  Optional description.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp.
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp.
</ResponseField>

***

## Create a webhook

`POST /webhooks`

```bash theme={null}
curl https://api.stellartools.dev/webhooks \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production handler",
    "url": "https://yourapp.com/webhooks",
    "events": ["payment.confirmed", "subscription.canceled"]
  }'
```

### Body

<ParamField body="name" type="string" required>
  Label for this endpoint.
</ParamField>

<ParamField body="url" type="string" required>
  The HTTPS URL to send events to.
</ParamField>

<ParamField body="events" type="array" required>
  Event types to subscribe to. At least one required. See [event types](/webhooks#event-types).
</ParamField>

<ParamField body="description" type="string">
  Optional description.
</ParamField>

***

## Retrieve a webhook

`GET /webhooks/{id}`

```bash theme={null}
curl https://api.stellartools.dev/webhooks/wh_01jx... \
  -H "x-api-key: YOUR_API_KEY"
```

***

## Update a webhook

`PUT /webhooks/{id}`

```bash theme={null}
curl -X PUT https://api.stellartools.dev/webhooks/wh_01jx... \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "is_disabled": true }'
```

### Body

<ParamField body="name" type="string">
  New label.
</ParamField>

<ParamField body="url" type="string">
  New destination URL.
</ParamField>

<ParamField body="events" type="array">
  Updated event type list. At least one required.
</ParamField>

<ParamField body="is_disabled" type="boolean">
  Set to `true` to pause deliveries, `false` to resume.
</ParamField>

<ParamField body="description" type="string">
  New description.
</ParamField>

***

## Delete a webhook

`DELETE /webhooks/{id}`

```bash theme={null}
curl -X DELETE https://api.stellartools.dev/webhooks/wh_01jx... \
  -H "x-api-key: YOUR_API_KEY"
```
