{"openapi":"3.1.0","info":{"title":"Tracefo Public API","version":"1.1.0","description":"Public webhook and integration surface. All endpoints are versioned under `/v1`. Webhook payloads are signed with HMAC-SHA256; verify via the X-Tracefo-Signature header.","x-api-major-version":"v1","x-sunset-policy":"/kb/api"},"servers":[{"url":"/v1"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"apiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"}},"schemas":{"IntegrationEventType":{"type":"string","enum":["product_updated","recipe_version_released","approval_requested","approval_decided","approval_completed","approval_rejected","impact_run_completed","release_package_created","certificate_expiring_soon","document_expiring_soon","rule_version_published","document_expired","import_completed"]},"DataClassificationLevel":{"type":"string","enum":["Public","Internal","Confidential","Restricted"],"description":"Maximum classified data level that a subscriber has explicitly accepted."},"WebhookEndpoint":{"type":"object","required":["id","name","url","eventTypes","active"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"eventTypes":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEventType"}},"payloadMaxClassification":{"$ref":"#/components/schemas/DataClassificationLevel"},"active":{"type":"boolean"}}},"WebhookDelivery":{"type":"object","required":["id","eventType","status","attemptCount"],"properties":{"id":{"type":"string"},"eventType":{"$ref":"#/components/schemas/IntegrationEventType"},"eventSchemaVersion":{"type":"string"},"status":{"type":"string","enum":["pending","in_flight","completed","failed","dead_letter"]},"attemptCount":{"type":"integer"},"maxAttempts":{"type":"integer"},"signature":{"type":"string","nullable":true},"responseStatus":{"type":"integer","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","format":"date-time","nullable":true},"failedAt":{"type":"string","format":"date-time","nullable":true}}}}},"security":[{"bearerAuth":[]},{"apiKey":[]}],"paths":{"/webhook-deliveries":{"get":{"summary":"List recent webhook deliveries for the authenticated tenant.","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","in_flight","completed","failed","dead_letter"]}},{"name":"endpointId","in":"query","required":false,"schema":{"type":"string"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Webhook delivery records, newest first.","content":{"application/json":{"schema":{"type":"object","required":["items","nextCursor"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"type":"string","nullable":true}}}}}}}}},"/webhook-deliveries/{id}":{"get":{"summary":"Fetch a single webhook delivery.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Webhook delivery details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"404":{"description":"Not found."}}}},"/webhook-deliveries/{id}/replay":{"post":{"summary":"Reset a webhook delivery's status and re-attempt delivery.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Delivery scheduled for replay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"404":{"description":"Not found."}}}}}}