Add items to collection

Add items to a collection; they stay in the collections they are already in.

POST https://cotlet.dev/api/v1/zotero/items-to-collections

write

Adds the items to the collection the way dragging them onto it does, so they keep their other collections. It reaches nobody and runs without asking first; Remove Item(s) from Collection… in Zotero undoes it.

Parameters

Parameters: add_items_to_collection
NameTypeDescription
collection_key string required string Collection key from list_collections.
item_keys string[] required string[] Items to add.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/zotero/items-to-collections \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"collection_key":"collection key","item_keys":["item keys"]}'
Python
result = client.call("zotero", "add_items_to_collection", {"collection_key":"collection key","item_keys":["item keys"]})
Node.js
const result = await cotlet.call('zotero', 'add_items_to_collection', {"collection_key":"collection key","item_keys":["item keys"]});
CLI
cotlet call zotero add_items_to_collection --data '{"collection_key":"collection key","item_keys":["item keys"]}'

Example response

JSON

{
  "collection_key": "C4T8WZ2N",
  "added": [
    "H6R2VB5D",
    "N9Q4XA7E"
  ],
  "already_in_collection": []
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.