Create share
Create a standing share grant for one document — the no-backend embed credential.
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.
Authentication#
Any one of these credentials is accepted.
The deployment's static root credential (CLOUDPDF_API_AUTH_TOKENS), valid on every surface.
Delegated tenant JWT, valid only under its own /v1/tenants/{tenantId}/ subtree — the path tenant must equal the token's tenant_id. Doc-scoped viewer tokens are rejected on every admin route.
Parameters#
tenantIdpathstringrequiredRequest body#
application/jsonSharesCreateRequestrequireddocIdstringrequiredlayerNamestringscopestring[]requiredoriginsstring[]passwordstringsessionTtlSecondsintegerexpiresAtintegerA complete body with every required field. Strings stand in for your own values.
{
"docId": "docId",
"scope": [
"scope"
]
}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.create({
tenantId: "tenantId",
docId: "docId",
scope: ["scope"]
});Responses#
application/jsonSharesCreate200ResponseshareobjectidstringtenantIdstringdocIdstringlayerNamestringscopestring[]originsstring[]passwordProtectedbooleansessionTtlSecondsnumberdisabledbooleanexpiresAtnumberexchangeCountnumberlastExchangedAtnumbercreatedBystringcreatedAtnumberupdatedAtnumberapplication/jsonSharesCreate400Responseerrorobjectcodestringmessagestringapplication/jsonSharesCreate403Responseerrorobjectcodestringmessagestringapplication/jsonSharesCreate404Responseerrorobjectcodestringmessagestringapplication/jsonAdminErrorPayloaderrorobjectcodestringmessagestring