D

Create and Update a Document

Create and Update a Document

Create

curl -X POST https://dokki.one/api/v1/resources \
  -H "Authorization: Bearer $DOKKI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "document",
    "name": "Release notes",
    "workspace_id": "workspace_uuid",
    "content": "# Release notes\n"
  }'

The response includes the resource id and the created document id.

Update

curl -X PATCH https://dokki.one/api/v1/resources/{resource_id}/content \
  -H "Authorization: Bearer $DOKKI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "# Release notes\n\nNew content.",
    "create_snapshot": true,
    "snapshot_description": "Release notes sync"
  }'

For concurrent writers, serialize application jobs per resource and retain the snapshot/request metadata. A later version of the API will expose stronger conditional-write headers; until then, do not blindly overwrite a document after a stale read.