Aggiorna un endpoint webhook

PATCH /v1/webhook-endpoints/{endpoint_id} · autorizzazione webhook-endpoints:write · tutti i piani

Modifica un endpoint con un merge patch JSON (RFC 7396, Content-Type: application/merge-patch+json). If-Match è obbligatorio; il valore attuale è l'header ETag di Ottieni un endpoint webhook. Una patch che non cambia nulla non scrive nulla e mantiene la versione.

Richiesta

Campo Tipo Obbligatorio Descrizione
endpoint_id path sì ID dell'endpoint webhook (whe_…).
If-Match header sì ETag attuale dell'endpoint (* corrisponde a qualsiasi versione).
key, url, description, event_types, event_schema_versions, payload_mode, rate_limit_per_second no Come in Aggiungi un endpoint webhook.
status string no enabled o disabled_by_user.
{
  "status": "enabled",
  "event_types": ["user.created", "user.updated", "user.deleted"]
}

Risposta

200 OK con l'endpoint (come in Ottieni un endpoint webhook) e il nuovo ETag.

Errori

HTTP code Quando
400 malformed_request Il body non è un oggetto JSON.
400 unknown_field La patch contiene un campo non elencato sopra.
403 quota_exceeded status: enabled supererebbe il numero di endpoint abilitati del piano.
404 not_found Nessun endpoint con questo ID in questo ambiente.
409 conflict Un altro endpoint dell'ambiente ha questa key.
412 precondition_failed If-Match non corrisponde alla versione attuale (l'endpoint è cambiato dopo la tua lettura).
422 validation_failed Un campo non è valido (i puntatori come in Aggiungi un endpoint webhook); /status invalid per uno stato diverso da enabled o disabled_by_user.
428 precondition_required If-Match manca.
401 unauthenticated La credenziale manca, non è valida o è stata revocata.
403 insufficient_permissions La credenziale non ha webhook-endpoints:write.
503 service_unavailable L'amministrazione dei webhook è temporaneamente non disponibile; riprova dopo il periodo indicato in Retry-After.

Esempio

curl -X PATCH https://api.eu.keenauth.com/v1/webhook-endpoints/whe_01k8a3m5q7t9v1w3x5y7z9b2c4 \
  -H "Authorization: Bearer $KEENAUTH_SECRET_KEY" \
  -H "Content-Type: application/merge-patch+json" \
  -H 'If-Match: "3"' \
  -d '{"status":"enabled"}'

CLI: keenauth webhook-endpoints update whe_01k8a3m5q7t9v1w3x5y7z9b2c4 --status enabled --if-match '"3"'