Archive grant
End a grant for good and keep what its visitors made: exchange stops immediately, live sessions lapse at their exp, and its visitors' layers stay listed.
Archiving is final: an archived grant never exchanges again, and to give access again you create a new grant. Pausing (`disabled`) is the reversible stop. An archived grant no longer counts as using its shared layer, so that layer can be deleted.
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 for its own tenant: under /v1/tenants/{tenantId}/ the path tenant must equal the token's tenant_id, and on /v1/docs/{docId} the document must belong to that tenant and the token's scope must hold the operation's document permissions, as a document token does. For servers; browsers get document tokens. Doc-scoped viewer tokens are rejected on every admin route.
Parameters#
tenantIdpathstringrequiredgrantIdpathstringrequiredSDK 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({
token: "<token>",
});
await client.grants.archive({
tenantId: "tenantId",
grantId: "grantId"
});Responses#
application/jsonGrantsArchiveResponsegrantobjectidstringtenantIdstringdocIdstringnamestringlayerMode"shared" | "per-visitor"layerNamestringkeepVisitorLayersbooleanvisitorIdleSecondsintegervisitorIdentityobjectfieldsobjectdisplayName"required" | "optional"optionalemail"required" | "optional"optionaltitle"required" | "optional"optionalorganization"required" | "optional"optionalorganizationalUnit"required" | "optional"optionalask"on-open" | "before-first-change"purposestringoptionalprivacyUrlstring<uri>optionalidentityIdentityscopestring[]originsstring[]passphraseProtectedbooleansessionTtlSecondsintegerdisabledbooleanarchivedAtstring<date-time>expiresAtstring<date-time>exchangeCountintegerlastExchangedAtstring<date-time>createdBystringcreatedAtstring<date-time>updatedAtstring<date-time>application/jsonErrorResponseerrorEngineErrorcode"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError"Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`.
messagestringdetailsobjectoptionalWhat a code carries besides its message, as each code says.
application/jsonErrorResponseerrorEngineErrorcode"Unknown" | "InvalidArg" | "DocNotOpen" | "DocOpenFailed" | "DocPasswordRequired" | "DocPasswordIncorrect" | "GrantPassphraseRequired" | "Aborted" | "Network" | "Unauthenticated" | "Forbidden" | "NotFound" | "WireFormat" | "RuntimeUnavailable" | "LayerVersionConflict" | "NotImplemented" | "MalformedPdf" | "SigningPending" | "SigningExpired" | "SigningVersionMismatch" | "SignatureRefused" | "ProtectedDocument" | "PayloadTooLarge" | "ObjectNumberUnavailable" | "LayerFull" | "ChangeConflict" | "UndoUnavailable" | "IdempotencyKeyReused" | "LayerDeleted" | "VisitorIdentityRequired" | "Conflict" | "EngineBusy" | "EngineRestarting" | "DocumentQuarantined" | "ThumbnailNotReady" | "TooManyRequests" | "GrantExpired" | "OriginRequired" | "OriginNotAllowed" | "FeatureNotEnabled" | "FeatureStopped" | "LicenseInvalid" | "LicenseUsageLimit" | "UpstreamError"Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`.
messagestringdetailsobjectoptionalWhat a code carries besides its message, as each code says.