Skip to main content
POST
/
v1beta
/
namespaces
/
{namespace}
/
documents
JavaScript
import Charcoal from 'charcoal';

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

const upsertDocumentsResponse = await client.namespaces.documents.upsert('namespace', {
  documents: [{ id: 'id' }],
});

console.log(upsertDocumentsResponse.documents_upserted);
{
  "documents_upserted": 123
}

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

Body

application/json
documents
object[]
required
Maximum array length: 10000
schema
object

Optional explicit schema for the documents. If omitted, schema is inferred.

Response

200 - application/json

Successful response

documents_upserted
integer
required