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

# Webhook Endpoints

> Register and manage HTTP endpoints to receive real-time webhook event notifications.

You can configure webhook endpoints via the API to be notified about events that happen in your Pursar account, such as successful mobile money charges, completed payouts, or updated customer identity sessions.

***

### Create a Webhook Endpoint

**url** `string` *required*

The HTTPS URL where Pursar should deliver event payloads.

**events** `array` *required*

The list of event types to subscribe to (e.g. `["charge.successful", "payment_intent.succeeded", "payout.paid"]`). Use `["*"]` to subscribe to all events.

**description** `string`

An optional description of what this endpoint is used for.

***

### Code Examples

```bash cURL theme={null}
curl -X POST https://api.viarosandbox.com/v1/webhook_endpoints \
  -u sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG: \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/api/webhooks/pursar",
    "description": "Primary backend webhook listener",
    "events": [
      "charge.successful",
      "payment_intent.succeeded",
      "payout.paid"
    ]
  }'
```

```python Python theme={null}
import requests

url = "https://api.viarosandbox.com/v1/webhook_endpoints"
auth = ("sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG", "")

payload = {
    "url": "https://example.com/api/webhooks/pursar",
    "description": "Primary backend webhook listener",
    "events": ["charge.successful", "payment_intent.succeeded", "payout.paid"]
}

response = requests.post(url, auth=auth, json=payload)
print(response.json())
```

```javascript Node.js theme={null}
const axios = require('axios');

async function createWebhookEndpoint() {
  const response = await axios.post(
    'https://api.viarosandbox.com/v1/webhook_endpoints',
    {
      url: 'https://example.com/api/webhooks/pursar',
      description: 'Primary backend webhook listener',
      events: ['charge.successful', 'payment_intent.succeeded', 'payout.paid']
    },
    {
      auth: {
        username: 'sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG',
        password: ''
      }
    }
  );

  console.log(response.data);
}

createWebhookEndpoint();
```

***

### Response

> [!NOTE]
>
> The `secret` field (`whsec_...`) is the endpoint's unique HMAC signing secret. Store it securely on your server to verify incoming webhook signatures.

```json theme={null}
{
  "id": "we_1a2b3c4d5e6f",
  "object": "webhook_endpoint",
  "url": "https://example.com/api/webhooks/pursar",
  "description": "Primary backend webhook listener",
  "status": "enabled",
  "secret": "whsec_7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c",
  "events": [
    "charge.successful",
    "payment_intent.succeeded",
    "payout.paid"
  ],
  "created_at": "2026-11-06T12:00:00Z"
}
```

***

### List Webhook Endpoints

`GET /webhook_endpoints`

Returns a list of all configured webhook endpoints.

```bash cURL theme={null}
curl -G https://api.viarosandbox.com/v1/webhook_endpoints \
  -u sk_test_uLsofsae3tB9Izwgeuy0Mxbh4JIxUPSG:
```


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