Skip to main content
Version: 1.0.0

Create documents

info
  • client write secret is required for adding, modifying, or deleting data.
  • Documents must include _id and title fields as mandatory.
  • Attempting to add a Document with an already existing _id will result in a 409 error.

Overview

Path
POST/v1/collections/{collectionName}/documents
  • Add Documents to a Collection.

Example


curl -X POST https://api.invector.co/v1/collections/{collectionName}/documents \
     -H "Content-Type: application/json" \
     -H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
     -d '{
       "documents": [
         {
           "_id": "unique_document_id_123",
           "title": "Description of Philip",
           "name": "Philip",
           "age": 22,
           "department": "Engineering",
           "role": "Software Engineer",
           "email": "philipchoi@togglecampus.com"
         }
       ]
     }'

Authorization


Authorization
BasicBasic authorization at Header. Base64 encoding required
client_id
string
client_secret
string
example

 curl -X POST https://api.invector.co/v1/collections/{collectionName}/documents \
      -H "Content-Type: application/json" \
      -H "Authorization: Basic base64({CLIENT_ID}:{CLIENT_WRITE_SECRET})" \
     ...

Path Parameters


collectionName
string

Request Body


documents
array of objectArray of documents to be created.
_id
string (required)Unique Document ID.
title
string (required)Title of the document.
[other fields …]
anyOther fields of the document.
example
{
  "documents": [
    {
      "_id": "unique_document_id_123",
      "title": "Description of Philip",
      "name": "Philip",
      "age": 22,
      "department": "Engineering",
      "role": "Software Engineer",
      "email": "philipchoi@togglecampus.com"
    }
  ]
}

Response Body


documents
array of objectArray of documents to be created.
_id
string (required)Unique Document ID.
title
string (required)Title of the document.
[other fields …]
anyOther fields of the document.
example
{
  "documents": [
    {
      "_id": "unique_document_id_123",
      "title": "Description of Philip",
      "name": "Philip",
      "age": 22,
      "department": "Engineering",
      "role": "Software Engineer",
      "email": "philipchoi@togglecampus.com"
    }
  ]
}