{"openapi":"3.1.0","info":{"title":"SwiftSign API","version":"1.0.0","description":"Agent-native e-signature API. Sign up with one unauthenticated call, get a sandbox key, and send a sealed envelope in minutes. All endpoints except signup require a Bearer API key. Errors are RFC 9457 problem documents (application/problem+json)."},"servers":[{"url":"https://swiftsign.ca"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key as a Bearer token. Use a sk_test_… key for the sandbox (free, watermarked) or a sk_live_… key for production sends. Get one from POST /api/v1/signup."}},"schemas":{"Problem":{"type":"object","properties":{"type":{"type":"string","example":"https://swiftsign.ca/errors/validation_error"},"title":{"type":"string","example":"Request validation failed"},"status":{"type":"integer","example":400},"code":{"type":"string","example":"validation_error"},"detail":{"type":"string","example":"A valid email is required"},"request_id":{"type":"string","example":"req_8c2f9a1b3d4e5f6071829304"}},"required":["type","title","status","code","request_id"],"description":"RFC 9457 problem document, served as application/problem+json. Endpoints may add extra top-level members (e.g. errors[], unresolvedAnchors[], plan/used/limit)."},"WebhookEvent":{"type":"object","properties":{"id":{"type":"string","example":"evt_8c2f9a1b3d4e5f6071829304"},"type":{"type":"string","enum":["envelope.sent","envelope.viewed","envelope.signed","envelope.completed","envelope.declined","envelope.voided"],"example":"envelope.completed"},"createdAt":{"type":"string","format":"date-time","example":"2026-06-09T17:00:00.000Z"},"data":{"type":"object","additionalProperties":{},"description":"Event payload; always includes envelopeId."}},"required":["id","type","createdAt","data"],"description":"Envelope for every webhook delivery. Signed with the SwiftSign-Signature header (t=<unix>,v1=<HMAC-SHA256 hex over `${t}.${rawBody}`>). Respond 2xx to acknowledge."},"SignupResult":{"type":"object","properties":{"api_key":{"type":"string","description":"The plaintext secret — shown once, never again.","example":"sk_test_…"},"mode":{"type":"string","enum":["test","live"],"example":"test"},"key":{"$ref":"#/components/schemas/ApiKeyView"},"message":{"type":"string"},"verify_url":{"type":"string","format":"uri"},"docs_url":{"type":"string","format":"uri"},"terms_url":{"type":"string","format":"uri"},"privacy_url":{"type":"string","format":"uri"}},"required":["api_key","mode","key","message","verify_url","docs_url","terms_url","privacy_url"]},"ApiKeyView":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"mode":{"type":"string","enum":["TEST","LIVE"]},"prefix":{"type":"string","example":"sk_test_a1b2c3d4"},"last4":{"type":"string","example":"ef90"},"scopes":{"type":"array","items":{"type":"string"},"example":["envelopes:read","envelopes:write"]},"createdAt":{"type":"string"}},"required":["id","name","mode","prefix","last4","scopes","createdAt"]},"SignupBody":{"type":"object","properties":{"email":{"type":"string","format":"email","example":"dev@acme.com"},"name":{"type":"string","example":"Acme Dev"}},"required":["email"]},"UpgradeResult":{"anyOf":[{"type":"object","properties":{"checkout_url":{"type":"string","format":"uri","example":"https://checkout.stripe.com/…"}},"required":["checkout_url"]},{"type":"object","properties":{"status":{"type":"string","enum":["updated"]}},"required":["status"]}]},"UpgradeBody":{"type":"object","properties":{"plan":{"type":"string","enum":["PRO","TEAM"],"default":"PRO","example":"PRO"}}},"Envelope":{"type":"object","properties":{"id":{"type":"string","example":"b8f1c0a2-3d4e-5f60-7182-93041a2b3c4d"},"subject":{"type":"string"},"message":{"type":["string","null"]},"status":{"$ref":"#/components/schemas/EnvelopeStatus"},"livemode":{"type":"boolean"},"createdAt":{"type":"string","example":"2026-03-14T16:02:11.000Z"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}}},"required":["id","subject","message","status","livemode","createdAt","documents","recipients"]},"EnvelopeStatus":{"type":"string","enum":["DRAFT","SENT","COMPLETED","DECLINED","VOIDED"]},"Document":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"pageCount":{"type":"integer"},"order":{"type":"integer"}},"required":["id","name","pageCount","order"]},"Recipient":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["SIGNER","CC"]},"routingOrder":{"type":"integer"},"status":{"type":"string","example":"PENDING"}},"required":["id","name","email","role","routingOrder","status"]},"CreateEnvelopeBody":{"anyOf":[{"$ref":"#/components/schemas/InlineEnvelopeBody"},{"$ref":"#/components/schemas/TemplateEnvelopeBody"}]},"InlineEnvelopeBody":{"type":"object","properties":{"subject":{"type":"string","minLength":1,"example":"Mutual NDA for countersignature"},"message":{"type":"string","example":"Please sign at your convenience."},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentInput"},"minItems":1},"recipients":{"type":"array","items":{"$ref":"#/components/schemas/RecipientInput"},"minItems":1},"fields":{"type":"array","items":{"$ref":"#/components/schemas/FieldInput"},"default":[]}},"required":["subject","documents","recipients"],"description":"Create an envelope from inline base64 documents, recipients, and fields."},"DocumentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"mutual-nda.pdf"},"base64":{"type":"string","minLength":1,"description":"Base64-encoded PDF bytes.","example":"JVBERi0xLjcKJ…"}},"required":["name","base64"]},"RecipientInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Steve Park"},"email":{"type":"string","format":"email","example":"steve@acme.com"},"role":{"type":"string","enum":["SIGNER","CC"],"default":"SIGNER","example":"SIGNER"},"routingOrder":{"type":"integer","minimum":1,"default":1,"description":"Signing order; lower routes first.","example":1}},"required":["name","email"]},"FieldInput":{"type":"object","properties":{"recipientIndex":{"type":"integer","minimum":0,"description":"Index into the recipients[] array.","example":0},"document":{"type":"integer","minimum":0,"description":"Index into the documents[] array.","example":0},"type":{"$ref":"#/components/schemas/FieldType"},"page":{"type":"integer","minimum":-1,"default":1,"description":"1-indexed page. Ignored when anchor resolves.","example":1},"x":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"X as a percent (0–100) of page width, top-left origin.","example":12},"y":{"type":"number","minimum":0,"maximum":100,"default":0,"description":"Y as a percent (0–100) of page height, top-left origin.","example":64},"width":{"type":"number","minimum":0,"maximum":100,"example":30},"height":{"type":"number","minimum":0,"maximum":100,"example":5},"anchor":{"type":"string","description":"Anchor text to place the field next to.","example":"Party B — Signature"},"yOffset":{"type":"number","description":"Vertical nudge (percent) applied to an anchor match.","example":-2},"options":{"type":"array","items":{"type":"string"},"description":"Choices for RADIO / DROPDOWN fields.","example":["Yes","No"]}},"required":["recipientIndex","document","type"]},"FieldType":{"type":"string","enum":["SIGNATURE","NAME","DATE","TEXT","INITIALS","CHECKBOX","RADIO","DROPDOWN","ATTACHMENT"],"description":"Signature/data field type to place on a document."},"TemplateEnvelopeBody":{"type":"object","properties":{"templateId":{"type":"string","minLength":1,"example":"tmpl_3f8a9c21"},"roleAssignments":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/RoleAssignment"},"description":"Map of template roleName → { name, email }."},"subject":{"type":"string","minLength":1},"message":{"type":"string"}},"required":["templateId","roleAssignments"],"description":"Create an envelope from a saved template by assigning each role."},"RoleAssignment":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Steve Park"},"email":{"type":"string","format":"email","example":"steve@acme.com"}},"required":["name","email"]},"EnvelopeList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EnvelopeListItem"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"]},"EnvelopeListItem":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"status":{"$ref":"#/components/schemas/EnvelopeStatus"},"livemode":{"type":"boolean"},"createdAt":{"type":"string"},"recipientCount":{"type":"integer"}},"required":["id","subject","status","livemode","createdAt","recipientCount"]},"EnvelopeActionResult":{"type":"object","properties":{"status":{"type":"string","enum":["sent","voided"]},"envelopeId":{"type":"string"}},"required":["status","envelopeId"]},"EnvelopeActionBody":{"type":"object","properties":{"action":{"type":"string","enum":["send","void"],"example":"send"}},"required":["action"]},"EmbeddedUrl":{"type":"object","properties":{"url":{"type":"string","format":"uri","example":"https://swiftsign.ca/embed/abc123…"},"expiresAt":{"type":"string","example":"2026-03-14T16:32:11.000Z"}},"required":["url","expiresAt"]},"EmbeddedUrlBody":{"type":"object","properties":{"returnUrl":{"type":"string","format":"uri","description":"https URL to return the signer to after signing.","example":"https://acme.com/signed"}}},"Template":{"type":"object","properties":{"id":{"type":"string","example":"tmpl_3f8a9c21"},"name":{"type":"string"},"description":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","createdAt","updatedAt"]},"CreateTemplateBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"example":"Standard MSA"},"description":{"type":"string"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentInput"},"minItems":1},"roles":{"type":"array","items":{"$ref":"#/components/schemas/TemplateRoleInput"},"minItems":1},"fields":{"type":"array","items":{"$ref":"#/components/schemas/TemplateFieldInput"},"default":[]}},"required":["name","documents","roles"]},"TemplateRoleInput":{"type":"object","properties":{"roleName":{"type":"string","minLength":1,"example":"Client"},"routingOrder":{"type":"integer","minimum":1,"default":1},"recipientType":{"type":"string","enum":["SIGNER","CC"],"default":"SIGNER"}},"required":["roleName"]},"TemplateFieldInput":{"type":"object","properties":{"role":{"type":"integer","minimum":0,"description":"Index into roles[]."},"document":{"type":"integer","minimum":0,"description":"Index into documents[]."},"type":{"$ref":"#/components/schemas/FieldType"},"page":{"type":"integer","minimum":1,"default":1},"anchor":{"type":"string"},"x":{"type":"number","minimum":0,"maximum":100,"default":0},"y":{"type":"number","minimum":0,"maximum":100,"default":0},"width":{"type":"number","minimum":0,"maximum":100},"height":{"type":"number","minimum":0,"maximum":100},"required":{"type":"boolean","default":true},"options":{"type":"array","items":{"type":"string"}}},"required":["role","document","type"]},"TemplateList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateListItem"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"]},"TemplateListItem":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"documentCount":{"type":"integer"},"roleCount":{"type":"integer"},"fieldCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","documentCount","roleCount","fieldCount","createdAt","updatedAt"]},"UpdateTemplateBody":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":["string","null"]}}}},"parameters":{}},"paths":{"/api/v1/signup":{"post":{"tags":["Auth"],"summary":"Provision a sandbox account + sk_test_ key","description":"Unauthenticated. One call creates an account and returns a TEST key so an agent or curl is productive immediately. No browser required. Creating an account constitutes acceptance of the Terms of Service at /legal/terms and acknowledgement of the Privacy Policy at /legal/privacy.","security":[],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupBody"}}}},"responses":{"201":{"description":"Account created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResult"}}}},"409":{"description":"An account with this email already exists.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Too many signups from this IP.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/billing/upgrade":{"post":{"tags":["Billing"],"summary":"Start an upgrade to a paid plan","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeBody"}}}},"responses":{"200":{"description":"A Stripe Checkout URL, or { status: \"updated\" } if no payment is needed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeResult"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"Billing is not currently available.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/envelopes":{"post":{"tags":["Envelopes"],"summary":"Create an envelope (inline or from a template)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Optional. Replays the original response for a duplicate request body.","example":"a1b2c3d4-e5f6-7890-abcd-ef0123456789"},"required":false,"description":"Optional. Replays the original response for a duplicate request body.","name":"Idempotency-Key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEnvelopeBody"}}}},"responses":{"201":{"description":"Envelope created (DRAFT). Call POST /api/v1/envelopes/{id} with action:\"send\".","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"400":{"description":"Validation error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"402":{"description":"Monthly envelope quota exceeded.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key lacks the envelopes:write scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"One or more field anchors could not be resolved.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limited.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"get":{"tags":["Envelopes"],"summary":"List envelopes (cursor pagination)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","description":"Opaque cursor from next_cursor."},"required":false,"description":"Opaque cursor from next_cursor.","name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Default 25, max 100.","example":25},"required":false,"description":"Default 25, max 100.","name":"limit","in":"query"},{"schema":{"$ref":"#/components/schemas/EnvelopeStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["live","test"],"description":"Defaults to the key’s mode."},"required":false,"description":"Defaults to the key’s mode.","name":"mode","in":"query"},{"schema":{"type":"string","description":"ISO 8601 lower bound."},"required":false,"description":"ISO 8601 lower bound.","name":"created_after","in":"query"},{"schema":{"type":"string","description":"ISO 8601 upper bound."},"required":false,"description":"ISO 8601 upper bound.","name":"created_before","in":"query"},{"schema":{"type":"string","format":"email"},"required":false,"name":"recipient_email","in":"query"}],"responses":{"200":{"description":"A page of envelopes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvelopeList"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key lacks the envelopes:read scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/envelopes/{id}":{"get":{"tags":["Envelopes"],"summary":"Retrieve an envelope","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The envelope, including recipients, documents, and audit log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Envelope not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"post":{"tags":["Envelopes"],"summary":"Send or void an envelope","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvelopeActionBody"}}}},"responses":{"200":{"description":"Action applied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvelopeActionResult"}}}},"400":{"description":"Invalid action.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Envelope not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Envelope is not in a valid state for this action.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/envelopes/{id}/recipients/{recipientId}/embedded-url":{"post":{"tags":["Envelopes"],"summary":"Mint a short-lived embedded signing URL","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"recipientId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddedUrlBody"}}}},"responses":{"200":{"description":"A single-use iframe URL valid for 30 minutes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddedUrl"}}}},"400":{"description":"returnUrl must be a valid https URL.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Envelope or recipient not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Recipient cannot be embedded in the current state.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/envelopes/{id}/download":{"get":{"tags":["Envelopes"],"summary":"Download the sealed PDF or Certificate of Completion","description":"Returns the sealed document (or the Certificate of Completion when certificate=true) for a COMPLETED envelope. Authenticate with the Bearer API key (envelopes:read) or a recipient signing token via ?token.","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":["integer","null"],"minimum":0,"description":"Document index to download (default 0)."},"required":false,"description":"Document index to download (default 0).","name":"doc","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"If \"true\", download the Certificate of Completion instead of the document."},"required":false,"description":"If \"true\", download the Certificate of Completion instead of the document.","name":"certificate","in":"query"},{"schema":{"type":"string","description":"Recipient signing token, as an alternative to the API key."},"required":false,"description":"Recipient signing token, as an alternative to the API key.","name":"token","in":"query"}],"responses":{"200":{"description":"The sealed PDF (application/pdf).","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Invalid document index.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key or signing token.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Envelope, document, or sealed file not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"Envelope is not COMPLETED yet.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/templates":{"post":{"tags":["Templates"],"summary":"Create a reusable template","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTemplateBody"}}}},"responses":{"201":{"description":"Template created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Validation error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"API key lacks the envelopes:write scope.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"get":{"tags":["Templates"],"summary":"List templates (cursor pagination)","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"Default 25, max 100."},"required":false,"description":"Default 25, max 100.","name":"limit","in":"query"}],"responses":{"200":{"description":"A page of templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateList"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/templates/{id}":{"get":{"tags":["Templates"],"summary":"Retrieve a template","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The template, including documents, roles, and fields.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Template not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"patch":{"tags":["Templates"],"summary":"Update a template’s name or description","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTemplateBody"}}}},"responses":{"200":{"description":"The updated template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"}}}},"400":{"description":"Validation error.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Template not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}},"delete":{"tags":["Templates"],"summary":"Delete a template","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid API key.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"Template not found.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"webhooks":{"envelope.sent":{"post":{"summary":"An envelope was dispatched to its first signer batch.","description":"Sent to your subscribed endpoint when an envelope was dispatched to its first signer batch. Verify the SwiftSign-Signature header before trusting the body.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx stops retries."}}}},"envelope.viewed":{"post":{"summary":"A signer opened their signing link.","description":"Sent to your subscribed endpoint when a signer opened their signing link. Verify the SwiftSign-Signature header before trusting the body.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx stops retries."}}}},"envelope.signed":{"post":{"summary":"A signer completed their fields (more signers may remain).","description":"Sent to your subscribed endpoint when a signer completed their fields (more signers may remain). Verify the SwiftSign-Signature header before trusting the body.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx stops retries."}}}},"envelope.completed":{"post":{"summary":"Every signer finished; sealed PDFs + Certificate are ready to download.","description":"Sent to your subscribed endpoint when every signer finished; sealed PDFs + Certificate are ready to download. Verify the SwiftSign-Signature header before trusting the body.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx stops retries."}}}},"envelope.declined":{"post":{"summary":"A signer declined to sign.","description":"Sent to your subscribed endpoint when a signer declined to sign. Verify the SwiftSign-Signature header before trusting the body.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx stops retries."}}}},"envelope.voided":{"post":{"summary":"The sender voided the envelope.","description":"Sent to your subscribed endpoint when the sender voided the envelope. Verify the SwiftSign-Signature header before trusting the body.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Acknowledged. Any 2xx stops retries."}}}}}}