Webhook Integration

Configure webhooks to receive real-time event notifications in your external systems

Event Notifications

Webhook Integration

Receive real-time notifications when events occur in your OrbVPN system. Configure webhooks to integrate with your CRM, analytics, or custom applications.

Real-time Events

Receive instant notifications when events occur.

Custom Integration

Connect to any HTTP endpoint.

Secure Delivery

Signed payloads for verification.


Configure Webhook

MUTATION/graphql

Configure a webhook endpoint to receive event notifications. Specify the URL and which events should trigger the webhook.

Authentication:Bearer Token
Required scopes:admin

Request Parameters

urlString!Required

The HTTPS endpoint URL to receive webhook events.

events[String!]!Required

Array of event types to subscribe to.

secretString

Secret key for signing payloads (for verification).

activeBoolean

Whether the webhook is active (default: true).

headersJSON

Custom headers to include with webhook requests.


GraphQL Mutation

mutation configureWebhook($webhook: WebhookInput!) {
  configureWebhook(webhook: $webhook) {
    id
    url
    events
    active
    createdAt
  }
}

Variables:

{
  "webhook": {
    "url": "https://your-app.com/webhooks/orbvpn",
    "events": [
      "subscription.created",
      "subscription.renewed",
      "subscription.expired",
      "user.created",
      "payment.completed"
    ],
    "secret": "your_webhook_secret_key",
    "headers": {
      "X-Custom-Header": "your-value"
    }
  }
}

HTTP Request:

curl -X POST https://api.orbnet.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -d '{
    "query": "mutation configureWebhook($webhook: WebhookInput!) { configureWebhook(webhook: $webhook) { id url events active } }",
    "variables": {
      "webhook": {
        "url": "https://your-app.com/webhooks/orbvpn",
        "events": ["subscription.created", "payment.completed"],
        "secret": "your_secret_key"
      }
    }
  }'

Response

200Webhook Configured
{
  "data": {
    "configureWebhook": {
      "id": "webhook_abc123",
      "url": "https://your-app.com/webhooks/orbvpn",
      "events": [
        "subscription.created",
        "subscription.renewed",
        "subscription.expired",
        "user.created",
        "payment.completed"
      ],
      "active": true,
      "createdAt": "2024-01-15T10:30:00Z"
    }
  }
}

Available Events

subscription.created

New subscription started

subscription.renewed

Subscription renewed

subscription.expired

Subscription ended

user.created

New user registered

payment.completed

Payment processed

device.activated

Device registered


Webhook Payload

{
  "id": "evt_abc123xyz",
  "type": "subscription.created",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "userId": 12345,
    "subscriptionId": 67890,
    "plan": "Pro Monthly",
    "amount": 9.99,
    "currency": "USD"
  },
  "signature": "sha256=..."
}

Best Practices

HTTPS Required

Webhook URLs must use HTTPS for security.

Verify Signatures

Always verify webhook signatures before processing.

Respond Quickly

Return 200 status within 30 seconds.

Handle Retries

Implement idempotency for duplicate deliveries.



Signature Verification

Use the webhook secret to verify payload signatures. Compare the HMAC SHA-256 hash of the payload with the signature header.

Test Your Webhook

Use tools like webhook.site to test your webhook endpoint before deploying to production.

Notification System