{"openapi":"3.1.0","info":{"title":"WeGoSign API","version":"1.0.0","description":"REST API for templates, envelopes, signing, packages, bulk sends, invoices, webhooks, SSO, and business apps. Authenticate with an API key from Settings → API Keys. Generated from the route surface; examples come from the developer docs.","contact":{"name":"WeGoSign support","email":"support@wegosign.com","url":"https://www.wegosign.com/docs"}},"servers":[{"url":"https://www.wegosign.com/api/v1"}],"tags":[{"name":"apps"},{"name":"bulk-sends"},{"name":"business-intake"},{"name":"envelopes"},{"name":"event-ledger"},{"name":"hiring-packets"},{"name":"invoices"},{"name":"organization"},{"name":"packages"},{"name":"record-documents"},{"name":"renewals-compliance"},{"name":"sso"},{"name":"templates"},{"name":"webhooks"}],"paths":{"/apps":{"get":{"operationId":"get-apps","tags":["apps"],"summary":"Discover apps","description":"Available apps and schema discovery paths.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records":{"get":{"operationId":"get-apps-by-appSlug-records","tags":["apps"],"summary":"List App Records","description":"Lists records for an available generic business app.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug, such as business-intake, hiring-packets, or renewals-compliance"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"record":{"id":"rec_abc123","appSlug":"business-intake","recordType":"vendor_onboarding","title":"Acme Catering","status":"pending_review"}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records","tags":["apps"],"summary":"Create App Record","description":"Creates a generic app record using the app's default record type unless recordType is provided. Use fields for declared typed values from the schema endpoint and relatedParty for contact details.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"}],"requestBody":{"required":true,"description":"Generic app record fields","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Acme Catering","recordType":"vendor_onboarding","status":"pending_review","metadata":{"contactEmail":"sam@example.com"}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"rec_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId","tags":["apps"],"summary":"Get App Record","description":"Returns one generic app record by ID.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"record":{"id":"rec_abc123","appSlug":"business-intake","recordType":"vendor_onboarding","title":"Acme Catering","status":"pending_review"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-apps-by-appSlug-records-by-recordId","tags":["apps"],"summary":"Update App Record","description":"Atomically updates status, title, description, dates, amounts, contact or typed fields. Discover fields with the schema endpoint. fields merges declared keys; null clears optional fields. Legacy metadata replaces metadata; do not send both.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"requestBody":{"required":false,"description":"Partial record update","content":{"application/json":{"schema":{"type":"object"},"example":{"status":"approved","title":"Reviewed onboarding"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"record_abc123","title":"Reviewed onboarding","status":"approved"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/approvals":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-approvals","tags":["apps"],"summary":"List App Record Approvals","description":"Lists approval requests for a generic app record.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"appr_abc123","entityType":"vendor_onboarding","status":"pending"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-approvals","tags":["apps"],"summary":"Request App Record Approval","description":"Creates an internal approval request for a generic app record.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"requestBody":{"required":true,"description":"Approval request payload","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Finance approval","mode":"sequential","approvers":[{"approverEmail":"finance@example.com","stepNumber":1}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"appr_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/documents":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-documents","tags":["apps"],"summary":"List App Record Documents","description":"Lists documents attached to a generic app record. The API resolves the record and uses its actual record type.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"doc_abc123","entityType":"vendor_onboarding","fileName":"acme-w9.pdf","status":"pending_review"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-documents","tags":["apps"],"summary":"Attach App Record Document","description":"Uploads a base64-encoded document to a generic app record.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"requestBody":{"required":true,"description":"Document upload payload","content":{"application/json":{"schema":{"type":"object"},"example":{"requirementKey":"tax_form","label":"Signed W-9","document":{"filename":"acme-w9.pdf","contentType":"application/pdf","data":"base64..."}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"doc_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/documents/{documentId}/review":{"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-documents-by-documentId-review","tags":["apps"],"summary":"Review record document","description":"Document readiness review; individual approval decisions remain session-authenticated. Status: approved, rejected, needs_revision, expired; optional rejectionReason.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"status":"approved"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"document_id","status":"approved"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/ledger":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-ledger","tags":["apps"],"summary":"List a Record's Ledger","description":"Money movements against a record, newest first, with totals in, out, net, and by kind. Grant Tracker reads the ledger as disbursements and spend against the award; Asset Checkout as deposits held, refunded, applied, and damage charges. Amounts are integer minor units (kobo).","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"ledger_abc123","kind":"disbursement","direction":"in","amountKobo":2500000,"currency":"NGN","entryDate":1757328000000,"description":"Tranche 1","reference":"FF-2026-01","createdAt":1757328000000}],"totals":{"inKobo":2500000,"outKobo":0,"netKobo":2500000,"byKind":{"disbursement":2500000,"expense":0},"currency":"NGN","mixedCurrency":false}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-ledger","tags":["apps"],"summary":"Add a Ledger Entry","description":"Records one money movement on a record. kind is one of disbursement, expense, deposit_held, deposit_applied, deposit_refund, damage_charge, payment, other; direction (in or out) defaults from the kind; amountKobo is a whole non-negative amount in minor units; currency defaults to NGN; entryDate accepts a millisecond timestamp or an ISO date and defaults to now. Emits app.record.updated.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"requestBody":{"required":true,"description":"kind, amountKobo, and description are required; direction, currency, entryDate, reference, and invoiceId are optional","content":{"application/json":{"schema":{"type":"object"},"example":{"kind":"expense","amountKobo":120000,"currency":"NGN","entryDate":"2026-09-01","description":"Field visit","reference":"EXP-9"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"ledger_abc124","recordId":"record_abc123","kind":"expense","direction":"out","amountKobo":120000,"currency":"NGN","entryDate":1756684800000,"description":"Field visit","reference":"EXP-9"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/links":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-links","tags":["apps"],"summary":"List Linked Envelopes and Invoices","description":"Envelopes and client invoices linked to a record, with the linked document's current title and status.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"link_abc123","linkType":"agreement_envelope","targetId":"env_abc123","createdAt":1757328000000,"target":{"kind":"envelope","id":"env_abc123","title":"Grant agreement","status":"completed"}}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-links","tags":["apps"],"summary":"Link an Envelope or Invoice to a Record","description":"Attaches a signed envelope or a client invoice to any generic app record. For Agreements & Revenue the engagement status also follows the linked document (contract sent or signed, invoice ready, sent, partially paid, paid).","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"requestBody":{"required":true,"description":"Exactly one of envelopeId or invoiceId","content":{"application/json":{"schema":{"type":"object"},"example":{"envelopeId":"env_abc123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"record_abc123","linkId":"link_abc123","status":"contract_sent","linked":{"envelopeId":"env_abc123"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/obligations":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-obligations","tags":["apps"],"summary":"List obligations","description":"Includes a proposed Grant Tracker reporting schedule; this read does not create obligations.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"items":[],"proposedSchedule":[]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-obligations","tags":["apps"],"summary":"Add obligations","description":"Atomic batch of at most 60 items; matching titles and dates are skipped.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"items":[{"title":"Quarterly report","kind":"report","dueDate":1803859200000}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"ids":["obligation_id"],"created":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/obligations/{obligationId}":{"patch":{"operationId":"patch-apps-by-appSlug-records-by-recordId-obligations-by-obligationId","tags":["apps"],"summary":"Update obligation","description":"Edit title, kind, dueDate, notes or status (open, submitted, waived).","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}},{"name":"obligationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"status":"waived"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"resource_id"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"delete":{"operationId":"delete-apps-by-appSlug-records-by-recordId-obligations-by-obligationId","tags":["apps"],"summary":"Delete obligation","description":"Deletes this record obligation.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}},{"name":"obligationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/obligations/{obligationId}/complete":{"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-obligations-by-obligationId-complete","tags":["apps"],"summary":"Submit obligation","description":"Optional documentId must belong to the same record; notes are optional.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}},{"name":"obligationId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"notes":"Report submitted"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"resource_id"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/portal-links":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-portal-links","tags":["apps"],"summary":"List App Record Portal Links","description":"Lists public intake portal links for a generic app record.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"portal_abc123","status":"active","recipientEmail":"sam@example.com"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-portal-links","tags":["apps"],"summary":"Create App Record Portal Link","description":"Creates a public intake portal link for a generic app record.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"}],"requestBody":{"required":true,"description":"Portal link payload","content":{"application/json":{"schema":{"type":"object"},"example":{"recipientName":"Sam Lee","recipientEmail":"sam@example.com","notificationChannels":["email"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"portal_abc123","url":"https://www.wegosign.com/intake/token"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/portal-links/{portalLinkId}":{"delete":{"operationId":"delete-apps-by-appSlug-records-by-recordId-portal-links-by-portalLinkId","tags":["apps"],"summary":"Revoke App Record Portal Link","description":"Revokes a public intake portal link for a generic app record.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"},"description":"Generic app record ID"},{"name":"portalLinkId","in":"path","required":true,"schema":{"type":"string"},"description":"Portal link ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"status":"revoked"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/presets":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-presets","tags":["apps"],"summary":"List record presets","description":"Built-in and organization bundles with suggested and applied state.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"presets":[],"appliedKeys":[]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-presets","tags":["apps"],"summary":"Apply record preset","description":"Applies a discovered presetKey without duplicating existing tasks or requirements.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"presetKey":"key_from_list"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"tasksCreated":1,"requirementsAdded":1,"presetName":"Selected preset"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/signing":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-signing","tags":["apps"],"summary":"Get record signing options","description":"Discover signable requirements, derived placeholders and previous sends.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"signable":[],"party":{},"placeholderValues":[],"linked":[]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-signing","tags":["apps"],"summary":"Send record requirement for signature","description":"Choose exactly one templateId or packageId and a declared requirementKey. Supply all countersigners. requestKey is required: identical retries replay the original envelope; different arguments with the same key return 409. Completion attaches the signed PDF and applies the declared transition.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"requestKey":"offer_send_001","requirementKey":"key_from_options","templateId":"template_id","signerName":"Ada","signerEmail":"ada@example.com"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"envelopeId":"envelope_id","status":"offer_sent","replayed":false}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/tasks":{"get":{"operationId":"get-apps-by-appSlug-records-by-recordId-tasks","tags":["apps"],"summary":"List record tasks","description":"The record action register.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-tasks","tags":["apps"],"summary":"Create record task","description":"Optional description, dueDate and ownerUserId; owner must be an active organization member.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Review documents"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"resource_id"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/tasks/{taskId}":{"patch":{"operationId":"patch-apps-by-appSlug-records-by-recordId-tasks-by-taskId","tags":["apps"],"summary":"Update record task","description":"Edit task fields or status: open, in_progress, completed, cancelled.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"status":"completed"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"resource_id"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/{recordId}/team":{"post":{"operationId":"post-apps-by-appSlug-records-by-recordId-team","tags":["apps"],"summary":"Assign record team member","description":"Assign an active organization member as owner, contributor, approver or viewer.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}},{"name":"recordId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Request fields","content":{"application/json":{"schema":{"type":"object"},"example":{"userId":"user_id","role":"contributor"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"resource_id"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/calendar.ics":{"get":{"operationId":"get-apps-by-appSlug-records-calendar-ics","tags":["apps"],"summary":"Subscribe to App Record Dates as an iCalendar Feed","description":"An iCalendar (ICS) feed with one all-day event per record that has a due date (up to 2000 rows). Each event's UID is the record ID, so calendar apps update events in place, and the URL opens the record in the dashboard. Accepts the same filters as the list route.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":"BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//WeGoSign//renewals-compliance//EN\nBEGIN:VEVENT\nUID:rec_abc123@wegosign\nDTSTART;VALUE=DATE:20261215\nDTEND;VALUE=DATE:20261216\nSUMMARY:Liability policy — Expiring Soon\nURL:https://www.wegosign.com/acme/apps/renewals-compliance/rec_abc123\nEND:VEVENT\nEND:VCALENDAR"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/records/export":{"get":{"operationId":"get-apps-by-appSlug-records-export","tags":["apps"],"summary":"Export App Records as CSV","description":"Downloads the app's records (newest first, up to 2000 rows) as a CSV with one column per typed field. Accepts the same filters as the list route.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"},"description":"Available app slug"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":"id,title,status,recordType,owner,createdAt,updatedAt,dueDate,amount,currency,partyName,partyEmail,partyCompany,partyPhone,funder,programName\nrec_abc123,Community health award,active,grant,Ada Lovelace,2026-09-08T10:00:00.000Z,2026-09-08T10:00:00.000Z,2026-12-15T00:00:00.000Z,50000.00,NGN,Program Officer,officer@funder.org,Ford Foundation,,Ford Foundation,Health"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/{appSlug}/schema":{"get":{"operationId":"get-apps-by-appSlug-schema","tags":["apps"],"summary":"Discover app schema","description":"Typed fields, statuses, document requirements and signing policies. Optional recordId resolves record overrides; subtype selects a record subtype.","parameters":[{"name":"appSlug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"appSlug":"hiring-packets","recordType":"hiring_packet","fields":[],"requirements":[],"allowedTransitions":[]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/asset-checkout/assets":{"get":{"operationId":"get-apps-asset-checkout-assets","tags":["apps"],"summary":"List Assets","description":"The asset register sorted by tag, each with its current holder (the loan record, holder name, and due date) when checked out. Retired assets are hidden unless status=retired or includeRetired=true.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"asset_abc123","assetTag":"MBP-001","name":"MacBook Pro 16","category":"Laptop","serialNumber":"C02XYZ","valueKobo":250000000,"currency":"NGN","condition":"good","status":"checked_out","currentRecordId":"record_abc123","holder":{"recordId":"record_abc123","recordTitle":"Laptop for Ada","recordStatus":"checked_out","holderName":"Ada Lovelace","dueDate":1760313600000},"createdAt":1757328000000,"updatedAt":1757328000000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-asset-checkout-assets","tags":["apps"],"summary":"Create an Asset","description":"Adds an asset to the register. assetTag must be unique within the organization (a duplicate is a 400); condition defaults to good and status to available. purchaseDate is a calendar date (YYYY-MM-DD); valueKobo is a whole non-negative amount in minor units.","requestBody":{"required":true,"description":"assetTag, name, and category are required; serialNumber, purchaseDate, valueKobo, currency, condition (new, good, fair, damaged, lost, retired), and notes are optional","content":{"application/json":{"schema":{"type":"object"},"example":{"assetTag":"MBP-001","name":"MacBook Pro 16","category":"Laptop","serialNumber":"C02XYZ","purchaseDate":"2026-01-15","valueKobo":250000000,"currency":"NGN","condition":"new"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"asset_abc123","assetTag":"MBP-001","name":"MacBook Pro 16","category":"Laptop","condition":"new","status":"available","holder":null,"createdAt":1757328000000,"updatedAt":1757328000000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/asset-checkout/assets/{assetId}":{"get":{"operationId":"get-apps-asset-checkout-assets-by-assetId","tags":["apps"],"summary":"Get an Asset","description":"One asset with its current holder. An asset that does not exist or belongs to another organization is a 404.","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"},"description":"Asset ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"asset_abc123","assetTag":"MBP-001","name":"MacBook Pro 16","category":"Laptop","condition":"good","status":"available","holder":null,"createdAt":1757328000000,"updatedAt":1757328000000}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-apps-asset-checkout-assets-by-assetId","tags":["apps"],"summary":"Update or Retire an Asset","description":"Updates register fields (assetTag, name, category, serialNumber, purchaseDate, valueKobo, currency, condition, notes). Setting condition to new, good, or fair on an asset in maintenance returns it to available. Send { \"status\": \"retired\" } (optionally with notes) to retire the asset; retiring is refused while it is checked out, and any other status is a 400 because loans move through the check-out and check-in routes.","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"},"description":"Asset ID"}],"requestBody":{"required":false,"description":"Any register field, or status: retired on its own","content":{"application/json":{"schema":{"type":"object"},"example":{"condition":"fair","notes":"Scuffed lid, works fine"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"asset_abc123","assetTag":"MBP-001","condition":"fair","status":"available","notes":"Scuffed lid, works fine","holder":null,"updatedAt":1757414400000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/asset-checkout/assets/{assetId}/check-in":{"post":{"operationId":"post-apps-asset-checkout-assets-by-assetId-check-in","tags":["apps"],"summary":"Check an Asset In","description":"Releases the asset from its loan with the condition it came back in. The record gets returnedDate (today), condition, and optional conditionNotes and emits app.record.updated; the asset returns to available, or waits in maintenance when damaged or lost. An asset that is not checked out is a 400.","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"},"description":"Asset ID"}],"requestBody":{"required":true,"description":"condition is one of new, good, fair, damaged, lost; conditionNotes is optional","content":{"application/json":{"schema":{"type":"object"},"example":{"condition":"damaged","conditionNotes":"Cracked screen"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"asset_abc123","assetTag":"MBP-001","condition":"damaged","status":"maintenance","holder":null},"recordId":"record_abc123"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/asset-checkout/assets/{assetId}/check-out":{"post":{"operationId":"post-apps-asset-checkout-assets-by-assetId-check-out","tags":["apps"],"summary":"Check an Asset Out","description":"Binds an available asset to an Asset Checkout loan record: the record gets assetId, assetTag, assetDescription, and checkoutDate (today unless already set) and emits app.record.updated. An asset that is not available, or a record from another app, is a 400; a missing asset or record is a 404.","parameters":[{"name":"assetId","in":"path","required":true,"schema":{"type":"string"},"description":"Asset ID"}],"requestBody":{"required":true,"description":"recordId of the Asset Checkout record receiving the asset","content":{"application/json":{"schema":{"type":"object"},"example":{"recordId":"record_abc123"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"asset_abc123","assetTag":"MBP-001","status":"checked_out","currentRecordId":"record_abc123","holder":{"recordId":"record_abc123","recordTitle":"Laptop for Ada","holderName":"Ada Lovelace"}},"recordId":"record_abc123"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/event-ledger":{"get":{"operationId":"get-apps-event-ledger","tags":["apps"],"summary":"GET /apps/event-ledger","responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-event-ledger","tags":["apps"],"summary":"POST /apps/event-ledger","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/event-ledger/{id}":{"get":{"operationId":"get-apps-event-ledger-by-id","tags":["apps"],"summary":"GET /apps/event-ledger/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-apps-event-ledger-by-id","tags":["apps"],"summary":"PATCH /apps/event-ledger/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/event-ledger/{id}/expenses":{"get":{"operationId":"get-apps-event-ledger-by-id-expenses","tags":["apps"],"summary":"GET /apps/event-ledger/{id}/expenses","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-event-ledger-by-id-expenses","tags":["apps"],"summary":"POST /apps/event-ledger/{id}/expenses","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/event-ledger/{id}/import-meetumo":{"post":{"operationId":"post-apps-event-ledger-by-id-import-meetumo","tags":["apps"],"summary":"POST /apps/event-ledger/{id}/import-meetumo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/apps/event-ledger/{id}/sponsors":{"get":{"operationId":"get-apps-event-ledger-by-id-sponsors","tags":["apps"],"summary":"GET /apps/event-ledger/{id}/sponsors","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-apps-event-ledger-by-id-sponsors","tags":["apps"],"summary":"POST /apps/event-ledger/{id}/sponsors","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/bulk-sends":{"get":{"operationId":"get-bulk-sends","tags":["bulk-sends"],"summary":"GET /bulk-sends","responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-bulk-sends","tags":["bulk-sends"],"summary":"Create Bulk Send","description":"Creates and initiates a bulk send operation for multiple recipients. Supports column mappings for document placeholders and prefilled signer fields, as well as scheduled sends.","requestBody":{"required":true,"description":"Bulk send creation payload","content":{"application/json":{"schema":{"type":"object"},"example":{"templateId":"tpl_abc123","titlePrefix":"Onboarding Document","message":"Welcome! Please sign your onboarding documents.","expiresInHours":168,"recipients":[{"email":"john@example.com","name":"John Doe","role":"employee","additionalData":{"company":"Acme Inc","start_date":"2024-02-01","employee_id":"EMP-001"}},{"email":"jane@example.com","name":"Jane Smith","role":"employee","additionalData":{"company":"Acme Inc","start_date":"2024-02-15","employee_id":"EMP-002"}}],"columnMappings":{"placeholders":{"company":"company_name","start_date":"employment_start_date"},"signerFields":{"employee_id":"field_employee_id"}},"scheduledAt":1704600000000}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"bulk_abc123","totalRecipients":2,"status":"scheduled","scheduledAt":1704600000000,"message":"Bulk send scheduled for 2024-01-07T08:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/bulk-sends/{id}":{"get":{"operationId":"get-bulk-sends-by-id","tags":["bulk-sends"],"summary":"Get Bulk Send Status","description":"Retrieves the status and results of a bulk send operation, including all created envelopes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The bulk send ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"bulk_abc123","templateId":"tpl_abc123","templateName":"Employment Contract","status":"completed","totalRecipients":2,"processedCount":2,"successCount":2,"failureCount":0,"errors":[],"columnMappings":{"placeholders":{"company":"company_name"},"signerFields":{"employee_id":"field_employee_id"}},"scheduledAt":null,"createdAt":1704543600000,"completedAt":1704543700000,"envelopes":[{"id":"env_xyz789","title":"Onboarding Document - John Doe","status":"sent","placeholderValues":[{"key":"company_name","value":"Acme Inc"}],"signers":[{"email":"john@example.com","status":"sent","prefilledFields":{"field_employee_id":"EMP-001"}}]}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"delete":{"operationId":"delete-bulk-sends-by-id","tags":["bulk-sends"],"summary":"Cancel Bulk Send","description":"Cancels a bulk send operation and all its associated pending envelopes. Scheduled bulk sends can also be cancelled before they start processing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The bulk send ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"bulk_abc123","cancelled":true,"cancelledEnvelopes":5}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/bulk-sends/{id}/errors":{"get":{"operationId":"get-bulk-sends-by-id-errors","tags":["bulk-sends"],"summary":"Get Error Report","description":"Retrieves a detailed error report for a bulk send. Useful for identifying which recipients failed and why. Supports JSON and CSV formats.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The bulk send ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"bulkSendId":"bulk_abc123","templateId":"tpl_abc123","titlePrefix":"Onboarding Document","status":"completed","summary":{"totalRecipients":10,"successCount":8,"failureCount":2},"createdAt":1704543600000,"completedAt":1704543700000,"errors":[{"row":5,"email":"invalid@example","errorType":"invalid_data","errorMessage":"Invalid email format"},{"row":8,"email":"quota@example.com","errorType":"quota_exceeded","errorMessage":"Monthly envelope limit reached"}]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake":{"get":{"operationId":"get-business-intake","tags":["business-intake"],"summary":"List Business Intakes","description":"Lists Business Intake records with checklist readiness, task counts, approval count, team count, portal count, and vault summary counts.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"record":{"id":"rec_abc123","title":"Acme Catering","status":"pending_review","metadata":{"intakeType":"vendor"},"relatedParty":{"name":"Sam Lee","email":"sam@example.com","company":"Acme Catering"}},"checklistSummary":{"requiredCount":4,"approvedRequired":3,"missingRequired":1,"completionPercent":75},"pendingApprovalCount":1,"vaultItemCount":2}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake","tags":["business-intake"],"summary":"Create Business Intake","description":"Creates a Business Intake record. Set intakeType to client, vendor, partner, supplier, consultant, agency, contractor, or other.","requestBody":{"required":true,"description":"Business intake fields","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Acme Catering","intakeType":"vendor","contactName":"Sam Lee","contactEmail":"sam@example.com","companyName":"Acme Catering","serviceCategory":"Catering","taxClassification":"LLC","paymentTerms":"Net 30","riskLevel":"standard","targetStartDate":"2026-05-15"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"rec_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}":{"get":{"operationId":"get-business-intake-by-itemId","tags":["business-intake"],"summary":"Get Business Intake","description":"Returns the intake record, required document checklist, documents, tasks, approvals, team members, portal links, vault summaries, action register entries, and audit activity.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":"{\n  \"data\": {\n    \"record\": { \"id\": \"rec_abc123\", \"title\": \"Acme Catering\", \"status\": \"pending_review\" },\n    \"checklistSummary\": { \"completionPercent\": 75 },\n    \"checklist\": [...],\n    \"documents\": [...],\n    \"actions\": [...],\n    \"approvals\": [...],\n    \"members\": [...],\n    \"vaultItems\": [\n      { \"fieldKey\": \"bank_account\", \"label\": \"Bank account\", \"redactedPreview\": \"****1234\" }\n    ]\n  }\n}"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-business-intake-by-itemId","tags":["business-intake"],"summary":"PATCH /business-intake/{itemId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/approvals":{"get":{"operationId":"get-business-intake-by-itemId-approvals","tags":["business-intake"],"summary":"GET /business-intake/{itemId}/approvals","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake-by-itemId-approvals","tags":["business-intake"],"summary":"Request Business Intake Approval","description":"Creates an internal approval request for intake review.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Approval request","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Finance approval","mode":"sequential","approvers":[{"approverEmail":"finance@example.com","stepNumber":1}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"appr_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/approvals/{stepId}/decision":{"post":{"operationId":"post-business-intake-by-itemId-approvals-by-stepId-decision","tags":["business-intake"],"summary":"POST /business-intake/{itemId}/approvals/{stepId}/decision","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/documents":{"get":{"operationId":"get-business-intake-by-itemId-documents","tags":["business-intake"],"summary":"GET /business-intake/{itemId}/documents","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake-by-itemId-documents","tags":["business-intake"],"summary":"Attach Business Intake Document","description":"Uploads a base64-encoded document to an intake checklist item.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Document upload payload","content":{"application/json":{"schema":{"type":"object"},"example":{"requirementKey":"tax_form","status":"pending_review","accessLevel":"finance","isSensitive":true,"document":{"filename":"acme-w9.pdf","contentType":"application/pdf","data":"base64..."}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"doc_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/documents/{documentId}/review":{"post":{"operationId":"post-business-intake-by-itemId-documents-by-documentId-review","tags":["business-intake"],"summary":"POST /business-intake/{itemId}/documents/{documentId}/review","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/portal-links":{"get":{"operationId":"get-business-intake-by-itemId-portal-links","tags":["business-intake"],"summary":"GET /business-intake/{itemId}/portal-links","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake-by-itemId-portal-links","tags":["business-intake"],"summary":"Create Business Intake Portal Link","description":"Creates a public intake link for document collection and optional email/SMS notification.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Portal link payload","content":{"application/json":{"schema":{"type":"object"},"example":{"recipientName":"Sam Lee","recipientEmail":"sam@example.com","recipientPhone":"+15551234567","notificationChannels":["email","sms"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"portal_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/portal-links/{portalLinkId}":{"delete":{"operationId":"delete-business-intake-by-itemId-portal-links-by-portalLinkId","tags":["business-intake"],"summary":"DELETE /business-intake/{itemId}/portal-links/{portalLinkId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"portalLinkId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/tasks":{"get":{"operationId":"get-business-intake-by-itemId-tasks","tags":["business-intake"],"summary":"GET /business-intake/{itemId}/tasks","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake-by-itemId-tasks","tags":["business-intake"],"summary":"Create Business Intake Task","description":"Creates an intake follow-up, onboarding, review, or setup task.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Task payload","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Verify payment details","description":"Confirm remittance details with finance","dueDate":1778803200000}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"appr_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/tasks/{taskId}":{"patch":{"operationId":"patch-business-intake-by-itemId-tasks-by-taskId","tags":["business-intake"],"summary":"PATCH /business-intake/{itemId}/tasks/{taskId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/team":{"get":{"operationId":"get-business-intake-by-itemId-team","tags":["business-intake"],"summary":"GET /business-intake/{itemId}/team","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake-by-itemId-team","tags":["business-intake"],"summary":"Assign Business Intake Team Member","description":"Assigns an existing workspace member to the intake record.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Team assignment","content":{"application/json":{"schema":{"type":"object"},"example":{"userId":"user_abc123","role":"contributor"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"member_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/vault":{"get":{"operationId":"get-business-intake-by-itemId-vault","tags":["business-intake"],"summary":"GET /business-intake/{itemId}/vault","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-business-intake-by-itemId-vault","tags":["business-intake"],"summary":"Set Business Intake Vault Field","description":"Creates or updates an encrypted intake vault field. The API returns the vault item ID, not the plaintext value.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Encrypted field payload","content":{"application/json":{"schema":{"type":"object"},"example":{"fieldKey":"bank_account","label":"Bank account","value":"1234567890","accessLevel":"finance"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"vault_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/business-intake/{itemId}/vault/{vaultItemId}/reveal":{"post":{"operationId":"post-business-intake-by-itemId-vault-by-vaultItemId-reveal","tags":["business-intake"],"summary":"POST /business-intake/{itemId}/vault/{vaultItemId}/reveal","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"vaultItemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/envelopes":{"get":{"operationId":"get-envelopes","tags":["envelopes"],"summary":"List Envelopes","description":"Retrieves all envelopes for your organization with optional filtering.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"env_xyz789","title":"Employment Contract - John Doe","status":"sent","templateName":"Employment Contract","signers":[{"id":"sgn_abc123","name":"John Doe","email":"john@example.com","role":"employee","status":"pending"}],"createdAt":1704543600000,"completedAt":null,"expiresAt":1705148400000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-envelopes","tags":["envelopes"],"summary":"Create & Send Envelope","description":"Creates a new envelope from a template or package with one or more signers. Supports sequential or parallel signing.","requestBody":{"required":true,"description":"Envelope creation payload with multiple signers","content":{"application/json":{"schema":{"type":"object"},"example":{"templateId":"tpl_abc123","title":"Employment Contract - John Doe","message":"Please review and sign the attached contract.","expiresInHours":168,"scheduledAt":"2026-01-15T09:00:00Z","signers":[{"name":"John Doe","email":"john@example.com","role":"employee","signingOrder":1,"redirectUrl":"https://yourapp.com/signed"},{"name":"Jane Smith","email":"jane@company.com","role":"employer","signingOrder":2},{"name":"Legal Team","email":"legal@company.com","role":"approver","signingOrder":3}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"env_xyz789","status":"scheduled","scheduledAt":"2026-01-15T09:00:00.000Z","signers":[{"id":"sgn_abc123","email":"john@example.com","signingUrl":"${BASE_URL}/sign/abc123..."},{"id":"sgn_def456","email":"jane@company.com","signingUrl":"${BASE_URL}/sign/def456..."},{"id":"sgn_ghi789","email":"legal@company.com","signingUrl":"${BASE_URL}/sign/ghi789..."}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/envelopes/{id}":{"get":{"operationId":"get-envelopes-by-id","tags":["envelopes"],"summary":"Get Envelope","description":"Retrieves detailed information about a specific envelope.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The envelope ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"env_xyz789","title":"Employment Contract - John Doe","status":"completed","createdAt":1704543600000,"sentAt":1704543610000,"completedAt":1704630000000,"expiresAt":1705148400000}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"delete":{"operationId":"delete-envelopes-by-id","tags":["envelopes"],"summary":"Cancel Envelope","description":"Cancels an envelope. Only envelopes in 'sent' status can be cancelled.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The envelope ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"env_xyz789","status":"cancelled"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/envelopes/{id}/audit-log":{"get":{"operationId":"get-envelopes-by-id-audit-log","tags":["envelopes"],"summary":"Get Audit Log","description":"Retrieves the complete audit trail for an envelope showing all actions.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The envelope ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"log_1","action":"envelope_created","actionDescription":"Envelope created","actorType":"api","actorEmail":"admin@company.com","ipAddress":"192.168.1.1","timestamp":1704543600000},{"id":"log_2","action":"document_viewed","actionDescription":"Document viewed by signer","actorType":"signer","actorEmail":"john@example.com","ipAddress":"203.0.113.50","timestamp":1704550000000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/envelopes/{id}/download":{"get":{"operationId":"get-envelopes-by-id-download","tags":["envelopes"],"summary":"Download Signed Document","description":"Retrieves download URLs for the signed PDF document and certificate. Only available for completed envelopes.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The envelope ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"env_xyz789","title":"Employment Contract - John Doe","status":"completed","completedAt":1704630000000,"documentUrl":"https://storage.convex.cloud/...","certificateUrl":"https://storage.convex.cloud/...","expiresIn":"1 hour"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/envelopes/{id}/remind":{"post":{"operationId":"post-envelopes-by-id-remind","tags":["envelopes"],"summary":"Send Reminder","description":"Sends a reminder email to signers who haven't completed signing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The envelope ID"}],"requestBody":{"required":true,"description":"Optional parameters for the reminder","content":{"application/json":{"schema":{"type":"object"},"example":{"signerId":"sgn_abc123","message":"Friendly reminder to sign the document."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"success":true,"remindedCount":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/envelopes/{id}/signers":{"get":{"operationId":"get-envelopes-by-id-signers","tags":["envelopes"],"summary":"Get Envelope Signers","description":"Retrieves all signers for an envelope with their current status.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The envelope ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"sgn_abc123","email":"john@example.com","name":"John Doe","role":"employee","signingOrder":1,"status":"signed","viewedAt":1704550000000,"signedAt":1704560000000,"declinedAt":null,"declineReason":null,"reminderSentAt":null}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/event-ledger":{"get":{"operationId":"get-event-ledger","tags":["event-ledger"],"summary":"GET /event-ledger","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger","responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-event-ledger","tags":["event-ledger"],"summary":"POST /event-ledger","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/event-ledger/{id}":{"get":{"operationId":"get-event-ledger-by-id","tags":["event-ledger"],"summary":"GET /event-ledger/{id}","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-event-ledger-by-id","tags":["event-ledger"],"summary":"PATCH /event-ledger/{id}","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/event-ledger/{id}/expenses":{"get":{"operationId":"get-event-ledger-by-id-expenses","tags":["event-ledger"],"summary":"GET /event-ledger/{id}/expenses","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}/expenses","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-event-ledger-by-id-expenses","tags":["event-ledger"],"summary":"POST /event-ledger/{id}/expenses","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}/expenses","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/event-ledger/{id}/import-meetumo":{"post":{"operationId":"post-event-ledger-by-id-import-meetumo","tags":["event-ledger"],"summary":"POST /event-ledger/{id}/import-meetumo","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}/import-meetumo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/event-ledger/{id}/sponsors":{"get":{"operationId":"get-event-ledger-by-id-sponsors","tags":["event-ledger"],"summary":"GET /event-ledger/{id}/sponsors","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}/sponsors","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-event-ledger-by-id-sponsors","tags":["event-ledger"],"summary":"POST /event-ledger/{id}/sponsors","description":"Deprecated: use the /apps/event-ledger routes. Responses carry Deprecation, Sunset, and Link headers.","deprecated":true,"x-sunset":"2027-03-31T00:00:00.000Z","x-successor":"/api/v1/apps/event-ledger/{id}/sponsors","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets":{"get":{"operationId":"get-hiring-packets","tags":["hiring-packets"],"summary":"List Hiring Packets","description":"Lists Hiring Packet records with checklist readiness, approval count, open task count, team count, and vault summary counts.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"packet":{"id":"rec_abc123","title":"Avery Johnson","status":"offer_sent"},"checklistSummary":{"requiredCount":3,"approvedRequired":1,"completionPercent":33},"openTaskCount":2,"teamMemberCount":1,"vaultItemCount":0}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets","tags":["hiring-packets"],"summary":"Create Hiring Packet","description":"Creates a Hiring Packet record with candidate, role, worker type, start date, manager, and compensation metadata.","requestBody":{"required":true,"description":"Hiring packet fields","content":{"application/json":{"schema":{"type":"object"},"example":{"candidateName":"Avery Johnson","candidateEmail":"avery@example.com","candidatePhone":"+2348012345678","smsAlerts":true,"roleTitle":"Operations Manager","department":"Operations","workerType":"employee","startDate":"2026-05-15"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"rec_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}":{"get":{"operationId":"get-hiring-packets-by-packetId","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-hiring-packets-by-packetId","tags":["hiring-packets"],"summary":"PATCH /hiring-packets/{packetId}","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/approvals":{"get":{"operationId":"get-hiring-packets-by-packetId-approvals","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}/approvals","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets-by-packetId-approvals","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/approvals","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/approvals/{stepId}/decision":{"post":{"operationId":"post-hiring-packets-by-packetId-approvals-by-stepId-decision","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/approvals/{stepId}/decision","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/documents":{"get":{"operationId":"get-hiring-packets-by-packetId-documents","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}/documents","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets-by-packetId-documents","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/documents","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/documents/{documentId}/review":{"post":{"operationId":"post-hiring-packets-by-packetId-documents-by-documentId-review","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/documents/{documentId}/review","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/portal-links":{"get":{"operationId":"get-hiring-packets-by-packetId-portal-links","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}/portal-links","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets-by-packetId-portal-links","tags":["hiring-packets"],"summary":"Create Hiring Packet Portal Link","description":"Creates a public intake link for the candidate or contractor to submit details and checklist documents.","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Portal link fields","content":{"application/json":{"schema":{"type":"object"},"example":{"recipientName":"Avery Johnson","recipientEmail":"avery@example.com","notificationChannels":["sms"],"label":"Candidate document collection"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"link_abc123","url":"https://www.wegosign.com/intake/token"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/portal-links/{portalLinkId}":{"delete":{"operationId":"delete-hiring-packets-by-packetId-portal-links-by-portalLinkId","tags":["hiring-packets"],"summary":"DELETE /hiring-packets/{packetId}/portal-links/{portalLinkId}","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}},{"name":"portalLinkId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/tasks":{"get":{"operationId":"get-hiring-packets-by-packetId-tasks","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}/tasks","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets-by-packetId-tasks","tags":["hiring-packets"],"summary":"Create Hiring Packet Task","description":"Creates an onboarding task and emits generic app action events plus Hiring Packet task events.","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Task fields","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Provision laptop","dueDate":1770000000000}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"action_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/tasks/{taskId}":{"patch":{"operationId":"patch-hiring-packets-by-packetId-tasks-by-taskId","tags":["hiring-packets"],"summary":"PATCH /hiring-packets/{packetId}/tasks/{taskId}","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/team":{"get":{"operationId":"get-hiring-packets-by-packetId-team","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}/team","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets-by-packetId-team","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/team","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/vault":{"get":{"operationId":"get-hiring-packets-by-packetId-vault","tags":["hiring-packets"],"summary":"GET /hiring-packets/{packetId}/vault","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-hiring-packets-by-packetId-vault","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/vault","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/hiring-packets/{packetId}/vault/{vaultItemId}/reveal":{"post":{"operationId":"post-hiring-packets-by-packetId-vault-by-vaultItemId-reveal","tags":["hiring-packets"],"summary":"POST /hiring-packets/{packetId}/vault/{vaultItemId}/reveal","parameters":[{"name":"packetId","in":"path","required":true,"schema":{"type":"string"}},{"name":"vaultItemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/invoices":{"get":{"operationId":"get-invoices","tags":["invoices"],"summary":"List Invoices","description":"Retrieves all invoices for your organization, optionally filtered by status.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"inv_abc123","invoiceNumber":"INV-0001","clientName":"John Smith","clientEmail":"john@example.com","clientCompany":"Acme Corp","title":"Consulting Services - March 2026","currency":"NGN","totalKobo":5000000,"status":"sent","invoiceDate":1711929600000,"dueDate":1714521600000,"sentAt":1711929600000,"viewCount":3,"createdAt":1711929600000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-invoices","tags":["invoices"],"summary":"Create Invoice","description":"Creates a new draft invoice. The invoice must be sent separately using the Send endpoint.","requestBody":{"required":true,"description":"Invoice details. All amounts are in kobo (smallest currency unit).","content":{"application/json":{"schema":{"type":"object"},"example":{"clientName":"John Smith","clientEmail":"john@example.com","clientCompany":"Acme Corp","title":"Consulting Services - March 2026","currency":"NGN","lineItems":[{"description":"Strategy consulting (10 hours)","quantity":10,"unitPriceKobo":500000,"totalKobo":5000000},{"description":"Document review","quantity":1,"unitPriceKobo":200000,"totalKobo":200000}],"subtotalKobo":5200000,"taxRate":7.5,"taxAmountKobo":390000,"totalKobo":5590000,"invoiceDate":1711929600000,"dueDate":1714521600000,"notes":"Payment due within 30 days."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"inv_abc123","invoiceNumber":"INV-0001","status":"draft","totalKobo":5590000,"viewToken":"a1b2c3d4...","createdAt":1711929600000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/invoices/{id}":{"get":{"operationId":"get-invoices-by-id","tags":["invoices"],"summary":"Get Invoice","description":"Retrieves a specific invoice with full details including payment history.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":"{\n  \"data\": {\n    \"id\": \"inv_abc123\",\n    \"invoiceNumber\": \"INV-0001\",\n    \"clientName\": \"John Smith\",\n    \"clientEmail\": \"john@example.com\",\n    \"title\": \"Consulting Services\",\n    \"currency\": \"NGN\",\n    \"lineItems\": [...],\n    \"subtotalKobo\": 5200000,\n    \"taxRate\": 7.5,\n    \"taxAmountKobo\": 390000,\n    \"totalKobo\": 5590000,\n    \"paidAmountKobo\": 2000000,\n    \"status\": \"partially_paid\",\n    \"payments\": [\n      {\n        \"amountKobo\": 2000000,\n        \"paymentDate\": 1712534400000,\n        \"paymentMethod\": \"bank_transfer\",\n        \"reference\": \"TXN-12345\"\n      }\n    ],\n    \"viewCount\": 5,\n    \"lastViewedAt\": 1712620800000,\n    \"sentAt\": 1711929600000,\n    \"dueDate\": 1714521600000\n  }\n}"}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-invoices-by-id","tags":["invoices"],"summary":"Update Invoice","description":"Updates a draft invoice. Only invoices in draft status can be modified.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice ID"}],"requestBody":{"required":false,"description":"Fields to update (all optional)","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Updated Title","dueDate":1714521600000,"notes":"Updated payment terms."}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"inv_abc123","status":"draft","title":"Updated Title","updatedAt":1712534400000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/invoices/{id}/payments":{"post":{"operationId":"post-invoices-by-id-payments","tags":["invoices"],"summary":"Record Payment","description":"Records a payment against an invoice. Supports partial payments — the invoice status automatically updates to 'partially_paid' or 'paid' based on the total amount received.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice ID"}],"requestBody":{"required":true,"description":"Payment details","content":{"application/json":{"schema":{"type":"object"},"example":{"amountKobo":2000000,"paymentDate":"2026-04-10T00:00:00.000Z","paymentMethod":"bank_transfer","reference":"TXN-12345","note":"First installment"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"success":true,"status":"partially_paid"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/invoices/{id}/send":{"post":{"operationId":"post-invoices-by-id-send","tags":["invoices"],"summary":"Send Invoice","description":"Sends a draft invoice to the client via email. The invoice status changes to 'sent' and a public view link is generated.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"success":true}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/invoices/{id}/void":{"post":{"operationId":"post-invoices-by-id-void","tags":["invoices"],"summary":"Void Invoice","description":"Voids an invoice, making it permanently inactive. Cannot void invoices that are already paid or voided.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The invoice ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"success":true}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/organization/members":{"get":{"operationId":"get-organization-members","tags":["organization"],"summary":"List active organization members","description":"Use returned user IDs for assignment; paginate with limit and cursor.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"items":[],"nextCursor":null}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/packages":{"get":{"operationId":"get-packages","tags":["packages"],"summary":"List Packages","description":"Retrieves all template packages for your organization.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"pkg_abc123","name":"New Hire Package","description":"All onboarding documents","status":"active","templates":[{"templateId":"tpl_contract","order":0,"name":"Employment Contract","pageCount":3,"fieldCount":8,"roles":["employee","employer"]}],"roleMappings":[],"stats":{"documentCount":2,"totalFields":14,"totalPages":7,"roleCount":2},"createdAt":1704543600000,"updatedAt":1704543600000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-packages","tags":["packages"],"summary":"Create Package","description":"Creates a package from one or more templates. Role mappings are auto-generated when omitted.","requestBody":{"required":true,"description":"Package creation payload","content":{"application/json":{"schema":{"type":"object"},"example":{"name":"New Hire Package","description":"All onboarding documents","templateIds":["tpl_contract","tpl_w4"],"roleMappings":[{"packageRoleId":"role_1","packageRoleName":"Employee","color":"#3b82f6","templateRoles":[{"templateId":"tpl_contract","roleId":"employee"},{"templateId":"tpl_w4","roleId":"employee"}]}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"pkg_abc123","name":"New Hire Package","description":"All onboarding documents","status":"active","templates":[{"templateId":"tpl_contract","order":0,"name":"Employment Contract","pageCount":3,"fieldCount":8,"roles":["employee","employer"]}],"roleMappings":[],"stats":{"documentCount":2,"totalFields":14,"totalPages":7,"roleCount":2},"createdAt":1704543600000,"updatedAt":1704543600000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/packages/{id}":{"get":{"operationId":"get-packages-by-id","tags":["packages"],"summary":"Get Package","description":"Retrieves a specific package by ID.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The package ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"pkg_abc123","name":"New Hire Package","description":"All onboarding documents","status":"active","templates":[],"roleMappings":[],"stats":{"documentCount":2,"totalFields":14,"totalPages":7,"roleCount":2},"createdAt":1704543600000,"updatedAt":1704543600000}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"put":{"operationId":"put-packages-by-id","tags":["packages"],"summary":"Update Package","description":"Updates package metadata, template order, or role mappings.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The package ID"}],"requestBody":{"required":false,"description":"Fields to update","content":{"application/json":{"schema":{"type":"object"},"example":{"name":"Updated New Hire Package","templateIds":["tpl_contract","tpl_w4","tpl_handbook"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"pkg_abc123","name":"Updated New Hire Package","status":"active","templates":[],"roleMappings":[],"stats":{"documentCount":3,"totalFields":20,"totalPages":12,"roleCount":2},"createdAt":1704543600000,"updatedAt":1704550000000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"delete":{"operationId":"delete-packages-by-id","tags":["packages"],"summary":"Archive Package","description":"Archives a package so it no longer appears in default package lists.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The package ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"pkg_abc123","archived":true}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/record-documents":{"get":{"operationId":"get-record-documents","tags":["record-documents"],"summary":"GET /record-documents","responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-record-documents","tags":["record-documents"],"summary":"POST /record-documents","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance":{"get":{"operationId":"get-renewals-compliance","tags":["renewals-compliance"],"summary":"List Compliance Items","description":"Lists Renewals & Compliance records with checklist readiness, approval count, open task count, team count, and vault summary counts.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"item":{"id":"rec_abc123","title":"General Liability COI","status":"expiring_soon"},"checklistSummary":{"requiredCount":3,"approvedRequired":2,"completionPercent":67},"openTaskCount":1,"teamMemberCount":1,"vaultItemCount":0}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance","tags":["renewals-compliance"],"summary":"Create Compliance Item","description":"Creates a configurable renewal or compliance item. The tracking type determines the default document and evidence checklist.","requestBody":{"required":true,"description":"Compliance item fields","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"General Liability COI","trackingType":"insurance_coi","relatedPartyName":"Northstar Logistics","issuingAuthority":"Carrier Mutual","expirationDate":"2026-08-01","renewalDueDate":"2026-07-15","policyNumber":"COI-2026-1001"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"rec_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}":{"get":{"operationId":"get-renewals-compliance-by-itemId","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-renewals-compliance-by-itemId","tags":["renewals-compliance"],"summary":"PATCH /renewals-compliance/{itemId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/approvals":{"get":{"operationId":"get-renewals-compliance-by-itemId-approvals","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}/approvals","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance-by-itemId-approvals","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/approvals","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/approvals/{stepId}/decision":{"post":{"operationId":"post-renewals-compliance-by-itemId-approvals-by-stepId-decision","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/approvals/{stepId}/decision","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/documents":{"get":{"operationId":"get-renewals-compliance-by-itemId-documents","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}/documents","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance-by-itemId-documents","tags":["renewals-compliance"],"summary":"Attach Compliance Evidence","description":"Attaches a base64-encoded required document or supporting evidence file to a compliance item.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Document upload fields","content":{"application/json":{"schema":{"type":"object"},"example":{"requirementKey":"certificate_of_insurance","label":"Current COI","document":{"filename":"coi.pdf","contentType":"application/pdf","data":"base64..."}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"doc_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/documents/{documentId}/review":{"post":{"operationId":"post-renewals-compliance-by-itemId-documents-by-documentId-review","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/documents/{documentId}/review","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/portal-links":{"get":{"operationId":"get-renewals-compliance-by-itemId-portal-links","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}/portal-links","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance-by-itemId-portal-links","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/portal-links","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/portal-links/{portalLinkId}":{"delete":{"operationId":"delete-renewals-compliance-by-itemId-portal-links-by-portalLinkId","tags":["renewals-compliance"],"summary":"DELETE /renewals-compliance/{itemId}/portal-links/{portalLinkId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"portalLinkId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/tasks":{"get":{"operationId":"get-renewals-compliance-by-itemId-tasks","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}/tasks","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance-by-itemId-tasks","tags":["renewals-compliance"],"summary":"Create Compliance Task","description":"Creates a renewal reminder, follow-up, filing, inspection, or review task.","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"description":"Task fields","content":{"application/json":{"schema":{"type":"object"},"example":{"title":"Request renewed COI","dueDate":1784073600000}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"action_abc123"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/tasks/{taskId}":{"patch":{"operationId":"patch-renewals-compliance-by-itemId-tasks-by-taskId","tags":["renewals-compliance"],"summary":"PATCH /renewals-compliance/{itemId}/tasks/{taskId}","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/team":{"get":{"operationId":"get-renewals-compliance-by-itemId-team","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}/team","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance-by-itemId-team","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/team","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/vault":{"get":{"operationId":"get-renewals-compliance-by-itemId-vault","tags":["renewals-compliance"],"summary":"GET /renewals-compliance/{itemId}/vault","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-renewals-compliance-by-itemId-vault","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/vault","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/renewals-compliance/{itemId}/vault/{vaultItemId}/reveal":{"post":{"operationId":"post-renewals-compliance-by-itemId-vault-by-vaultItemId-reveal","tags":["renewals-compliance"],"summary":"POST /renewals-compliance/{itemId}/vault/{vaultItemId}/reveal","parameters":[{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"vaultItemId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/sso":{"get":{"operationId":"get-sso","tags":["sso"],"summary":"GET /sso","responses":{"200":{"description":"Success"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-sso","tags":["sso"],"summary":"POST /sso","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Success"},"201":{"description":"Created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/templates":{"get":{"operationId":"get-templates","tags":["templates"],"summary":"List Templates","description":"Retrieves all templates for your organization.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"tpl_abc123","name":"Employment Contract","description":"Standard employment agreement","pageCount":3,"fieldCount":5,"roles":["employee","employer"],"isArchived":false,"createdAt":1704543600000,"updatedAt":1704543600000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-templates","tags":["templates"],"summary":"Create Template","description":"Creates a new template by uploading a PDF document. Optionally include fields with conditional logic.","requestBody":{"required":true,"description":"Template creation payload with base64-encoded PDF and optional fields","content":{"application/json":{"schema":{"type":"object"},"example":{"name":"Employment Contract","description":"Standard employment agreement","document":{"data":"base64_encoded_pdf_content","filename":"contract.pdf"},"fields":[{"id":"field_1","type":"signature","role":"employee","page":1,"x":100,"y":500,"width":200,"height":50,"required":true,"label":"Employee Signature"},{"id":"field_2","type":"dropdown","role":"employee","page":1,"x":100,"y":300,"width":150,"height":30,"required":true,"label":"Department","options":[{"label":"Engineering","value":"eng"},{"label":"Sales","value":"sales"}]}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"tpl_abc123","name":"Employment Contract","description":"Standard employment agreement","documentName":"contract.pdf","fieldCount":2,"roles":["employee"],"createdAt":1704543600000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/templates/{id}":{"get":{"operationId":"get-templates-by-id","tags":["templates"],"summary":"Get Template","description":"Retrieves a template with fields, roles, placeholder keys, archive status, and document URL.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Template ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"tpl_abc123","name":"Employment Contract","description":"Standard employment agreement","pageCount":3,"fields":[],"roles":["employee"],"placeholderKeys":[],"isArchived":false,"documentUrl":"https://...","createdAt":1704543600000,"updatedAt":1704543600000}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"put":{"operationId":"put-templates-by-id","tags":["templates"],"summary":"Update Template","description":"Updates template metadata.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Template ID"}],"requestBody":{"required":false,"description":"Template metadata fields","content":{"application/json":{"schema":{"type":"object"},"example":{"name":"Employment Contract v2","description":"Updated employment agreement"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"tpl_abc123","name":"Employment Contract v2","description":"Updated employment agreement","updatedAt":1704543600000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"delete":{"operationId":"delete-templates-by-id","tags":["templates"],"summary":"Archive Template","description":"Archives a template so it no longer appears in default template lists.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Template ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"tpl_abc123","archived":true}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/templates/{id}/fields":{"get":{"operationId":"get-templates-by-id-fields","tags":["templates"],"summary":"Get Template Fields","description":"Retrieves all fields for a template including their conditions.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"templateId":"tpl_abc123","fields":[{"id":"field_1","type":"dropdown","role":"signer","page":1,"x":100,"y":200,"width":150,"height":30,"required":true,"label":"Select Option","options":[{"label":"Option A","value":"a"},{"label":"Option B","value":"b"}]}],"roles":["signer"],"placeholderKeys":[]}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"patch":{"operationId":"patch-templates-by-id-fields","tags":["templates"],"summary":"Update Template Fields","description":"Updates all fields for a template. Supports all field types and conditional logic.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"description":"Array of fields with positions, types, and optional conditions","content":{"application/json":{"schema":{"type":"object"},"example":{"fields":[{"id":"field_1","type":"dropdown","role":"signer","page":1,"x":100,"y":200,"width":150,"height":30,"required":true,"label":"Select Option","options":[{"label":"Option A","value":"a"},{"label":"Option B","value":"b"}]},{"id":"field_2","type":"text","role":"signer","page":1,"x":100,"y":250,"width":200,"height":30,"required":false,"label":"Additional Details","conditions":[{"sourceFieldId":"field_1","operator":"equals","value":"b"}],"conditionAction":"show","conditionLogic":"all"}]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"tpl_abc123","fieldCount":2,"roles":["signer"],"updatedAt":1704543600000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/webhooks":{"get":{"operationId":"get-webhooks","tags":["webhooks"],"summary":"List Webhooks","description":"Retrieves all webhooks configured for your organization.","responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":[{"id":"whk_abc123","url":"https://yourapp.com/webhooks/wegosign","events":["envelope.completed","signer.signed"],"description":"Main production webhook","isActive":true,"failureCount":0,"lastDeliveredAt":1704550000000,"createdAt":1704543600000}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"post":{"operationId":"post-webhooks","tags":["webhooks"],"summary":"Create Webhook","description":"Creates a new webhook endpoint to receive event notifications.","requestBody":{"required":true,"description":"Webhook configuration","content":{"application/json":{"schema":{"type":"object"},"example":{"url":"https://yourapp.com/webhooks/wegosign","events":["envelope.created","envelope.sent","envelope.completed","signer.viewed","signer.signed","signer.declined","document.downloaded"],"description":"Main production webhook"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"whk_abc123","url":"https://yourapp.com/webhooks/wegosign","events":["envelope.created","envelope.completed","signer.signed"],"description":"Main production webhook","secret":"whsec_abc123xyz789...","isActive":true,"createdAt":1704543600000}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}},"/webhooks/{id}":{"get":{"operationId":"get-webhooks-by-id","tags":["webhooks"],"summary":"Get Webhook","description":"Retrieves a specific webhook by its ID.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The webhook ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"whk_abc123","url":"https://yourapp.com/webhooks/wegosign","events":["envelope.completed","signer.signed"],"description":"Main production webhook","isActive":true,"failureCount":0,"lastDeliveredAt":1704550000000,"createdAt":1704543600000}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]},"delete":{"operationId":"delete-webhooks-by-id","tags":["webhooks"],"summary":"Delete Webhook","description":"Permanently deletes a webhook endpoint.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The webhook ID"}],"responses":{"200":{"description":"Success","content":{"application/json":{"example":{"data":{"id":"whk_abc123","deleted":true}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Maintenance"}},"security":[{"apiKey":[]}]}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"WeGoSign API key (wgs_live_… or wgs_test_…). X-API-Key is accepted as a fallback header."}},"responses":{"BadRequest":{"description":"Validation failed","content":{"application/json":{"example":{"error":"Bad request","message":"…"}}}},"Unauthorized":{"description":"Missing, invalid, or revoked API key","content":{"application/json":{"example":{"error":"Unauthorized"}}}},"NotFound":{"description":"Resource not found in this organization","content":{"application/json":{"example":{"error":"Not found"}}}},"RateLimited":{"description":"Rate limit exceeded; see Retry-After and X-RateLimit-* headers"},"Maintenance":{"description":"Platform maintenance in progress; retry after the Retry-After header","content":{"application/json":{"example":{"error":"Service unavailable","code":"maintenance"}}}}}}}