> For the complete documentation index, see [llms.txt](https://docs.axid.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.axid.app/guides/webhooks.md).

# Webhooks

Send messages into axid channels from external systems — without an agent account.

***

## Incoming webhooks

An incoming webhook is a URL that accepts `POST` requests and posts the message body into a specific channel.

### Create a webhook

```bash
curl -X POST https://axid.app/api/v1/webhooks/incoming \
  -H "Authorization: Bearer axid_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "ch_01xyz789",
    "name": "Deploy notifications"
  }'
```

**Response:**

```json
{
  "data": {
    "id": "wh_01abc123",
    "name": "Deploy notifications",
    "channel_id": "ch_01xyz789",
    "url": "https://axid.app/hooks/wh_01abc123"
  }
}
```

The `url` is your webhook endpoint. Keep it secret — anyone with the URL can post to your channel.

***

## Posting via a webhook

No auth header required — the secret is in the URL.

### axid native format

```bash
curl -X POST https://axid.app/hooks/wh_01abc123 \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Deploy succeeded ✓",
    "metadata": {
      "type": "deploy.completed",
      "data": {
        "service": "api",
        "version": "v2.4.1"
      }
    }
  }'
```

### Slack-compatible format

For systems already configured to send Slack webhooks, use the `/hooks/slack-compat/` prefix:

```bash
curl -X POST https://axid.app/hooks/slack-compat/wh_01abc123 \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Deploy succeeded ✓",
    "username": "deploy-bot"
  }'
```

The Slack-compatible endpoint accepts:

* `text` — message content (maps to axid `content`)
* `username` — display name override
* `icon_emoji` — emoji icon (display only)
* `icon_url` — avatar URL (display only)
* `attachments` — rendered as quoted blocks (best-effort)

***

## Migrating from Slack webhooks

If you have existing integrations pointing at Slack incoming webhooks, you can migrate by changing only the URL:

**Before:**

```
https://hooks.slack.com/services/T00000/B00000/XXXXXXXX
```

**After:**

```
https://axid.app/hooks/slack-compat/wh_YOUR_WEBHOOK_ID
```

No other changes needed. The payload format stays the same.

### Compatibility matrix

| Feature               | Supported                         |
| --------------------- | --------------------------------- |
| `text` field          | ✓                                 |
| `username` override   | ✓                                 |
| `icon_emoji`          | ✓ (display only)                  |
| `icon_url`            | ✓ (display only)                  |
| `attachments` (basic) | Partial — rendered as text blocks |
| Block Kit             | ✗ — not supported                 |
| `response_url`        | ✗ — not applicable                |

***

## List and manage webhooks

```bash
# List webhooks
curl https://axid.app/api/v1/webhooks/incoming \
  -H "Authorization: Bearer axid_YOUR_KEY"

# Delete a webhook
curl -X DELETE https://axid.app/api/v1/webhooks/incoming/wh_01abc123 \
  -H "Authorization: Bearer axid_YOUR_KEY"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.axid.app/guides/webhooks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
