{"openapi":"3.1.0","info":{"title":"Signerad.nu Enterprise API","version":"1.0.0-dev.8","description":"Development contract: drafts, participants, private PDF verification, dispatch, cancellation, company checks, evidence export and webhook backend are implemented locally. Outbound HMAC delivery, retry and test contracts are documented for isolated testing. Customer webhooks and production pilot remain disabled pending deployment gates."},"servers":[{"url":"https://api.signerad.nu/v1","description":"Production address — not released"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Status","description":"Implemented development foundation."},{"name":"Draft cases","description":"Locally verified draft operations; no invitations or charges. All participants are mandatory."},{"name":"Documents","description":"Private immutable direct uploads. Existing PDF validation runs in a persistent queue independent of mail delivery. No case is sent or charged."},{"name":"Case actions","description":"Shared signing engine and atomic Enterprise financing. No web credit fallback."},{"name":"Company checks","description":"Optional registry guidance with a quoted Enterprise agreement price. Lookup is not charged; confirmed use enters the case order on dispatch acceptance. Never a legal authority guarantee."}],"paths":{"/status":{"get":{"operationId":"getEnterpriseStatus","tags":["Status"],"summary":"Read environment and contract status","description":"Requires cases:read on key and agreement. Authenticated requests count towards agreement request limits, not signing volume. Retained read access may continue after contract expiry.","x-scopes":["cases:read"],"parameters":[],"responses":{"200":{"description":"Current agreement and capability state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"},"description":"Request correlation ID"},"Cache-Control":{"schema":{"type":"string","const":"no-store"},"description":"Responses are not cached"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"},"example":{"environment":"sandbox","contract":{"id":"00000000-0000-4000-8000-000000000001","version":1,"ends_at":"2027-01-01T00:00:00.000Z"},"capabilities":{"signing_cases":false,"webhooks":false,"draft_cases":true,"document_uploads":true}}}}},"401":{"description":"Invalid or revoked key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"invalid_api_key","message":"Invalid API key.","request_id":"00000000-0000-4000-8000-000000000002"}}}}},"403":{"description":"Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"enterprise_required","message":"An approved Enterprise agreement is required.","request_id":"00000000-0000-4000-8000-000000000002"}}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"rate_limit_exceeded","message":"API request limit exceeded.","request_id":"00000000-0000-4000-8000-000000000002"}}}}},"503":{"description":"Environment unavailable or internal failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"code":"api_unavailable","message":"Enterprise API is not enabled.","request_id":"00000000-0000-4000-8000-000000000002"}}}}}}}},"/signing-cases":{"get":{"operationId":"listCases","tags":["Draft cases"],"summary":"List API-created cases","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. ","x-scopes":["cases:read"],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":""},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":600},"description":"Opaque cursor bound to company, environment and filters. Sort: created_at descending, then id descending. This is a live list, not a snapshot."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending","partial","changes_requested","completed","declined","expired","cancelled"]},"description":""},{"name":"created_after","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Exclusive UTC timestamp ending in Z."},{"name":"created_before","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Exclusive UTC timestamp ending in Z."},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},"description":"Exact, case-sensitive customer reference; not an idempotency key."}],"responses":{"200":{"description":"Results","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseList"},"example":{"data":[{"object":"signing_case","id":"00000000-0000-8000-8000-000000000010","title":"Consulting agreement","message":"Please review.","deadline":"2026-12-31","external_id":"crm-123","metadata":{"department":"sales"},"signing_order":false,"status":"draft","participants":[],"document_count":0,"originals_ready":false,"evidence_status":"not_started","created_at":"2026-10-24T10:00:00.000Z","updated_at":"2026-10-24T10:00:00.000Z"}],"next_cursor":null}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCase","tags":["Draft cases"],"summary":"Create a draft","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. All mutations return the complete case, including its participant list. No personal number, invitation token or private storage path is returned. ","x-scopes":["cases:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."}],"responses":{"201":{"description":"Case state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}},"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"},"example":{"object":"signing_case","id":"00000000-0000-8000-8000-000000000010","title":"Consulting agreement","message":"Please review.","deadline":"2026-12-31","external_id":"crm-123","metadata":{"department":"sales"},"signing_order":false,"status":"draft","participants":[],"document_count":0,"originals_ready":false,"evidence_status":"not_started","created_at":"2026-10-24T10:00:00.000Z","updated_at":"2026-10-24T10:00:00.000Z"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCase"},"example":{"title":"Consulting agreement","deadline":"2026-12-31","message":"Please review.","external_id":"crm-123","metadata":{"department":"sales"}}}}}}},"/signing-cases/{id}":{"get":{"operationId":"getCase","tags":["Draft cases"],"summary":"Read a case","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. ","x-scopes":["cases:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."}],"responses":{"200":{"description":"Case state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"},"example":{"object":"signing_case","id":"00000000-0000-8000-8000-000000000010","title":"Consulting agreement","message":"Please review.","deadline":"2026-12-31","external_id":"crm-123","metadata":{"department":"sales"},"signing_order":false,"status":"draft","participants":[],"document_count":0,"originals_ready":false,"evidence_status":"not_started","created_at":"2026-10-24T10:00:00.000Z","updated_at":"2026-10-24T10:00:00.000Z"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCase","tags":["Draft cases"],"summary":"Update draft details","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. All mutations return the complete case, including its participant list. No personal number, invitation token or private storage path is returned. ","x-scopes":["cases:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"200":{"description":"Case state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCase"}}}}}},"/signing-cases/{id}/participants":{"get":{"operationId":"listParticipants","tags":["Draft cases"],"summary":"Read mandatory participants","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. ","x-scopes":["cases:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."}],"responses":{"200":{"description":"Results","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParticipantList"},"example":{"data":[]}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createParticipant","tags":["Draft cases"],"summary":"Add a mandatory participant","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. All mutations return the complete case, including its participant list. No personal number, invitation token or private storage path is returned. ","x-scopes":["cases:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"201":{"description":"Case state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateParticipant"}}}}}},"/signing-cases/{id}/participants/{participantId}":{"patch":{"operationId":"updateParticipant","tags":["Draft cases"],"summary":"Update a draft participant","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. All mutations return the complete case, including its participant list. No personal number, invitation token or private storage path is returned. ","x-scopes":["cases:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Participant ID within this case."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"200":{"description":"Case state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateParticipant"}}}}},"delete":{"operationId":"deleteParticipant","tags":["Draft cases"],"summary":"Remove a draft participant","description":"Server-to-server only. Only API-created cases in the key company and environment are accessible. Changes affect drafts only and use the existing signing-engine validation. No case quota or payment is consumed. All participants are mandatory. All mutations return the complete case, including its participant list. No personal number, invitation token or private storage path is returned. ","x-scopes":["cases:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"participantId","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Participant ID within this case."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"200":{"description":"Case state","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/documents":{"post":{"operationId":"prepareDocument","summary":"Prepare a private PDF upload","tags":["Documents"],"x-scopes":["documents:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"Reuse the same key and document fields on retries. Stored upload receipts replay for seven days; their original upload deadline is never renewed."}],"responses":{"201":{"description":"Prepare a private PDF upload","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Location":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreparedDocument"},"example":{"document":{"object":"document","id":"00000000-0000-4000-8000-000000000002","case_id":"00000000-0000-4000-8000-000000000001","name":"agreement.pdf","size":1000,"status":"awaiting_upload","sha256":null,"pages":null,"error":null,"created_at":"2026-10-24T10:00:00.000Z","verified_at":null},"upload":{"method":"PUT","url":"https://example.supabase.co/storage/v1/object/upload/sign/documents/scoped-object.pdf?token=example-only","headers":{"Content-Type":"application/pdf","x-upsert":"false"},"expires_at":"2026-10-24T12:00:00.000Z"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency, capacity or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareDocument"},"example":{"case_id":"00000000-0000-4000-8000-000000000001","name":"agreement.pdf","size":1000,"sha256":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}}}},"description":"Requires an API-created draft in this key company and environment. Supply byte size and SHA-256 before uploading. The returned single-object capability uses PUT application/pdf without the Enterprise Authorization header; never forward an API key to storage. No overwrites. Complete within the original two-hour API window; retries never renew it. Supabase capability TTL is two hours. Maximum 20 MiB per file, 50 active files and 100 MiB per case including pending reservations. Permission receipts are encrypted at rest. Uploading does not attach or send a document."}},"/documents/{id}":{"get":{"operationId":"getDocument","summary":"Read document verification status","tags":["Documents"],"x-scopes":["documents:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Read document verification status","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"},"example":{"object":"document","id":"00000000-0000-4000-8000-000000000002","case_id":"00000000-0000-4000-8000-000000000001","name":"agreement.pdf","size":1000,"status":"awaiting_upload","sha256":null,"pages":null,"error":null,"created_at":"2026-10-24T10:00:00.000Z","verified_at":null}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency, capacity or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Only documents in the key company and environment. Provides metadata and a stable failure code, never upload capabilities, storage paths or download URLs. Existing case retention applies. Unattached uploads expire under the existing cleanup policy. Reading may continue after agreement expiry according to retained-read policy."}},"/documents/{id}/complete":{"post":{"operationId":"completeDocument","summary":"Queue PDF verification","tags":["Documents"],"x-scopes":["documents:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"Queue PDF verification","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Location":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"string","const":"3"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Operation"},"example":{"object":"operation","id":"00000000-0000-4000-8000-000000000003","type":"document_verification","status":"pending","result":null,"error":null}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency, capacity or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"No request body. Call after PUT completes. Atomically queues one persistent verification operation per document, including repeated/concurrent requests; no Idempotency-Key required. Returns the same operation ID. A 202 response is not PDF approval. Expired upload windows return 409. Poll the operation or document; invalid, protected, active-content or overly complex PDFs are rejected. Transient storage failures retry up to eight attempts. Approved content is inserted into the existing verified-upload inventory in the same transaction as the ready state."}},"/operations/{id}":{"get":{"operationId":"getOperation","summary":"Read verification or dispatch progress","tags":["Documents"],"x-scopes":["documents:read","cases:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Read a document verification operation","headers":{"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"X-Request-Id":{"schema":{"type":"string","format":"uuid"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnyOperation"},"example":{"object":"operation","id":"00000000-0000-4000-8000-000000000003","type":"document_verification","status":"succeeded","result":{"document_id":"00000000-0000-4000-8000-000000000002"},"error":null}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not available","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency, capacity or lifecycle conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JSON exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Requires documents:read for document_verification, or cases:read for invitation_dispatch, on both key and current agreement. One admission counts once. Foreign company/environment IDs return 404. succeeded for dispatch means the mail provider accepted all initial invitations; it does not mean the case was signed. Pending/running may be retried. Failed delivery requires operational attention."}},"/signing-cases/{id}/documents/{documentId}":{"post":{"operationId":"attachDocument","summary":"Attach a verified PDF to a draft","description":"Only a ready document owned by this API case and environment can be attached. Reattaching is a no-op. No request body. Does not send invitations or consume signing volume.","tags":["Case actions"],"x-scopes":["documents:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"200":{"description":"Attach a verified PDF to a draft","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"detachDocument","summary":"Detach a PDF from a draft","description":"Detaches without deleting the verified upload. Detaching an absent document is a no-op. No request body. Sent documents are immutable.","tags":["Case actions"],"x-scopes":["documents:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"200":{"description":"Detach a PDF from a draft","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningCase"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signing-cases/{id}/send":{"post":{"operationId":"sendCase","summary":"Queue signing invitations","description":"No request body. Requires an attached verified PDF and valid mandatory participants. Atomically reserves the original Enterprise agreement capacity and queues initial invitations. Consumption is confirmed only after provider acceptance. The operation tracks initial invitation delivery, not signing completion or evidence readiness. Retries return the same operation; each case has permanent send-once protection beyond the seven-day HTTP receipt.","tags":["Case actions"],"x-scopes":["cases:send"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"202":{"description":"Queue signing invitations","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}},"Location":{"schema":{"type":"string"},"description":"Persistent operation URL; poll with cases:read."},"Retry-After":{"schema":{"type":"string"},"description":"Suggested poll interval in seconds."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchOperation"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signing-cases/{id}/cancel":{"post":{"operationId":"cancelCase","summary":"Cancel a sent case","description":"No request body. Cancels an active case through the shared engine. Unsigned cancellation restores the original API period; signed cases follow the existing non-refund rules. No web credits are created. Scope-authorized cancellation remains available after expiry or payment failure; suspension and revoked keys still deny access.","tags":["Case actions"],"x-scopes":["cases:cancel"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"responses":{"200":{"description":"Cancel a sent case","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cancellation"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signing-cases/{id}/company-checks":{"post":{"operationId":"lookupCompanyCheck","summary":"Find company signatories","description":"Requires company-checks:write on key and current agreement and companyChecks feature. Requires an API draft, valid Swedish organization number and Idempotency-Key. No If-Match needed: lookup does not edit the case or create a charge. Replays retain source identity and original quoted price for seven days. A pending lookup returns 409; retry with the same key. Results include source rules, roles, conservative combinations, fifteen-minute source expiry and the agreement price in integer öre excluding/including 25% VAT. Maximum fifty observations per case in a rolling 24-hour window. Provider configuration, unit budget and cache follow the existing integration. Partial/stale/unusable results cannot be confirmed. Registry guidance never guarantees legal authority.","tags":["Company checks"],"x-scopes":["company-checks:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCompanyCheck"}}}},"responses":{"201":{"description":"Find company signatories","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCheck"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signing-cases/{id}/company-checks/{checkId}/confirm":{"post":{"operationId":"confirmCompanyCheck","summary":"Confirm use of company authority results","description":"Requires company-checks:write, Idempotency-Key and current case If-Match. Echo the quoted net price in accepted_price_ex_vat. Only usable unexpired results under the current agreement may be confirmed, once per observation. Selected persons become mandatory signers through the shared case engine. If the registered combination cannot be satisfied safely, manual_reason is mandatory; manual assessment cannot make unusable data chargeable. A new observation may replace an earlier choice for the same company, keeping one company item. Confirmation itself does not send or charge. The existing case order includes the agreement fee on invitation acceptance and collects it by card the following month. Multiple signatories do not increase the control quantity. ETag applies to the returned case, not the confirmation envelope. Repeat the same key, payload and original If-Match to recover the immutable receipt. No provider lookup occurs on confirmation.","tags":["Company checks"],"x-scopes":["company-checks:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"API-created case ID in the key company and environment."},{"name":"checkId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[\\x21-\\x7e]{16,128}$"},"description":"A unique key per operation. Same key and request replay the original response for seven days; changed content returns 409. After expiry, an identical create can conflict with its retained case; use the saved case ID for further edits."},{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[a-f0-9]{64}\"$"},"description":"The latest case ETag, from a case or participant-list response. Replays return their original ETag; read the case again before a new edit."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmCompanyCheck"}}}},"responses":{"200":{"description":"Confirm use of company authority results","headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"ETag":{"schema":{"type":"string"}},"Idempotency-Replayed":{"schema":{"type":"string","enum":["true","false"]}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCheckConfirmation"}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signing-cases/{id}/documents":{"get":{"operationId":"getCaseDocuments","tags":["Documents"],"summary":"Export originals, separate certificate and verification package","description":"Requires documents:read on key and agreement. Only API-created cases in the same company/environment. Originals are available after attachment; completed signing does not imply evidence readiness. Poll this endpoint on HTTP 202 with Retry-After: 5. Exhausted packaging returns evidence_status failed with a safe error; contact the operator. Links are bearer capabilities valid for 60 seconds; do not log or share them. Previously issued links may remain valid for their remaining lifetime after key revocation. Expiry/nonpayment preserves retained read/export access; security suspension and case retention do not. Packaging uses the existing persistent worker. No additional fee, idempotency key or separate payment. The PDF certificate is a readable summary, not an embedded PAdES signature.","x-scopes":["documents:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Export readiness and short-lived authorized links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDocuments"}}},"headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}}}},"202":{"description":"Signing is complete; evidence is being packaged. Poll after five seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseDocuments"}}},"headers":{"X-Request-Id":{"schema":{"type":"string","format":"uuid"}},"Cache-Control":{"schema":{"type":"string","const":"no-store"}},"Retry-After":{"description":"Seconds before polling the same endpoint again","schema":{"type":"integer","const":5}}}},"400":{"description":"Invalid request or filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Agreement or scope denies access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency or case-state conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"Case changed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Use application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"428":{"description":"If-Match required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Environment or service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Keep Enterprise keys on your server; never send them to documentation or a browser."}},"schemas":{"Status":{"type":"object","additionalProperties":false,"required":["environment","contract","capabilities"],"properties":{"environment":{"type":"string","enum":["sandbox","production"]},"contract":{"type":"object","additionalProperties":false,"required":["id","version","ends_at"],"properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"ends_at":{"type":"string","format":"date-time"}}},"capabilities":{"type":"object","additionalProperties":false,"required":["signing_cases","webhooks","draft_cases","document_uploads"],"properties":{"signing_cases":{"type":"boolean","const":false},"webhooks":{"type":"boolean","const":false},"draft_cases":{"type":"boolean","const":true},"document_uploads":{"type":"boolean","const":true}}}}},"Error":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"object","additionalProperties":false,"required":["code","message","request_id"],"properties":{"code":{"type":"string","enum":["invalid_api_key","enterprise_required","contract_suspended","feature_not_enabled","contract_inactive","forbidden","rate_limit_exceeded","api_unavailable","internal_error","contract_changed","invalid_request","not_found","conflict","idempotency_conflict","precondition_required","precondition_failed","unsupported_media_type","payload_too_large","upload_expired"]},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"}}}}},"CreateParticipant":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"pattern":"\\S"},"email":{"type":"string","format":"email","maxLength":254},"role":{"type":"string","enum":["signer","reviewer"]},"signing_step":{"type":"integer","minimum":1,"maximum":50},"identity_check":{"type":"boolean"},"personal_number":{"type":"string","pattern":"^(?:\\d{6}|\\d{8})[-+]?\\d{4}$"}},"required":["name","email"],"dependentSchemas":{"personal_number":{"required":["identity_check"],"properties":{"identity_check":{"const":true}}}}},"UpdateParticipant":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"pattern":"\\S"},"email":{"type":"string","format":"email","maxLength":254},"role":{"type":"string","enum":["signer","reviewer"]},"signing_step":{"type":"integer","minimum":1,"maximum":50},"identity_check":{"type":"boolean"},"personal_number":{"type":"string","pattern":"^(?:\\d{6}|\\d{8})[-+]?\\d{4}$"}},"required":[],"minProperties":1,"dependentSchemas":{"personal_number":{"required":["identity_check"],"properties":{"identity_check":{"const":true}}}}},"CreateCase":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","maxLength":120,"minLength":1,"pattern":"\\S"},"message":{"type":"string","maxLength":4000},"deadline":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"external_id":{"anyOf":[{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},{"type":"null"}]},"metadata":{"type":"object","maxProperties":10,"propertyNames":{"pattern":"^[A-Za-z0-9_.-]{1,64}$","not":{"enum":["__proto__","constructor","prototype"]}},"additionalProperties":{"type":"string","maxLength":500}},"signing_order":{"type":"boolean"},"participants":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"pattern":"\\S"},"email":{"type":"string","format":"email","maxLength":254},"role":{"type":"string","enum":["signer","reviewer"]},"signing_step":{"type":"integer","minimum":1,"maximum":50},"identity_check":{"type":"boolean"},"personal_number":{"type":"string","pattern":"^(?:\\d{6}|\\d{8})[-+]?\\d{4}$"}},"required":["name","email"],"dependentSchemas":{"personal_number":{"required":["identity_check"],"properties":{"identity_check":{"const":true}}}}}}},"required":["title","deadline"]},"UpdateCase":{"type":"object","additionalProperties":false,"properties":{"title":{"type":"string","maxLength":120,"minLength":1,"pattern":"\\S"},"message":{"type":"string","maxLength":4000},"deadline":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"external_id":{"anyOf":[{"type":"string","maxLength":200,"minLength":1,"pattern":"\\S"},{"type":"null"}]},"metadata":{"type":"object","maxProperties":10,"propertyNames":{"pattern":"^[A-Za-z0-9_.-]{1,64}$","not":{"enum":["__proto__","constructor","prototype"]}},"additionalProperties":{"type":"string","maxLength":500}},"signing_order":{"type":"boolean"}},"required":[],"minProperties":1},"Participant":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":120},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["signer","reviewer"]},"signing_step":{"type":"integer","minimum":1,"maximum":50},"identity_check":{"type":"boolean"},"signed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","email","role","signing_step","identity_check","signed_at","reviewed_at"]},"SigningCase":{"type":"object","additionalProperties":false,"properties":{"object":{"const":"signing_case","type":"string"},"id":{"type":"string","format":"uuid"},"title":{"type":"string","maxLength":120},"message":{"type":"string","maxLength":4000},"deadline":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"external_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"metadata":{"type":"object","maxProperties":10,"propertyNames":{"pattern":"^[A-Za-z0-9_.-]{1,64}$","not":{"enum":["__proto__","constructor","prototype"]}},"additionalProperties":{"type":"string","maxLength":500}},"signing_order":{"type":"boolean"},"status":{"type":"string","enum":["draft","pending","partial","changes_requested","completed","declined","expired","cancelled"]},"participants":{"type":"array","maxItems":50,"items":{"$ref":"#/components/schemas/Participant"}},"document_count":{"type":"integer","minimum":0,"maximum":50},"originals_ready":{"type":"boolean"},"evidence_status":{"type":"string","enum":["not_started","processing","ready"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["object","id","title","message","deadline","external_id","metadata","signing_order","status","participants","document_count","originals_ready","evidence_status","created_at","updated_at"]},"CaseList":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SigningCase"}},"next_cursor":{"anyOf":[{"type":"string","maxLength":600},{"type":"null"}]}},"required":["data","next_cursor"]},"ParticipantList":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Participant"}}},"required":["data"]},"PrepareDocument":{"type":"object","additionalProperties":false,"properties":{"case_id":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":5,"maxLength":240,"pattern":"^[^\\u0000-\\u001f\\u007f/\\\\]+\\.[pP][dD][fF]$"},"size":{"type":"integer","minimum":1,"maximum":20971520},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["case_id","name","size","sha256"]},"DocumentError":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["invalid_pdf","size_mismatch","checksum_mismatch","storage_unavailable","upload_expired","resource_deleted"]},"message":{"type":"string"}},"required":["code","message"]},"Document":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"document"},"id":{"type":"string","format":"uuid"},"case_id":{"type":"string","format":"uuid"},"name":{"type":"string","maxLength":240},"size":{"type":"integer","minimum":1,"maximum":20971520},"status":{"type":"string","enum":["awaiting_upload","queued","processing","ready","rejected","failed","expired"]},"sha256":{"anyOf":[{"type":"string","pattern":"^[a-f0-9]{64}$"},{"type":"null"}]},"pages":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/DocumentError"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["object","id","case_id","name","size","status","sha256","pages","error","created_at","verified_at"]},"PreparedDocument":{"type":"object","additionalProperties":false,"properties":{"document":{"$ref":"#/components/schemas/Document"},"upload":{"type":"object","additionalProperties":false,"properties":{"method":{"type":"string","const":"PUT"},"url":{"type":"string","format":"uri"},"headers":{"type":"object","additionalProperties":false,"properties":{"Content-Type":{"type":"string","const":"application/pdf"},"x-upsert":{"type":"string","const":"false"}},"required":["Content-Type","x-upsert"]},"expires_at":{"type":"string","format":"date-time"}},"required":["method","url","headers","expires_at"]}},"required":["document","upload"]},"Operation":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"operation"},"id":{"type":"string","format":"uuid"},"type":{"type":"string","const":"document_verification"},"status":{"type":"string","enum":["pending","running","succeeded","failed"]},"result":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"document_id":{"type":"string","format":"uuid"}},"required":["document_id"]},{"type":"null"}]},"error":{"anyOf":[{"$ref":"#/components/schemas/DocumentError"},{"type":"null"}]}},"required":["object","id","type","status","result","error"]},"DispatchOperation":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"operation"},"id":{"type":"string","format":"uuid"},"type":{"type":"string","const":"invitation_dispatch"},"status":{"type":"string","enum":["pending","running","succeeded","failed"]},"result":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"case_id":{"type":"string","format":"uuid"}},"required":["case_id"]},{"type":"null"}]},"error":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","enum":["delivery_failed","case_cancelled"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"null"}]}},"required":["object","id","type","status","result","error"]},"AnyOperation":{"oneOf":[{"$ref":"#/components/schemas/Operation"},{"$ref":"#/components/schemas/DispatchOperation"}]},"Cancellation":{"type":"object","additionalProperties":false,"properties":{"object":{"const":"cancellation","type":"string"},"case_id":{"type":"string","format":"uuid"},"status":{"const":"cancelled","type":"string"}},"required":["object","case_id","status"]},"CreateCompanyCheck":{"type":"object","additionalProperties":false,"properties":{"organization_number":{"type":"string","pattern":"^[0-9]{6}-?[0-9]{4}$"}},"required":["organization_number"]},"ConfirmCompanyCheck":{"type":"object","additionalProperties":false,"properties":{"accepted_price_ex_vat":{"type":"integer","minimum":0},"participants":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"person_id":{"type":"string","format":"uuid"},"email":{"type":"string","format":"email","maxLength":254},"signing_step":{"type":"integer","minimum":1,"maximum":50},"identity_check":{"type":"boolean"},"personal_number":{"type":"string","minLength":10,"maxLength":13}},"required":["person_id","email"]}},"manual_reason":{"type":"string","minLength":1,"maxLength":2000,"pattern":"^[^\\u0000-\\u001f\\u007f]+$"}},"required":["accepted_price_ex_vat","participants"]},"CompanyCheckPrice":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"SEK"},"unit_amount_ex_vat":{"type":"integer","minimum":0},"vat_amount":{"type":"integer","minimum":0},"total_incl_vat":{"type":"integer","minimum":0},"quantity":{"type":"integer","const":1},"contract_id":{"type":"string","format":"uuid"},"contract_version":{"type":"integer","minimum":1}},"required":["currency","unit_amount_ex_vat","vat_amount","total_incl_vat","quantity","contract_id","contract_version"]},"CompanyCheck":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"company_check"},"id":{"type":"string","format":"uuid"},"case_id":{"type":"string","format":"uuid"},"company":{"type":"object","additionalProperties":false,"properties":{"organization_number":{"type":"string","pattern":"^[0-9]{10}$"},"name":{"type":"string"},"status":{"type":"string","enum":["active","deregistered","unknown"]}},"required":["organization_number","name","status"]},"checked_at":{"type":"string","format":"date-time"},"source_updated_at":{"type":["string","null"],"format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"fresh":{"type":"boolean"},"usable":{"type":"boolean","description":"Whether the source was usable at observation time. Confirmation additionally requires expires_at in the future. Lookup replays preserve the original source snapshot."},"registered_rules":{"type":"array","maxItems":100,"items":{"type":"string"}},"persons":{"type":"array","maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"position":{"type":"string"},"signing_right":{"type":"string","enum":["ALONE","TOGETHER","UNKNOWN"]}},"required":["id","name","position","signing_right"]}},"analysis":{"type":"object","additionalProperties":false,"properties":{"kind":{"type":"string","enum":["alone","pair","roles","unknown"]},"manual_review_required":{"type":"boolean"},"suggested_combinations":{"type":"array","maxItems":20,"items":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"string","format":"uuid"}}}},"required":["kind","manual_review_required","suggested_combinations"]},"price":{"$ref":"#/components/schemas/CompanyCheckPrice"},"fee_status":{"type":"string","const":"not_charged"},"disclaimer":{"type":"string"}},"required":["object","id","case_id","company","checked_at","source_updated_at","expires_at","fresh","usable","registered_rules","persons","analysis","price","fee_status","disclaimer"]},"CompanyCheckFee":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"SEK"},"unit_amount_ex_vat":{"type":"integer","minimum":0},"vat_amount":{"type":"integer","minimum":0},"total_incl_vat":{"type":"integer","minimum":0},"quantity":{"type":"integer","const":1},"status":{"type":"string","const":"pending_dispatch"},"collection":{"type":"string","const":"next_month"}},"required":["currency","unit_amount_ex_vat","vat_amount","total_incl_vat","quantity","status","collection"]},"CompanyCheckConfirmation":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"company_check_confirmation"},"check_id":{"type":"string","format":"uuid"},"case":{"$ref":"#/components/schemas/SigningCase"},"selected_participants":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"properties":{"person_id":{"type":"string","format":"uuid"},"participant_id":{"type":"string","format":"uuid"}},"required":["person_id","participant_id"]}},"fee":{"$ref":"#/components/schemas/CompanyCheckFee"},"disclaimer":{"type":"string"}},"required":["object","check_id","case","selected_participants","fee","disclaimer"]},"ExportDownload":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"size":{"type":"integer","minimum":1},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}},"required":["name","size","sha256","url","expires_at"]},"OriginalDownload":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"size":{"type":"integer","minimum":1},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"url":{"type":"string","format":"uri"},"expires_at":{"type":"string","format":"date-time"}},"required":["id","name","size","sha256","url","expires_at"]},"CaseDocuments":{"type":"object","additionalProperties":false,"properties":{"object":{"const":"case_documents","type":"string"},"case_id":{"type":"string","format":"uuid"},"evidence_status":{"type":"string","enum":["not_started","processing","ready","failed"]},"originals":{"type":"array","items":{"$ref":"#/components/schemas/OriginalDownload"}},"certificate":{"anyOf":[{"$ref":"#/components/schemas/ExportDownload"},{"type":"null"}]},"verification_package":{"anyOf":[{"$ref":"#/components/schemas/ExportDownload"},{"type":"null"}]},"retry_after":{"type":["integer","null"],"enum":[5,null]},"error":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string","const":"packaging_failed"},"message":{"type":"string"}},"required":["code","message"]},{"type":"null"}]}},"required":["object","case_id","evidence_status","originals","certificate","verification_package","retry_after","error"]},"EnterpriseEventType":{"type":"string","enum":["signing.created","signing.sent","signing.viewed","signing.partially_signed","signing.completed","signing.declined","signing.cancelled","signing.expired","signing.documents_ready"],"description":"Persisted development event types. Customer delivery is not enabled by E5A."},"EnterpriseEvent":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"event"},"id":{"type":"string","format":"uuid"},"type":{"$ref":"#/components/schemas/EnterpriseEventType"},"sequence":{"type":"integer","minimum":1},"environment":{"type":"string","enum":["production","sandbox"]},"occurred_at":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"signing_case"},"id":{"type":"string","format":"uuid"},"external_id":{"type":["string","null"],"maxLength":200},"status":{"type":"string","enum":["draft","pending","partial","changes_requested","completed","declined","cancelled","expired"]},"document_count":{"type":"integer","minimum":0},"participant_count":{"type":"integer","minimum":0},"signed_participant_count":{"type":"integer","minimum":0},"reviewed_participant_count":{"type":"integer","minimum":0},"evidence_status":{"type":"string","enum":["not_started","processing","ready"]}},"required":["object","id","external_id","status","document_count","participant_count","signed_participant_count","reviewed_participant_count","evidence_status"]}},"required":["object","id","type","sequence","environment","occurred_at","data"],"description":"Outbound event snapshot, not a new public endpoint. Sequence is per company/environment/case and is authoritative for ordering. Event ID and exact stored UTF-8 body remain stable for future delivery/replay. sent means the first provider-accepted invitation consumed its reservation, not a queued send request. viewed means the first verified recipient room read; completion and evidence readiness are separate. No names, emails, tokens, documents, arbitrary metadata or download URLs are included. Existing cases are not given fabricated historical created/viewed events. Transport, signing headers and subscriptions will be specified in the next delivery.","examples":[{"object":"event","id":"00000000-0000-4000-8000-000000000001","type":"signing.completed","sequence":4,"environment":"sandbox","occurred_at":"2026-10-24T10:00:00Z","data":{"object":"signing_case","id":"00000000-0000-4000-8000-000000000002","external_id":"dropin:contract:example:v1","status":"completed","document_count":1,"participant_count":2,"signed_participant_count":2,"reviewed_participant_count":0,"evidence_status":"processing"}}]},"EnterpriseWebhookTestEvent":{"type":"object","additionalProperties":false,"required":["object","id","type","environment","occurred_at","data"],"properties":{"object":{"const":"event"},"id":{"type":"string","format":"uuid"},"type":{"const":"webhook.test"},"environment":{"enum":["production","sandbox"]},"occurred_at":{"type":"string","format":"date-time"},"data":{"type":"object","additionalProperties":false,"required":["object","id","test"],"properties":{"object":{"const":"webhook_destination"},"id":{"type":"string","format":"uuid"},"test":{"const":true}}}}}}},"webhooks":{"enterpriseEvent":{"post":{"operationId":"deliverEnterpriseWebhook","summary":"Receive an Enterprise event or explicit test event","description":"Development transport contract, disabled pending pilot approval. At least once; deduplicate by event ID and process per-case sequence independently of arrival order. HMAC-SHA256 uses the full UTF-8 whsec_ secret over timestamp + dot + event ID + dot + exact raw UTF-8 body. Reject timestamps outside 300 seconds and compare in constant time against any active signing key. Rotation may send two v1 signatures. No redirects. Transient failures retry with jitter, at most 16 attempts within 24 hours per cycle. Manual redelivery keeps event ID and original body, with a new timestamp and signatures.","security":[],"parameters":[{"in":"header","name":"Signerad-Webhook-Id","required":true,"schema":{"type":"string","format":"uuid"}},{"in":"header","name":"Signerad-Webhook-Timestamp","required":true,"schema":{"type":"string","pattern":"^[0-9]{1,12}$"},"description":"Unix seconds, signed together with event ID and raw body."},{"in":"header","name":"Signerad-Webhook-Signature","required":true,"schema":{"type":"string","maxLength":256,"pattern":"^v1=[a-f0-9-]{36}\\.[a-f0-9]{64}(,v1=[a-f0-9-]{36}\\.[a-f0-9]{64})?$"},"description":"v1=<key UUID>.<hex HMAC-SHA256>, optionally followed by a second active-key signature."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/EnterpriseEvent"},{"$ref":"#/components/schemas/EnterpriseWebhookTestEvent"}]}}}},"responses":{"2XX":{"description":"Persistently accepted or already processed. Response contents are ignored and never logged."},"default":{"description":"408/425/429/5xx retry; redirects and other 4xx stop this cycle. Bodies and Retry-After headers never drive delivery."}}}}}}