Passer au contenu principal
POST
/
api
/
v1
/
webhooks
Create Webhook
curl --request POST \
  --url https://api.agentwallex.com/api/v1/webhooks \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "url": "https://your-app.com/webhooks/agentwallex",
  "events": [
    "payment.completed",
    "payment.failed",
    "policy.violated"
  ],
  "secret": "whsec_your_signing_secret"
}
'
{
  "id": "whk_abc123",
  "url": "https://your-app.com/webhooks/agentwallex",
  "events": [
    "payment.completed",
    "payment.failed",
    "policy.violated"
  ],
  "status": "active",
  "created_at": "2025-06-01T10:00:00Z"
}
Enregistrez un nouveau point de terminaison Webhook pour recevoir des notifications d’événements en temps réel via HTTP POST.

Corps de la requête

url
string
requis
L’URL HTTPS qui recevra les événements du Webhook.
events
string[]
requis
Liste des types d’événements auxquels s’abonner. Consultez Webhooks pour les types d’événements disponibles.
secret
string
requis
Secret de signature utilisé pour vérifier les charges utiles du Webhook. Doit commencer par whsec_.

Exemple

curl -X POST https://api.agentwallex.com/api/v1/webhooks \
  -H "X-API-Key: awx_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-app.com/webhooks/agentwallex",
    "events": ["payment.completed", "payment.failed", "policy.violated"],
    "secret": "whsec_your_signing_secret"
  }'
Response
{
  "id": "whk_abc123",
  "url": "https://your-app.com/webhooks/agentwallex",
  "events": ["payment.completed", "payment.failed", "policy.violated"],
  "status": "active",
  "created_at": "2025-06-01T10:00:00Z"
}

Autorisations

X-API-Key
string
header
requis

API key authentication. Keys are prefixed with awx_.

Corps

application/json
url
string<uri>
requis

The HTTPS URL that will receive webhook events.

events
string[]
requis

List of event types to subscribe to (e.g., payment.completed, payment.failed, policy.violated).

secret
string
requis

Signing secret used to verify webhook payloads. Must start with whsec_.

Réponse

Webhook created successfully.

A registered webhook endpoint for receiving real-time event notifications.

id
string

Unique webhook identifier (e.g., whk_abc123).

url
string<uri>

HTTPS URL that receives webhook events.

events
string[]

List of subscribed event types.

status
enum<string>

Webhook status.

Options disponibles:
active,
inactive
created_at
string<date-time>

ISO 8601 creation timestamp.