Create or update Zotero items
zotero_create_itemsBatch-create or update Zotero items with automatic schema validation, ensuring all-or-nothing writes.
Instructions
Create new items or update existing ones in a single batch (the server auto-chunks into groups of 50). items is an ARRAY of item-data objects; each object has itemType as a plain string (e.g. "journalArticle", "book", "preprint", "report") plus its valid fields, creators (each {creatorType, firstName, lastName} or {creatorType, name}), tags ([{tag}]), and collections (array of 8-char collection keys). To UPDATE an existing item, also include its key and current version; to CREATE, omit both. Every item is validated against the Zotero schema before anything is sent — if any item is invalid, nothing is written and the problems are returned. Use zotero_schema to discover valid fields/creator types for an itemType. Writes go to the cloud Web API (requires ZOTERO_API_KEY). To write to a GROUP library, pass its numeric library_id (from zotero_groups) together with library_type:"group". library_type alone is not enough, and the key needs write access to that group. Collection keys are per-library, so take them from zotero_list_collections with the same library_id.
Example:
{"items": [{"itemType": "journalArticle", "title": "The Role of Metadata in Machine Learning", "creators": [{"creatorType": "author", "firstName": "Ada", "lastName": "Lovelace"}], "date": "2024-01-15", "DOI": "10.1234/example.5678", "tags": [{"tag": "ml"}], "collections": ["ABCD1234"]}]}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Array of Zotero item-data objects (itemType + fields; include key+version to update). Example: {"items":[{"itemType":"journalArticle","title":"The Role of Metadata in Machine Learning","creators":[{"creatorType":"author","firstName":"Ada","lastName":"Lovelace"}],"date":"2024-01-15","DOI":"10.1234/example.5678","tags":[{"tag":"ml"}],"collections":["ABCD1234"]}]} | |
| library_id | No | Numeric id of the library to address, e.g. 5234875 for a group (zotero_groups lists the ids you can reach). Omit to use the configured default library; an id given without library_type is read as a group id. | |
| library_type | No | Which library to address: "user" (a personal library) or "group" (a shared group library). Omit to use the library this server is configured for. "group" on its own is refused: pass library_id with it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| failed | No | One entry per object the write could not land; absent or empty when all of them did. | |
| created | Yes | One entry per item Zotero accepted, created or updated. | |
| libraryVersion | No | The library's Last-Modified-Version after this write. |