Signatures
Workers

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

  1. All signers have completed their signatures (via POST /leases/signatures/{document_signature_id}/complete/{signer_type})
  2. The signature-orchestrator calls this endpoint to finalize the document
  3. The system verifies that all signature_requests are in COMPLETED status
  4. If all are complete:
    • The document is marked as COMPLETED
    • The lease changes to ACTIVE status
    • A finalization event is published
  5. 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
post/leases/signatures/{document_signature_id}/finalize

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

document_signature_idstring uuid required

Signature document ID to finalize

Request body

signed_pdf_urlstring uri required

URL of the final signed PDF (containing all signatures)

archive_urlstring uri nullable

URL of the archived PDF with timestamping (optional)

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

successboolean required

Indicates whether the finalization succeeded

messagestring required

Confirmation message

document_signature_idstring uuid required

Finalized signature document ID

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.