Unreleased documentation. These pages follow the main branch and can change before the next release. For supported guidance, use v0.44.0.
Grant one named recipient one exact document version until a fixed expiry.
const url = 'https://example.com/v1/documents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/grants';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"expiryHours":1,"grantee":{"kind":"service","subject":"example"},"versionId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/documents/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/grants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "expiryHours": 1, "grantee": { "kind": "service", "subject": "example" }, "versionId": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”The caller’s key for this request. A retry with the same key and body answers the first outcome; another body under the key is refused.
Request Bodyrequired
Section titled “Request Bodyrequired”The body of POST /v1/documents/{documentId}/grants: name one recipient
for one exact version.
object
Hours until the grant expires; the policy default when absent, and at most the policy maximum. The expiry is fixed at issue.
The one named person the grant releases it to.
object
An actor kind: a service, or a human person.
An identifier another system issues, written exactly as its issuer gives it.
The exact document version the grant releases.
Responses
Section titled “Responses”The operation succeeded.
One document grant.
object
The recipient a grant names: a subject at the configured token issuer, and the actor kind a caller must resolve to for the grant to release anything to it.
object
An actor kind: a service, or a human person.
An identifier another system issues, written exactly as its issuer gives it.
Where a grant stands.
Example
{ "grantee": { "kind": "service" }, "state": "active"}Headers
Section titled “Headers”The path of the created resource.
A problem: request.invalid.
object
Example
{ "code": "request.invalid", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: authentication.refused.
object
Example
{ "code": "authentication.refused", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}Headers
Section titled “Headers”The bearer challenge.
A problem: profile.not-authorized.
object
Example
{ "code": "profile.not-authorized", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: resource.not-found.
object
Example
{ "code": "resource.not-found", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: request.method-not-allowed.
object
Example
{ "code": "request.method-not-allowed", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: document-version.not-releasable, idempotency.key-reused.
object
Example
{ "code": "document-version.not-releasable", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: idempotency.expired.
object
Example
{ "code": "idempotency.expired", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: request.body-too-large.
object
Example
{ "code": "request.body-too-large", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: request.unsupported-media-type.
object
Example
{ "code": "request.unsupported-media-type", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: document-grant.expiry-out-of-range, request.unprocessable.
object
Example
{ "code": "document-grant.expiry-out-of-range", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}A problem: service.unavailable.
object
Example
{ "code": "service.unavailable", "type": "https://id.registrystack.org/problems/registry-documents/authentication/refused"}Headers
Section titled “Headers”Whole seconds to wait before trying again.
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.