Skip to content

Create webhook ​

Interface Description ​

Create a webhook subscription and receive the signing secret once.

Endpoint ​

FieldValue
MethodPOST
Path/openapi/v2/webhooks
Operation IDcreateWebhook
AuthenticationBearer OpenAPI key

Parameters ​

NameLocationRequiredTypeExampleDescription
Idempotency-KeyheaderYesstringmutation-2026-07-10-001Client-generated key for safely retrying the same request. Reuse the same value for retries so duplicate work is not created.

Request Body ​

application/json ​

FieldRequiredTypeExampleDescription
nameNostring | nullSource file updatesOptional webhook name.
urlYesstringhttps://hooks.example.com/focowikiPublic HTTPS receiver URL. Loopback, private, link-local, reserved, credential-bearing, fragment-bearing, and redirect targets are rejected.
eventsYesarray<document.waiting | document.processing | document.available | document.error | document.deleting | file.deleted | knowledge_base.deleted>["document.available","document.error","document.deleting"]Webhook event types included in this subscription.

Request Example ​

bash
curl -X POST "https://openapi.example.com/openapi/v2/webhooks" \
  -H "Authorization: Bearer <openapi-key>" \
  -H "Idempotency-Key: mutation-2026-07-10-001" \
  -H "Content-Type: application/json" \
  --data '{
  "name": "Source file updates",
  "url": "https://hooks.example.com/focowiki",
  "events": [
    "document.available",
    "document.error",
    "document.deleting"
  ]
}'

Successful Responses ​

201 ​

New webhook subscription and its signing secret.

FieldRequiredTypeDescription
webhookYesobjectWebhook subscription returned by the request.
signingSecretYesstringReturned only by this create operation. An identical idempotent replay returns the same value; list operations never return it.

Success Response Example ​

json
{
  "webhook": {
    "webhookId": "webhook-11111111-1111-4111-8111-111111111111",
    "name": "Source file updates",
    "endpointHost": "hooks.example.com",
    "events": [
      "document.available",
      "document.error",
      "document.deleting"
    ],
    "createdAt": "2026-06-17T00:00:00.000Z",
    "lastDeliveryAt": null
  },
  "signingSecret": "<webhook-signing-secret>"
}

Error Codes ​

The table below lists every error response documented for this operation.

HTTP StatusError CodeExplanation
401UNAUTHORIZEDThe Bearer API key is missing, malformed, unknown, revoked, or deleted.
413PAYLOAD_TOO_LARGEThe request body or requested file exceeds the size limit for this operation.
422VALIDATION_ERRORThe request failed validation.
429RATE_LIMITEDThe request exceeded the configured rate limits.
500INTERNAL_ERRORThe API encountered an internal error.
503DATABASE_REPOSITORY_UNAVAILABLEThe data required by this operation is temporarily unavailable.

Next Steps ​