Skip to content

Latest commit

Β 

History

History
4052 lines (2769 loc) Β· 50.8 KB

File metadata and controls

4052 lines (2769 loc) Β· 50.8 KB

Reference

Deployment

client.deployment.license_status() -> DeploymentLicenseStatusResponse

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.deployment.license_status()

βš™οΈ Parameters

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Doc

client.doc.head(...) -> DocHead200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.head(
    doc_id="docId",
)

βš™οΈ Parameters

doc_id: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.download(...) -> typing.Iterator[bytes]

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.download(
    doc_id="docId",
    layer_name="layerName",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.manifest(...) -> DocManifest200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.manifest(
    doc_id="docId",
    layer_name="layerName",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.render(...) -> typing.Iterator[bytes]

πŸ“ Description

Render parameters (viewport, format) pass as flat dotted query keys, e.g. ?viewport.kind=width&viewport.width=800; the full grammar is documented with the viewer.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.render(
    doc_id="docId",
    layer_name="layerName",
    pon=1,
)

βš™οΈ Parameters

doc_id: str

layer_name: str

pon: int

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.text(...) -> DocText200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.text(
    doc_id="docId",
    layer_name="layerName",
    pon=1,
)

βš™οΈ Parameters

doc_id: str

layer_name: str

pon: int

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Shares

client.shares.exchange(...) -> SharesExchange200Response

πŸ“ Description

Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until password is supplied. Mounted only when the deployment can sign (HS256 mode).

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.shares.exchange(
    share_token="shareToken",
)

βš™οΈ Parameters

share_token: str

password: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.shares.list(...) -> SharesList200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.shares.list(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

limit: typing.Optional[int]

cursor: typing.Optional[str]

doc_id: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.shares.create(...) -> SharesCreate200Response

πŸ“ Description

The returned share id IS the public share token. Mounted only when the deployment can sign (HS256 mode) β€” exchange mints session JWTs, so grants exist only where minting does.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.shares.create(
    tenant_id="tenantId",
    doc_id="docId",
    scope=[
        "scope"
    ],
)

βš™οΈ Parameters

tenant_id: str

doc_id: str

scope: typing.List[str]

layer_name: typing.Optional[str]

origins: typing.Optional[typing.List[str]]

password: typing.Optional[str]

session_ttl_seconds: typing.Optional[int]

expires_at: typing.Optional[int]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.shares.get(...) -> SharesGet200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.shares.get(
    tenant_id="tenantId",
    share_id="shareId",
)

βš™οΈ Parameters

tenant_id: str

share_id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.shares.delete(...)

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.shares.delete(
    tenant_id="tenantId",
    share_id="shareId",
)

βš™οΈ Parameters

tenant_id: str

share_id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.shares.update(...) -> SharesUpdate200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.shares.update(
    tenant_id="tenantId",
    share_id="shareId",
)

βš™οΈ Parameters

tenant_id: str

share_id: str

scope: typing.Optional[typing.List[str]]

origins: typing.Optional[typing.List[str]]

password: typing.Optional[str]

session_ttl_seconds: typing.Optional[int]

disabled: typing.Optional[bool]

expires_at: typing.Optional[int]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Tenants

client.tenants.list(...) -> TenantsList200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.list()

βš™οΈ Parameters

limit: typing.Optional[int]

cursor: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tenants.create(...) -> TenantsCreate200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.create(
    id="id",
)

βš™οΈ Parameters

id: str

name: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tenants.get(...) -> TenantsGet200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.get(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tenants.delete(...)

πŸ“ Description

Destroys the tenant and everything in its namespace β€” documents, layers, stored bytes, audit history. Irreversible.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.delete(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tenants.resume(...)

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.resume(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tenants.suspend(...)

πŸ“ Description

Instantly reversible with resume. The API token is exempt, so a suspended tenant can still be inspected, exported, resumed, or deleted.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.suspend(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

reason: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tenants.usage(...) -> TenantsUsage200Response

πŸ“ Description

Facts only β€” no limits or billing state. Views count share exchanges plus authorized /v1/access grants, deduplicated across the two.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tenants.usage(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

period: typing.Optional[str]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Documents

client.documents.list(...) -> DocumentsList200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.list(
    tenant_id="tenantId",
)

βš™οΈ Parameters

tenant_id: str

limit: typing.Optional[int]

cursor: typing.Optional[str]

state: typing.Optional[ListDocumentsRequestState]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.get(...) -> DocumentsGet200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.get(
    tenant_id="tenantId",
    id="id",
)

βš™οΈ Parameters

tenant_id: str

id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.delete(...)

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.delete(
    tenant_id="tenantId",
    id="id",
)

βš™οΈ Parameters

tenant_id: str

id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.commit(...) -> DocumentsCommit200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.commit(
    tenant_id="tenantId",
    id="id",
    sha256="sha256",
)

βš™οΈ Parameters

tenant_id: str

id: str

sha256: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.download(...) -> typing.Iterator[bytes]

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.download(
    tenant_id="tenantId",
    id="id",
)

βš™οΈ Parameters

tenant_id: str

id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.thumbnail(...) -> typing.Iterator[bytes]

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.thumbnail(
    tenant_id="tenantId",
    id="id",
)

βš™οΈ Parameters

tenant_id: str

id: str

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.upload_proxy(...) -> DocumentsUploadProxy200Response

πŸ“ Description

This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.upload_proxy(
    tenant_id="tenantId",
    id="id",
    file="example_file",
)

βš™οΈ Parameters

tenant_id: str

id: str

file: core.File

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.import_from(...) -> DocumentsImportFrom200Response

πŸ“ Description

Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes β€” the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); revision is provider-interpreted (S3 VersionId, GCS generation, Azure version id).

πŸ”Œ Usage

from cloudpdf import CloudPDFClient
from cloudpdf.documents import DocumentsImportFromRequestSource_Url

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.import_from(
    tenant_id="tenantId",
    source=DocumentsImportFromRequestSource_Url(
        url="url",
    ),
)

βš™οΈ Parameters

tenant_id: str

source: DocumentsImportFromRequestSource β€” Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file.

expected: typing.Optional[DocumentsImportFromRequestExpected] β€” Integrity pins, enforced when present. When absent, the server-observed values become authoritative.

metadata: typing.Optional[typing.Dict[str, typing.Any]]

idempotency_key: typing.Optional[str] β€” Retrying with the same key resumes the same document rather than importing a second copy β€” including after a 502.

dedup_mode: typing.Optional[DocumentsImportFromRequestDedupMode] β€” always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.

doc_id: typing.Optional[str]

mode: typing.Optional[DocumentsImportFromRequestMode] β€” sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.documents.init(...) -> DocumentsInit200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.documents.init(
    tenant_id="tenantId",
    content_length=1.1,
    content_sha256="contentSha256",
)

βš™οΈ Parameters

tenant_id: str

content_length: float

content_sha256: str

metadata: typing.Optional[typing.Dict[str, typing.Any]]

idempotency_key: typing.Optional[str]

dedup_mode: typing.Optional[DocumentsInitRequestDedupMode] β€” always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice.

doc_id: typing.Optional[str]

upload_ttl_sec: typing.Optional[float]

upload_preference: typing.Optional[DocumentsInitRequestUploadPreference]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Tokens

client.tokens.issue(...) -> TokensIssue200Response

πŸ“ Description

kind "tenant" requires the API token β€” authority mints only downward. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient, TokensIssueRequest_Doc

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tokens.issue(
    tenant_id="tenantId",
    request=TokensIssueRequest_Doc(
        sub="sub",
        doc_id="docId",
        scope=[
            "scope"
        ],
        expires_in=1,
    ),
)

βš™οΈ Parameters

tenant_id: str

request: TokensIssueRequest

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.tokens.revoke(...)

πŸ“ Description

Mounted only when the deployment enables token revocation.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.tokens.revoke(
    tenant_id="tenantId",
    jti="jti",
)

βš™οΈ Parameters

tenant_id: str

jti: str

reason: typing.Optional[str]

expires_at_seconds: typing.Optional[int]

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Doc Annotations

client.doc.annotations.list(...) -> DocAnnotationsList200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.annotations.list(
    doc_id="docId",
    layer_name="layerName",
    pon=1,
)

βš™οΈ Parameters

doc_id: str

layer_name: str

pon: int

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.annotations.create(...) -> DocAnnotationsCreate200Response

πŸ“ Description

Doc JWTs may instead carry collab scopes (annotations:create:self, …) that refine per-annotation authorship rules; the API token is exempt from both.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.annotations.create(
    doc_id="docId",
    layer_name="layerName",
    pon=1,
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

pon: int

request: DocAnnotationsCreateRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.annotations.delete(...) -> DocAnnotationsDelete200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.annotations.delete(
    doc_id="docId",
    layer_name="layerName",
    pon=1,
    annot_key="annotKey",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

pon: int

annot_key: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.annotations.update(...) -> DocAnnotationsUpdate200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.annotations.update(
    doc_id="docId",
    layer_name="layerName",
    pon=1,
    annot_key="annotKey",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

pon: int

annot_key: str

request: DocAnnotationsUpdateRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Doc Forms

client.doc.forms.get(...) -> DocFormsGet200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.forms.get(
    doc_id="docId",
    layer_name="layerName",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.forms.export_data(...) -> typing.Iterator[bytes]

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.forms.export_data(
    doc_id="docId",
    layer_name="layerName",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

format: typing.Optional[ExportDataFormsRequestFormat]

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.forms.import_data(...) -> DocFormsImportData200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.forms.import_data(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocFormsImportDataRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.forms.reset(...) -> DocFormsReset200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.forms.reset(
    doc_id="docId",
    layer_name="layerName",
    field_key="fieldKey",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

field_key: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.forms.set_value(...) -> DocFormsSetValue200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.forms.set_value(
    doc_id="docId",
    layer_name="layerName",
    field_key="fieldKey",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

field_key: str

request: DocFormsSetValueRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Doc Metadata

client.doc.metadata.get(...) -> DocMetadataGet200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.metadata.get(
    doc_id="docId",
    layer_name="layerName",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Doc Pages

client.doc.pages.delete(...) -> DocPagesDelete200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.delete(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocPagesDeleteRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.pages.extract(...) -> typing.Iterator[bytes]

πŸ“ Description

A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.extract(
    doc_id="docId",
    layer_name="layerName",
    request={
        "string": {"key": "value"}
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocPagesExtractRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.pages.flatten(...) -> DocPagesFlatten200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.flatten(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocPagesFlattenRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.pages.insert(...) -> DocPagesInsert200Response

πŸ“ Description

Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted β†’ append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.insert(
    doc_id="docId",
    layer_name="layerName",
    file="example_file",
)

βš™οΈ Parameters

doc_id: str

layer_name: str

file: core.File

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.pages.insert_blank(...) -> DocPagesInsertBlank200Response

πŸ“ Description

Body is {"size": {"width", "height"}, "count"?, "destIndex"?} β€” size in PDF points, count in [1, 100], destIndex omitted β†’ append.

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.insert_blank(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocPagesInsertBlankRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.pages.move(...) -> DocPagesMove200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.move(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocPagesMoveRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

client.doc.pages.rotate(...) -> DocPagesRotate200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.pages.rotate(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocPagesRotateRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.

Doc Redactions

client.doc.redactions.apply(...) -> DocRedactionsApply200Response

πŸ”Œ Usage

from cloudpdf import CloudPDFClient

client = CloudPDFClient(
    token="<token>",
    base_url="https://yourhost.com/path/to/api",
)

client.doc.redactions.apply(
    doc_id="docId",
    layer_name="layerName",
    request={
        "key": "value"
    },
)

βš™οΈ Parameters

doc_id: str

layer_name: str

request: DocRedactionsApplyRequest

document_password: typing.Optional[str] β€” Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

request_options: typing.Optional[RequestOptions] β€” Request-specific configuration.