OpenCourt Developers
API ReferenceWebhook endpoints

Create a webhook endpoint

POST/v1/webhook_endpoints

Subscribe a URL to one or more signal types. Requires the webhook_endpoints:write scope, which is opt-in — a key does not receive it unless it is asked for explicitly.

Every signal_types entry must be permitted by this endpoint’s scopes — a type whose required scope is missing is refused with a 400 naming that scope, never accepted and silently undelivered.

An endpoint can never hold a scope your API key does not hold. Otherwise a narrow key could mint a wide endpoint and read, through the webhook, what its own scopes forbid.

The url must be https, carry no credentials, use the default port, and not resolve to a private or internal address. The signing secret is returned in this response — store it and use it to verify the svix-signature header on every delivery (the Standard Webhooks webhook-signature alias carries the same value and is accepted by the official libraries, but is not the name we send). secret is null while the endpoint is pending; read it later with GET /v1/webhook_endpoints/{id}/secret.

Authorization

bearerAuth
AuthorizationBearer <token>

Your club API key. Send it as Authorization: Bearer oc_live_….

In: header

Header Parameters

OpenCourt-Version?string

The API version to serve this request at, e.g. 2026-11-01. Omit it to use the version your API key is pinned to. An unknown or retired version is a 400 (invalid_api_version / api_version_retired).

Value in"2026-11-01"

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.getopencourt.com/v1/webhook_endpoints" \  -H "Content-Type: application/json" \  -d '{    "url": "https://hooks.example.com/opencourt",    "scopes": [      "customers:read"    ],    "signal_types": [      "customer.created",      "customer.updated"    ]  }'
{
  "id": "8f1b2c3d-4e5f-4a6b-9c7d-0e1f2a3b4c5d",
  "object": "webhook_endpoint",
  "url": "https://hooks.example.com/opencourt",
  "scopes": [
    "customers:read"
  ],
  "signal_types": [
    "customer.created",
    "customer.updated"
  ],
  "status": "active",
  "disabled_reason": null,
  "api_version": "2026-11-01",
  "created_at": "2026-08-28T14:30:00.000Z",
  "secret": "whsec_R2FsYWN0aWNGZWRlcmF0aW9u"
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "request_id": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string",
    "param": "string",
    "request_id": "string"
  }
}