Create Document

Create a new document

POSThttps://api.jamdesk.com/api/v1/documents

Creates a new document in the specified collection.

Request Body

collectionstringrequired

Collection name.

dataobjectrequired

Document data.

curl -X POST "https://api.example.com/v1/documents" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "collection": "posts",
    "data": {
      "title": "My First Post",
      "content": "Hello world!",
      "published": true
    }
  }'
{
  "data": {
    "id": "doc_xyz",
    "collection": "posts",
    "data": {
      "title": "My First Post",
      "content": "Hello world!",
      "published": true
    },
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
}