Finalize a signature document (Worker)
Finalizes a signature document and activates the lease if all signatures are complete.
Usage
This endpoint is called by the signature-orchestrator (Cloudflare worker) when all signers have completed their signatures. It verifies that all signature_requests are complete and activates the lease if so.
Finalization flow
- All signers have completed their signatures (via POST /leases/signatures/{document_signature_id}/complete/{signer_type})
- The signature-orchestrator calls this endpoint to finalize the document
- The system verifies that all signature_requests are in COMPLETED status
- If all are complete:
- The document is marked as COMPLETED
- The lease changes to ACTIVE status
- A finalization event is published
- If some signatures are not complete, the document is marked as COMPLETED but the lease remains in PENDING_SIGNATURE
Authentication
This endpoint uses an API key (X-API-Key) instead of a Bearer API key. Only authorized workers can call this endpoint.
Important note
The signature_requests must be updated individually via POST /leases/signatures/{document_signature_id}/complete/{signer_type} before calling this endpoint. This endpoint does not update the signature_requests, it only verifies them.
Prerequisites
- The signature document must exist
- All signature_requests must be in COMPLETED status (updated individually)
- The tenant_id must be provided in the X-Tenant-ID header
- The final signed PDF URL must be provided
Request
- Base URL: https://api.faireplace.com/api
- URL: https://api.faireplace.com/api/leases/signatures/{document_signature_id}/finalize
- Auth: API key in header X-API-Key
Path parameters
Signature document ID to finalize
Request body
Example request
{
"signed_pdf_url": "https://api.faireplace.com/api/media/serve/550e8400-e29b-41d4-a716-446655440003",
"archive_url": "https://api.faireplace.com/api/media/serve/550e8400-e29b-41d4-a716-446655440004"
}Response
Signature document finalized successfully
Example response
{
"success": true,
"message": "Document signature finalized successfully",
"document_signature_id": "550e8400-e29b-41d4-a716-446655440000"
}Changes
No recorded changes to this operation across all 1 revision of this API.