跳到主要内容

updateWebhook

WebhooksConfigWrapper updateWebhook(UpdateWebhooksConfigRequestDto)

PUT /api/2.0/settings/webhook

Update a webhook

Replaces the stored parameters of one webhook subscription, which is addressed by id in the body rather than in the path. Every field of the request overwrites the stored one, so a payload that leaves out enabled, ssl, triggers or targetId resets them to off, all events and no target: read the current values with GET api/2.0/settings/webhook first and send back whatever should stay. secretKey is the one exception, an empty value keeping the existing secret and a new one having to satisfy the portal password rules. The new target is validated exactly as on creation, that is it must sit outside the installation's own network and answer a HEAD request, and trigger flags the caller's role may not use are rejected. That validation runs before the subscription is looked up, so an unusable payload is refused with 400 even when no subscription with this id exists. A DocSpaceAdmin may update any subscription in the portal, anyone else only their own, and a Guest is refused. Sending the same payload twice leaves the same state. Use PUT api/2.0/settings/webhook/enable to switch a subscription on or off without touching anything else.

Parameters​

NameInTypeDescriptionNotes
UpdateWebhooksConfigRequestDtobodyUpdateWebhooksConfigRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The updated webhook subscription, without its secret keyWebhooksConfigWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no id, name or uri is missing or empty, name or secretKey is longer than 50 characters or targetId longer than 255, the target URL is unusable or answers the HEAD request with a non-success code, or the secret key or a trigger flag was rejected--
403The subscription belongs to another member, or the caller may not use webhooks at all--
404No webhook subscription with this ID exists in the portal--
500The target URL gives no answer to the HEAD request: the connection fails or times out, or the certificate is not valid while ssl is true--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

WebhooksConfigWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json