Actualizar config de webhook
PATCH /api/webhooks/configSetea la URL base y/o el token compartido (webhook_secret, write-only: se guarda cifrado y no vuelve en ninguna respuesta). El mismo token va en tu backend para validar el header x-webhook-token de cada dispatch. Requiere webhooks:manage.
Request body
Section titled “Request body”| Field | Type | Description | |
|---|---|---|---|
webhook_url | string | optional | URL base de tu backend a la que Neike despacha los webhooks. Example: "https://tu-backend.com". |
webhook_secret | string | optional | Token compartido (write-only: se guarda cifrado y no vuelve en ninguna respuesta). Neike lo manda en la cabecera x-webhook-token de cada dispatch; tu backend lo valida. null para limpiarlo. Example: "whsec_abc123…". |
Responses
Section titled “Responses”| Status | Description | Schema |
|---|---|---|
200 | — | WebhookConfigResponseDto |
Example
Section titled “Example”curl -X PATCH https://api.neike.dev/api/webhooks/config \ -H "x-neike-api-key: whk_live_…" \ -H "Content-Type: application/json" \ -d '{ "webhook_url": "https://tu-backend.com", "webhook_secret": "whsec_abc123…" }'WebhookConfigResponseDto
Section titled “WebhookConfigResponseDto”| Field | Type | Description | |
|---|---|---|---|
webhook_url | string | required | URL base configurada. Example: "https://tu-backend.com". |
webhook_secret_set | boolean | required | true si hay token compartido (x-webhook-token) configurado. Example: true. |
webhook_secret_hint | string | required | Hint enmascarado del token para reconocerlo (whsec_…abcd). El valor completo solo se devuelve al generarlo, una única vez. Example: "whsec_…abcd". |
configured | boolean | required | true si hay webhook_url configurada. Example: true. |
signature_header | string | required | Cabecera con la que Neike firma cada dispatch. Example: "x-webhook-token". |
dispatch_urls | DispatchUrlsDto | required | — |