{"openapi":"3.1.0","info":{"title":"spendware Webhooks Public API","version":"0.1.0","description":"Customer-facing spendware SaaS webhooks API reference."},"paths":{"/api/v1/healthz":{"get":{"tags":["health"],"summary":"Health Check","operationId":"health-health_check","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/api/v1/endpoints":{"get":{"tags":["endpoints"],"summary":"List Endpoints","operationId":"endpoints-list_endpoints","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["endpoints"],"summary":"Create Endpoint","operationId":"endpoints-create_endpoint","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/endpoints/{endpoint_id}":{"get":{"tags":["endpoints"],"summary":"Get Endpoint","operationId":"endpoints-get_endpoint","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["endpoints"],"summary":"Patch Endpoint","operationId":"endpoints-patch_endpoint","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["endpoints"],"summary":"Remove Endpoint","operationId":"endpoints-remove_endpoint","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Support-Reason","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Support-Reason"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/endpoints/{endpoint_id}/transfer-owner":{"post":{"tags":["endpoints"],"summary":"Transfer Endpoint Owner","operationId":"endpoints-transfer_endpoint_owner","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Support-Reason","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Support-Reason"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointTransferOwnerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/endpoints/{endpoint_id}/rotate-secret":{"post":{"tags":["endpoints"],"summary":"Rotate Endpoint Secret","operationId":"endpoints-rotate_endpoint_secret","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/endpoints/{endpoint_id}/test":{"post":{"tags":["endpoints"],"summary":"Send Test Event","operationId":"endpoints-send_test_event","security":[{"HTTPBearer":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events":{"get":{"tags":["events"],"summary":"List Events","operationId":"events-list_events","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/WebhookEventStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/events/{event_id}/redeliver":{"post":{"tags":["events"],"summary":"Redeliver Event","operationId":"events-redeliver_event","security":[{"HTTPBearer":[]}],"parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeliverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deliveries":{"get":{"tags":["deliveries"],"summary":"List Deliveries","operationId":"deliveries-list_deliveries","security":[{"HTTPBearer":[]}],"parameters":[{"name":"organization_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Organization Id"}},{"name":"endpoint_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Endpoint Id"}},{"name":"webhook_event_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Webhook Event Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveriesPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/deliveries/{delivery_id}/attempts":{"get":{"tags":["deliveries"],"summary":"Get Delivery Attempts","operationId":"deliveries-get_delivery_attempts","security":[{"HTTPBearer":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryAttemptsPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"EndpointTestResponse":{"properties":{"webhook_event_id":{"type":"string","format":"uuid","title":"Webhook Event Id"},"delivery_count":{"type":"integer","title":"Delivery Count"}},"type":"object","required":["webhook_event_id","delivery_count"],"title":"EndpointTestResponse"},"EndpointTransferOwnerRequest":{"properties":{"new_owner_user_id":{"type":"string","format":"uuid","title":"New Owner User Id"}},"type":"object","required":["new_owner_user_id"],"title":"EndpointTransferOwnerRequest"},"EndpointVerificationStatus":{"type":"string","enum":["pending","verified","failed"],"title":"EndpointVerificationStatus"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["status","timestamp"],"title":"HealthResponse"},"RedeliverResponse":{"properties":{"webhook_event_id":{"type":"string","format":"uuid","title":"Webhook Event Id"},"requeued_count":{"type":"integer","title":"Requeued Count"}},"type":"object","required":["webhook_event_id","requeued_count"],"title":"RedeliverResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookAttemptStatus":{"type":"string","enum":["succeeded","failed","timeout"],"title":"WebhookAttemptStatus"},"WebhookDeliveriesPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDeliveryPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"WebhookDeliveriesPublic"},"WebhookDeliveryAttemptPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"delivery_id":{"type":"string","format":"uuid","title":"Delivery Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"attempt_number":{"type":"integer","title":"Attempt Number"},"status":{"$ref":"#/components/schemas/WebhookAttemptStatus"},"requested_at":{"type":"string","format":"date-time","title":"Requested At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Http Status"},"response_body_snippet":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Body Snippet"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["id","delivery_id","organization_id","attempt_number","status","requested_at","completed_at","duration_ms","http_status","response_body_snippet","error_message"],"title":"WebhookDeliveryAttemptPublic"},"WebhookDeliveryAttemptsPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookDeliveryAttemptPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"WebhookDeliveryAttemptsPublic"},"WebhookDeliveryPublic":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"endpoint_id":{"type":"string","format":"uuid","title":"Endpoint Id"},"webhook_event_id":{"type":"string","format":"uuid","title":"Webhook Event Id"},"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/WebhookDeliveryStatus"},"attempt_count":{"type":"integer","title":"Attempt Count"},"next_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt At"},"last_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Attempt At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"last_http_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Http Status"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"dead_lettered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dead Lettered At"}},"type":"object","required":["organization_id","endpoint_id","webhook_event_id","id","status","attempt_count","next_attempt_at","last_attempt_at","completed_at","last_http_status","last_error","dead_lettered_at"],"title":"WebhookDeliveryPublic"},"WebhookDeliveryStatus":{"type":"string","enum":["pending","in_progress","succeeded","failed","dead_letter"],"title":"WebhookDeliveryStatus"},"WebhookEndpointCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"url":{"type":"string","maxLength":2048,"minLength":1,"title":"Url"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"subscribed_events":{"items":{"type":"string"},"type":"array","title":"Subscribed Events"},"is_active":{"type":"boolean","title":"Is Active","default":true},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"}},"type":"object","required":["name","url","organization_id"],"title":"WebhookEndpointCreate"},"WebhookEndpointPublic":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"url":{"type":"string","maxLength":2048,"minLength":1,"title":"Url"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"subscribed_events":{"items":{"type":"string"},"type":"array","title":"Subscribed Events"},"is_active":{"type":"boolean","title":"Is Active","default":true},"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"verification_status":{"$ref":"#/components/schemas/EndpointVerificationStatus"},"signing_key_id":{"type":"string","title":"Signing Key Id"},"signing_secret_version":{"type":"integer","title":"Signing Secret Version"},"signing_secret_preview":{"type":"string","title":"Signing Secret Preview"}},"type":"object","required":["name","url","id","organization_id","owner_id","verification_status","signing_key_id","signing_secret_version","signing_secret_preview"],"title":"WebhookEndpointPublic"},"WebhookEndpointUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1},{"type":"null"}],"title":"Url"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description"},"subscribed_events":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Subscribed Events"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"WebhookEndpointUpdate"},"WebhookEndpointWithSecret":{"properties":{"endpoint":{"$ref":"#/components/schemas/WebhookEndpointPublic"},"signing_secret":{"type":"string","title":"Signing Secret"}},"type":"object","required":["endpoint","signing_secret"],"title":"WebhookEndpointWithSecret"},"WebhookEndpointsPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookEndpointPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"WebhookEndpointsPublic"},"WebhookEventPublic":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"event_type":{"type":"string","maxLength":255,"minLength":1,"title":"Event Type"},"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"domain_event_id":{"type":"string","format":"uuid","title":"Domain Event Id"},"payload_json":{"additionalProperties":true,"type":"object","title":"Payload Json"},"payload_hash":{"type":"string","title":"Payload Hash"},"status":{"$ref":"#/components/schemas/WebhookEventStatus"},"queued_at":{"type":"string","format":"date-time","title":"Queued At"},"dispatched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dispatched At"}},"type":"object","required":["event_type","id","organization_id","domain_event_id","payload_json","payload_hash","status","queued_at","dispatched_at"],"title":"WebhookEventPublic"},"WebhookEventStatus":{"type":"string","enum":["pending","dispatched","dead_letter"],"title":"WebhookEventStatus"},"WebhookEventsPublic":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WebhookEventPublic"},"type":"array","title":"Data"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["data","count"],"title":"WebhookEventsPublic"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}
