OpenPoly logo
Operator Api

Webhook endpoints

Configure webhook endpoint records through the operator API.

Webhook endpoints

Manage webhook endpoints for authenticated operator.

Paths

  • GET /api/operator/webhooks/endpoints
  • POST /api/operator/webhooks/endpoints
  • PATCH /api/operator/webhooks/endpoints/{id}
  • DELETE /api/operator/webhooks/endpoints/{id}
  • POST /api/operator/webhooks/endpoints/{id}/delete

Required scopes and path parameters

EndpointRequired scopeRequired path parameter
GET /api/operator/webhooks/endpointswebhooks:readNone.
POST /api/operator/webhooks/endpointswebhooks:writeNone.
PATCH /api/operator/webhooks/endpoints/{id}webhooks:writeid: positive endpoint ID.
Both delete variantswebhooks:writeid: positive endpoint ID.

Create body

{
  "url": "https://operator.example/webhooks/openpoly",
  "secret": "whsec_...",
  "enabled_events": [
    "mini_app.trade.processed",
    "mini_app.trade.failed"
  ],
  "max_attempts": 6,
  "timeout_seconds": 5
}
FieldTypeRequirementValues/default
urlstringRequiredHTTPS URL. HTTP is accepted only for localhost and 127.0.0.1.
secretstringRequiredNon-empty signing secret; stored encrypted and never returned.
enabled_eventsstringOptionalDefault [], which subscribes to all current event types.
max_attemptspositive integerOptionalDefault 6, maximum 10. Invalid/non-positive input falls back to 6.
timeout_secondspositive integerOptionalDefault 5, maximum 30. Invalid/non-positive input falls back to 5.

Patch body

Every patch field is optional. Omitted values keep the current setting.

FieldTypeRequirementNotes
urlstringOptionalSame validation as create.
secretstringOptionalNon-empty value replaces the stored secret.
enabled_eventsstring or nullOptional[] or null subscribes to all current events.
max_attemptspositive integerOptionalMaximum 10; invalid/non-positive input keeps the current value.
timeout_secondspositive integerOptionalMaximum 30; invalid/non-positive input keeps the current value.
statusstringOptionalactive or disabled.

Rules

  • HTTPS required except localhost or 127.0.0.1
  • empty enabled_events subscribes endpoint to all current event types
  • max_attempts defaults to 6 and is capped at 10
  • timeout_seconds defaults to 5 and is capped at 30
  • invalid events -> 400 INVALID_ENABLED_EVENTS
  • patch status must be active or disabled
  • response exposes has_secret, never raw secret
  • delete returns { "id": number, "deleted": true }

Response fields

  • id
  • url
  • status
  • enabled_events
  • max_attempts
  • timeout_seconds
  • has_secret
  • created_at
  • updated_at
Copyright © 2026