Skip to main content
GET
/
v1
/
namespaces
/
{namespace}
/
documents
/
{documentId}
JavaScript
import Charcoal from 'charcoal';

const client = new Charcoal({
  apiKey: process.env['CHARCOAL_API_KEY'], // This is the default and can be omitted
});

const document = await client.namespaces.documents.retrieve('documentId', {
  namespace: 'namespace',
});

console.log(document.id);
{
  "id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

namespace
string
required

Namespace identifier. Alphanumeric characters, hyphens, underscores, and dots. Max 128 characters.

Maximum string length: 128
Pattern: ^[A-Za-z0-9-_.]{1,128}$
documentId
string
required

Document identifier. UUID or string up to 64 characters.

Maximum string length: 64

Response

Successful response

A document is a record with a required id and arbitrary attributes. Attribute types must conform to the namespace's attributes_schema. If no schema is provided during upsert, one is inferred from the document structure.

id
string
required

Document ID. UUID or string up to 64 characters.

Maximum string length: 64