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

# Create webhook

> Create a new webhook subscription

## Endpoint

```
POST https://api.partnero.com/v1/webhooks
```

## Request Body

| Parameter   | Type    | Required | Description                                       |
| ----------- | ------- | -------- | ------------------------------------------------- |
| `name`      | string  | Yes      | Name for the webhook                              |
| `url`       | string  | Yes      | URL where webhook events will be sent             |
| `events`    | array   | Yes      | Array of event types to subscribe to              |
| `key`       | string  | No       | Custom unique ID (auto-generated if not provided) |
| `is_active` | boolean | No       | Whether the webhook is active (default: true)     |

## Request

```bash cURL theme={null}
curl --location 'https://api.partnero.com/v1/webhooks' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Partner Notifications",
    "url": "https://yourcompany.com/webhooks/partnero",
    "events": [
      "partner.created",
      "partner.approved",
      "transaction.created"
    ]
  }'
```

## Response

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "data": {
      "key": "uLbBzVvN7ARX",
      "name": "Partner Notifications",
      "url": "https://yourcompany.com/webhooks/partnero",
      "is_active": true,
      "signature": "Sjn3sNnmh14yk6zb",
      "events": [
        "partner.created",
        "partner.approved",
        "transaction.created"
      ]
    },
    "status": 1
  }
  ```
</ResponseExample>

<Tip>
  Store the `signature` value securely. You'll need it to verify incoming webhook requests.
</Tip>
