curl -X POST https://api.okrapdf.com/v1/collections/col-40da068481cf4f248853507cba6be611/documents \
-H "Authorization: Bearer okra_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"document_ids": ["doc-abc123", "doc-def456"]}'
Collections
Add Documents to Collection
Add one or more documents to an existing collection.
POST
/
v1
/
collections
/
{id}
/
documents
curl -X POST https://api.okrapdf.com/v1/collections/col-40da068481cf4f248853507cba6be611/documents \
-H "Authorization: Bearer okra_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"document_ids": ["doc-abc123", "doc-def456"]}'
Overview
Adds documents to a collection by ID. Documents already in the collection are silently skipped.Request
string
required
Collection ID (
col-...) or collection name.string[]
required
Array of document IDs to add. Must contain at least one ID.
curl -X POST https://api.okrapdf.com/v1/collections/col-40da068481cf4f248853507cba6be611/documents \
-H "Authorization: Bearer okra_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"document_ids": ["doc-abc123", "doc-def456"]}'
Response (200)
{
"ok": true,
"added": 2
}