Skip to content

client_document

Render a client document to PDF

POST/v1/client-documents/{documentId}/render-pdf

Renders one version of a client document to a PDF with the workspace's brand colors and returns a short-lived download link. Renders the current version unless a version is named. A version that already has a finished PDF reuses it unless force is true. Images the document embeds are included; an image that is not stored for this client shows as unavailable. A document with a data label that shows the workspace's own pricing to the client, such as margin, markup or unit cost, is refused with the blocks to rename or remove. A figure shown as collected must cite the read receipt a query returned to this workspace's agent, with the same operation, capture time and arguments; a figure whose receipt is unknown, expired or does not match is refused with the blocks to re-read or mark not collected. Answers unavailable when this deployment cannot render PDFs. An archived document can still be rendered.

Parameters

NameInRequiredTypeDescription
documentIdpathYesstring—
Idempotency-KeyheaderYesstringOpaque idempotency key, at most 255 characters, scoped to (tenant, principal, operation). A missing key is validation_failed.

Request body

  • version: integer
  • force: boolean

Responses and errors

  • 200

    Render a client document to PDF

    • documentId (required): string
    • version (required): integer
    • renderStatus (required): string
    • url (required): string
    • expiresInSeconds (required): integer
    • reused (required): boolean
  • 202

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • ApprovalRequiredError:
    • allOf: ErrorEnvelope
  • 400

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • ValidationFailedError:
    • allOf: ErrorEnvelope
  • 401

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • UnauthorizedError:
    • allOf: ErrorEnvelope
  • 403

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • ForbiddenError:
    • allOf: ErrorEnvelope
  • 404

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • NotFoundError:
    • allOf: ErrorEnvelope
  • 409

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • ConflictError:
    • allOf: ErrorEnvelope
  • 429

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • RateLimitedError:
    • allOf: ErrorEnvelope
  • 503

    Error envelope. `error.code` carries the typed outcome and `error.type` resolves to its description.

    • UnavailableError:
    • allOf: ErrorEnvelope

Example

curl --request POST \
  --url 'https://api.scopable.io/v1/client-documents/{documentId}/render-pdf' \
  --header 'Authorization: Bearer $SCOPABLE_API_KEY' \
  --data '<JSON request body>'

Replace $SCOPABLE_API_KEY with a key created in Settings, API; replace the request body placeholder with JSON matching the schema above.

View the OpenAPI 3.1 source

Need help with the API? …