> For the complete documentation index, see [llms.txt](https://tsanet.gitbook.io/connect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tsanet.gitbook.io/connect/api-reference/webhooks.md).

# Webhooks

Webhook subscription management (delete, delivery log; secret rotation is not implemented)

## DELETE /v1/webhooks/{id}

> Delete a webhook subscription

```json
{"openapi":"3.0.3","info":{"title":"TSANet Connect Core API","version":"1.0.0"},"tags":[{"name":"Webhooks","description":"Webhook subscription management (delete, delivery log; secret rotation is not implemented)"}],"servers":[{"url":"http://localhost:8080","description":"Local"},{"url":"https://connect2.tahoelab.us","description":"Dev"},{"url":"https://connect2.tsanet.net","description":"Beta"},{"url":"https://connect2.tsanet.org","description":"Prod"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Paste a Bearer JWT here. Two token types are accepted:\n\n**Connect1 User Tokens** — issued by the Connect1 identity service. Copy the token from your Connect1 session.\n\n**Azure AD M2M** — use the `azureClientCredentials` scheme below to get a token, then paste it here.\n"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"validationErrors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"}},"additionalProperties":true}}},"paths":{"/v1/webhooks/{id}":{"delete":{"tags":["Webhooks"],"summary":"Delete a webhook subscription","operationId":"deleteWebhookSubscription","parameters":[{"name":"id","in":"path","required":true,"description":"The webhook subscription ID","schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Webhook subscription deleted successfully"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"404":{"description":"Webhook subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}}}
```

## Rotate the HMAC signing secret for a webhook subscription (not implemented)

> \*\*Not implemented.\*\* An authenticated call returns \`501 Not Implemented\` with an empty\
> body, whatever the subscription ID: secret rotation is not supported. To change a\
> subscription's signing secret, delete the subscription (\`DELETE /v1/webhooks/{id}\`)\
> and create a new one. The new secret is returned once, in the creation response.<br>

```json
{"openapi":"3.0.3","info":{"title":"TSANet Connect Core API","version":"1.0.0"},"tags":[{"name":"Webhooks","description":"Webhook subscription management (delete, delivery log; secret rotation is not implemented)"}],"servers":[{"url":"http://localhost:8080","description":"Local"},{"url":"https://connect2.tahoelab.us","description":"Dev"},{"url":"https://connect2.tsanet.net","description":"Beta"},{"url":"https://connect2.tsanet.org","description":"Prod"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Paste a Bearer JWT here. Two token types are accepted:\n\n**Connect1 User Tokens** — issued by the Connect1 identity service. Copy the token from your Connect1 session.\n\n**Azure AD M2M** — use the `azureClientCredentials` scheme below to get a token, then paste it here.\n"}},"schemas":{"WebhookSecretRotationResponseDTO":{"type":"object","properties":{"id":{"type":"integer","format":"int64","description":"Webhook subscription ID"},"secret":{"type":"string","maxLength":64,"description":"New HMAC-SHA256 signing secret. This value is only returned once.\nStore it immediately — it cannot be retrieved again.\n"},"rotatedAt":{"type":"string","format":"date-time","description":"Timestamp when the secret was rotated"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"validationErrors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"}},"additionalProperties":true}}},"paths":{"/v1/webhooks/{id}/secret":{"post":{"tags":["Webhooks"],"summary":"Rotate the HMAC signing secret for a webhook subscription (not implemented)","description":"**Not implemented.** An authenticated call returns `501 Not Implemented` with an empty\nbody, whatever the subscription ID: secret rotation is not supported. To change a\nsubscription's signing secret, delete the subscription (`DELETE /v1/webhooks/{id}`)\nand create a new one. The new secret is returned once, in the creation response.\n","operationId":"rotateWebhookSecret","parameters":[{"name":"id","in":"path","required":true,"description":"The webhook subscription ID","schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"description":"Reserved. Not returned while rotation is not implemented.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretRotationResponseDTO"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"404":{"description":"Reserved. Not returned while rotation is not implemented; an unknown ID also gets 501.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"501":{"description":"Not implemented. Returned to every authenticated call, with an empty body."}}}}}}
```

## GET /v1/webhooks/{id}/deliveries

> Get delivery log for a webhook subscription

```json
{"openapi":"3.0.3","info":{"title":"TSANet Connect Core API","version":"1.0.0"},"tags":[{"name":"Webhooks","description":"Webhook subscription management (delete, delivery log; secret rotation is not implemented)"}],"servers":[{"url":"http://localhost:8080","description":"Local"},{"url":"https://connect2.tahoelab.us","description":"Dev"},{"url":"https://connect2.tsanet.net","description":"Beta"},{"url":"https://connect2.tsanet.org","description":"Prod"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Paste a Bearer JWT here. Two token types are accepted:\n\n**Connect1 User Tokens** — issued by the Connect1 identity service. Copy the token from your Connect1 session.\n\n**Azure AD M2M** — use the `azureClientCredentials` scheme below to get a token, then paste it here.\n"}},"schemas":{"WebhookDeliveryLogPageDTO":{"type":"object","properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryLogDTO"}},"totalElements":{"type":"integer","format":"int64"},"totalPages":{"type":"integer","format":"int32"},"size":{"type":"integer","format":"int32"},"number":{"type":"integer","format":"int32"}}},"WebhookDeliveryLogDTO":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"cloudEventId":{"type":"string","maxLength":100},"eventType":{"type":"string","maxLength":100},"httpStatus":{"type":"integer","format":"int32"},"attemptNumber":{"type":"integer","format":"int32"},"success":{"type":"boolean"},"requestBody":{"type":"string"},"responseBody":{"type":"string","maxLength":1000},"createdAt":{"type":"string","format":"date-time"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"validationErrors":{"type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ValidationError":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}}},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"}},"additionalProperties":true}}},"paths":{"/v1/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Get delivery log for a webhook subscription","operationId":"getWebhookDeliveries","parameters":[{"name":"id","in":"path","required":true,"description":"The webhook subscription ID","schema":{"type":"integer","format":"int64"}},{"name":"page","in":"query","required":false,"description":"Page number (0-based)","schema":{"type":"integer","format":"int32","default":0,"minimum":0}},{"name":"size","in":"query","required":false,"description":"Page size","schema":{"type":"integer","format":"int32","default":20,"minimum":1,"maximum":100}}],"responses":{"200":{"description":"Delivery log","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryLogPageDTO"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"404":{"description":"Webhook subscription not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}},"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}}}
```
