List collections
Collections and subcollections of the library with their keys and item counts.
GET https://cotlet.dev/api/v1/zotero/collections
read
Returns the collection tree with each key, its parent and the number of items directly in it. Collection names are not unique in Zotero, so use the key and the parent to tell two collections apart.
Parameters
| Name | Type | Description |
|---|---|---|
| library string | string | 'me' for My Library (default) or a group library ID from list_libraries. |
Request
curl https://cotlet.dev/api/v1/zotero/collections \
-H "Authorization: Bearer $COTLET_API_KEY" result = client.call("zotero", "list_collections") const result = await cotlet.call('zotero', 'list_collections'); cotlet call zotero list_collections Example response
{
"collections": [
{
"collection_key": "C4T8WZ2N",
"name": "Thesis: related work",
"parent": null,
"item_count": 2
},
{
"collection_key": "M2D7FQ4S",
"name": "Chapter 2",
"parent": "C4T8WZ2N",
"item_count": 0
}
]
}