CloudPDF
DocsPricing
Start building

Exchange share token

POST/v1/share-sessionsv3.0.0-next.9

Trade a public share token for a short-lived document session JWT.

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).

Request body#

application/jsonSharesExchangeRequestrequired
shareTokenstringrequired
passwordstring

A complete body with every required field. Strings stand in for your own values.

{
  "shareToken": "shareToken"
}

SDK examples#

The selected SDK is remembered across the API reference. Values are examples; replace them with identifiers and input from your application.

import { CloudPDFClient } from "@cloudpdf/sdk";

const client = new CloudPDFClient({
  baseUrl: "https://yourhost.com/path/to/api",
  token: "<token>",
});

await client.shares.exchange({
  shareToken: "shareToken"
});

Responses#

200OK
application/jsonSharesExchange200Response
tokenstring
docIdstring
layerNamestring
expiresAtnumber
400Bad request
application/jsonSharesExchange400Response
errorobject
codestring
messagestring
403Forbidden
application/jsonSharesExchange403Response
errorobject
codestring
messagestring
404Not found
application/jsonSharesExchange404Response
errorobject
codestring
messagestring
410Gone
application/jsonSharesExchange410Response
errorobject
codestring
messagestring
422Unprocessable
application/jsonSharesExchange422Response
errorobject
codestring
messagestring
defaultError
application/jsonAdminErrorPayload
errorobject
codestring
messagestring