{"openapi":"3.1.0","info":{"title":"SignLayer API","version":"0.1.0","description":"API-first EU electronic-signing infrastructure for applications and agents. Version 1 supports simple electronic signatures; it does not claim QES or qualified trust-service status."},"servers":[{"url":"https://app.signlayer.eu/api/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Documents"},{"name":"Signing requests"},{"name":"Signer sessions"},{"name":"Webhooks"},{"name":"Usage"},{"name":"Workspace setup"}],"paths":{"/health":{"get":{"operationId":"getHealth","security":[],"responses":{"200":{"description":"Healthy"}}}},"/documents":{"post":{"tags":["Documents"],"operationId":"createDocument","summary":"Create a presigned PDF upload","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocument"}}}},"responses":{"201":{"description":"Upload created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}},"get":{"tags":["Documents"],"operationId":"listDocuments","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Documents"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/documents/{id}":{"get":{"tags":["Documents"],"operationId":"getDocument","parameters":[{"$ref":"#/components/parameters/ResourceId"},{"name":"kind","in":"query","schema":{"enum":["source","completed","evidence"]}}],"responses":{"200":{"description":"Document"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/documents/{id}/finalize":{"post":{"tags":["Documents"],"operationId":"finalizeDocument","summary":"Verify an uploaded PDF","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"description":"Document verified"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/signing_requests":{"post":{"tags":["Signing requests"],"operationId":"createSigningRequest","summary":"Create a draft signing request","description":"Creation is side-effect free: it does not send email and does not create billable usage.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSigningRequest"}}}},"responses":{"201":{"description":"Signing request created"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}},"get":{"tags":["Signing requests"],"operationId":"listSigningRequests","parameters":[{"$ref":"#/components/parameters/Cursor"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"Signing requests"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/signing_requests/{id}":{"get":{"tags":["Signing requests"],"operationId":"getSigningRequest","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"description":"Signing request"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/signing_requests/{id}/send":{"post":{"tags":["Signing requests"],"operationId":"sendSigningRequest","summary":"Queue signer invitations","description":"Sending is an explicit external side effect. Each signer invitation on a live request creates one billable signature request, regardless of its later outcome.","parameters":[{"$ref":"#/components/parameters/ResourceId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"202":{"description":"Send queued"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/signing_requests/{id}/cancel":{"post":{"tags":["Signing requests"],"operationId":"cancelSigningRequest","summary":"Cancel an active signing request","description":"Cancellation is explicit and idempotent. Completed, declined and expired requests remain terminal.","parameters":[{"$ref":"#/components/parameters/ResourceId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":255}}],"responses":{"200":{"description":"Request cancelled"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/signing_requests/{id}/audit":{"get":{"tags":["Signing requests"],"operationId":"getAuditTrail","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"200":{"description":"Chained audit events"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/signer/{token}":{"get":{"tags":["Signer sessions"],"security":[],"operationId":"getSignerSession","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Signer session"},"404":{"$ref":"#/components/responses/Problem"},"410":{"$ref":"#/components/responses/Problem"}}},"post":{"tags":["Signer sessions"],"security":[],"operationId":"submitSignerAction","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SignAction"},{"$ref":"#/components/schemas/DeclineAction"}]}}}},"responses":{"200":{"description":"Signer action recorded"},"409":{"$ref":"#/components/responses/Problem"},"410":{"$ref":"#/components/responses/Problem"}}}},"/webhook_endpoints":{"post":{"tags":["Webhooks"],"operationId":"createWebhookEndpoint","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpoint"}}}},"responses":{"201":{"description":"Endpoint created; secret is returned once"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}},"get":{"tags":["Webhooks"],"operationId":"listWebhookEndpoints","responses":{"200":{"description":"Webhook endpoints"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/webhook_endpoints/{id}":{"delete":{"tags":["Webhooks"],"operationId":"disableWebhookEndpoint","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"204":{"description":"Endpoint disabled"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/usage":{"get":{"tags":["Usage"],"operationId":"getUsage","responses":{"200":{"description":"Current-month usage"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/device_authorizations":{"post":{"tags":["Agent onboarding"],"security":[],"operationId":"startDeviceAuthorization","summary":"Start browser-approved sandbox onboarding","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartDeviceAuthorization"}}}},"responses":{"201":{"description":"Approval code created"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/device_authorizations/token":{"post":{"tags":["Agent onboarding"],"security":[],"operationId":"exchangeDeviceAuthorization","summary":"Poll and exchange an approved device code exactly once","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["device_code"],"properties":{"device_code":{"type":"string","pattern":"^sl_device_"}}}}}},"responses":{"200":{"description":"Sandbox key returned once"},"202":{"description":"Authorization pending"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"410":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}},"/workspaces":{"get":{"tags":["Workspace setup"],"security":[{"clerkSession":[]}],"operationId":"listWorkspaces","responses":{"200":{"description":"Workspaces"}}},"post":{"tags":["Workspace setup"],"security":[{"clerkSession":[]}],"operationId":"createWorkspace","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","slug"],"properties":{"name":{"type":"string"},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}}}}},"responses":{"201":{"description":"Workspace created"}}}},"/api_keys":{"get":{"tags":["Workspace setup"],"security":[{"clerkSession":[]}],"operationId":"listApiKeys","parameters":[{"name":"workspace_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"API key metadata"}}},"post":{"tags":["Workspace setup"],"security":[{"clerkSession":[]}],"operationId":"createApiKey","responses":{"201":{"description":"API key created; secret is returned once"}}}},"/api_keys/{id}":{"delete":{"tags":["Workspace setup"],"security":[{"clerkSession":[]}],"operationId":"revokeApiKey","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"204":{"description":"API key revoked"},"404":{"$ref":"#/components/responses/Problem"}}}},"/api_keys/{id}/rotate":{"post":{"tags":["Workspace setup"],"security":[{"clerkSession":[]}],"operationId":"rotateApiKey","summary":"Replace and revoke an API key","parameters":[{"$ref":"#/components/parameters/ResourceId"}],"responses":{"201":{"description":"Replacement key created; new secret is returned once and the old key is revoked"},"400":{"$ref":"#/components/responses/Problem"},"401":{"$ref":"#/components/responses/Problem"},"403":{"$ref":"#/components/responses/Problem"},"404":{"$ref":"#/components/responses/Problem"},"409":{"$ref":"#/components/responses/Problem"},"429":{"$ref":"#/components/responses/Problem"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"SignLayer API key"},"clerkSession":{"type":"apiKey","in":"cookie","name":"__session"}},"parameters":{"ResourceId":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string","format":"date-time"}},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}},"responses":{"Problem":{"description":"RFC 9457 problem response","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}},"schemas":{"Problem":{"type":"object","required":["type","title","status"],"properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"request_id":{"type":"string","format":"uuid"}}},"CreateDocument":{"type":"object","additionalProperties":false,"required":["filename","byte_size","sha256"],"properties":{"filename":{"type":"string","pattern":"\\.pdf$"},"byte_size":{"type":"integer","maximum":26214400},"sha256":{"type":"string","pattern":"^[a-fA-F0-9]{64}$"}}},"DocumentUpload":{"type":"object","required":["id","status","upload"],"properties":{"id":{"type":"string","format":"uuid"},"status":{"const":"awaiting_upload"},"upload":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"method":{"const":"PUT"},"headers":{"type":"object","additionalProperties":{"type":"string"}}}}}},"SignatureField":{"type":"object","additionalProperties":false,"required":["page","type","x","y","width","height"],"properties":{"page":{"type":"integer","minimum":1},"type":{"const":"signature"},"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"width":{"type":"integer","minimum":80},"height":{"type":"integer","minimum":30},"required":{"type":"boolean","default":true}}},"CreateSigningRequest":{"type":"object","additionalProperties":false,"required":["document_id","subject","signers"],"properties":{"document_id":{"type":"string","format":"uuid"},"subject":{"type":"string"},"message":{"type":"string"},"expires_at":{"type":"string","format":"date-time"},"signers":{"type":"array","minItems":1,"items":{"type":"object","required":["email","name","fields"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"},"order":{"type":"integer","default":0},"fields":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/SignatureField"}}}}}}},"SignAction":{"type":"object","required":["action","consent","signature_name"],"properties":{"action":{"const":"sign"},"consent":{"const":true},"signature_name":{"type":"string"}}},"DeclineAction":{"type":"object","required":["action"],"properties":{"action":{"const":"decline"},"reason":{"type":"string"}}},"CreateWebhookEndpoint":{"type":"object","required":["url","events"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string"},"default":["*"]}}},"StartDeviceAuthorization":{"type":"object","additionalProperties":false,"required":["workspace_name","workspace_slug"],"properties":{"workspace_name":{"type":"string"},"workspace_slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"}}}}}}