# zotero-api-client

> A lightweight, minimalistic Zotero API client

Latest version **0.51.0** (published 2026-07-30) · AGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install zotero-api-client
pnpm add zotero-api-client
yarn add zotero-api-client
bun add zotero-api-client
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.51.0 |
| Published | 2026-07-30 |
| First published | 2017-07-28 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 18.0.0 |
| Dependencies | 3 |
| Unpacked size | 300.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 123 |
| Author | Tom Najdek |
| Maintainers | tnajdek |

## Links

- npm: https://www.npmjs.com/package/zotero-api-client
- Repository: https://github.com/tnajdek/zotero-api-client
- Homepage: https://github.com/tnajdek/zotero-api-client#readme
- Issues: https://github.com/tnajdek/zotero-api-client/issues
- npm.io page: https://npm.io/package/zotero-api-client

## Dependencies (3)

- [spark-md5](https://npm.io/package/spark-md5.md) ^3.0.2
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^8.0.0
- [@babel/runtime-corejs3](https://npm.io/package/@babel/runtime-corejs3.md) ^8.0.0

## Recent versions

- 0.51.0 (latest) — 2026-07-30
- 0.50.0 — 2026-06-22
- 0.49.0 — 2026-06-15
- 0.48.0 — 2026-02-14
- 0.47.0 — 2025-02-11
- 0.46.0 — 2024-11-22
- 0.45.0 — 2024-08-30
- 0.44.0 — 2024-07-17
- 0.43.1 — 2023-09-01
- 0.43.0 — 2023-08-30
- 0.42.0 — 2023-08-10
- 0.41.1 — 2023-04-17
- 0.41.0 — 2023-04-11
- 0.40.1 — 2023-01-21
- 0.40.0 — 2022-06-02
- … 51 more at https://npm.io/package/zotero-api-client/versions

## README

[![Build Status](https://github.com/tnajdek/zotero-api-client/actions/workflows/ci.yml/badge.svg)](https://github.com/tnajdek/zotero-api-client/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/tnajdek/zotero-api-client/badge.svg?branch=master)](https://coveralls.io/github/tnajdek/zotero-api-client?branch=master)
[![npm version](https://img.shields.io/npm/v/zotero-api-client)](https://www.npmjs.com/package/zotero-api-client)

Zotero API client
========
A lightweight, minimalistic Zotero API client developed in JavaScript with the following goals:

* Small, single-purpose module: focuses solely on interacting with the API
* Compatible with both Node and browser environments
* No abstraction over Zotero data: what you see is what you get
* Clean API
* Small bundle footprint
* Minimal request validation
* Predictable and consistent responses
* Full test coverage

**The client does *not* provide the following:**

* Version management: version headers need to be provided explicitly
* Caching: each call to `get()`, `post()`, etc., actually calls the API
* Abstraction: there are no **Item** or **Collection** objects. The API response is returned with a minimal layer to automate common tasks and offers unrestricted access to the raw response JSON data.

Getting The Library
===================

The NPM package includes the source of the library, which can be used as part of your build process (e.g., with Browserify, Rollup, Webpack, etc.) or directly in Node:

```bash
npm install zotero-api-client
```

The package also includes a [UMD](https://github.com/umdjs/umd) bundle, which can be loaded with common module loaders or included directly in a `<script>` tag. In the latter case, the library will be available as a global object `ZoteroApiClient`. One way to use the UMD bundle on your page is to include it from the [unpkg](https://unpkg.com) project CDN:

```html
<script src="https://unpkg.com/zotero-api-client"></script>
```


Example
=======

A simple example of reading items from the public/test user library:

1. Import the library based on your environment:

   ```javascript
   // ES module, commonly used with a bundler:
   import api from 'zotero-api-client';
   // CommonJS, for Node.js and some bundling cases:
   const { default: api } = require('zotero-api-client');
   // UMD bundle creates `ZoteroApiClient` global object
   const { default: api } = ZoteroApiClient;
   ```

2. Use the API to make the request (using [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function)):

   ```javascript
   const response = await api().library('user', 475425).collections('9KH9TNSJ').items().get();
   ```

3. Extract items from the response:

   ```javascript
   const items = response.getData();
   ```

4. Print the titles of all items in the collection to the console:

   ```javascript
   console.log(items.map(i => i.title));
   ```

Overview
========

The library is composed of three layers:

- **`api` function**: This is the only interface exported for use.
- **Request engine**: This component does the heavy lifting and should not be used directly.
- **ApiResponse class**: A thin wrapper around the response. Multiple specialised variants exist for handling different response types.


API interface
-------------

The API interface is a function that returns a set of functions bound to previously configured options, allowing it to be chained and stored in a partially configured state. A common scenario is to store authentication and library details, which can be done as follows:

```javascript
import api from 'zotero-api-client';
const myapi = api('AUTH_KEY').library('user', 0);
```

This produces an API client already configured with your credentials and user library ID. You can now use `myapi` to obtain the list of collections in that library:

```javascript
const collectionsResponse = await myapi.collections().get();
```

Items in that library:

```javascript
const itemsResponse = await myapi.items().get();
```

Or items in a specific collection:

```js
const collectionItemsResponse = await myapi.collections('EXAMPLE1').items().get();
```

There are two types of API functions:

- **Configuration functions** (e.g., `items()`) that can be further chained.
- **Execution functions** (e.g., `get()`) that trigger the request.

For a complete reference, see the documentation for [api()](#module_zotero-api-client..api).

Response
--------

The response is an instance of a specialised response class object returned by one of the execution functions of the `api`. Each response includes a specialised `getData()` method, which returns the entities that were requested or modified, depending on the request configuration.

For a complete reference, see the documentation for [SingleReadResponse](#module_zotero-api-client..SingleReadResponse), [MultiReadResponse](#module_zotero-api-client..MultiReadResponse), [SingleWriteResponse](#module_zotero-api-client..SingleWriteResponse), [MultiWriteResponse](#module_zotero-api-client..MultiWriteResponse), [DeleteResponse](#module_zotero-api-client..DeleteResponse), [FileUploadResponse](#module_zotero-api-client..FileUploadResponse), [FileDownloadResponse](#module_zotero-api-client..FileDownloadResponse), [FileUrlResponse](#module_zotero-api-client..FileUrlResponse).

Request
-------

The `request` function takes a configuration object generated by the API interface, communicates with the API, and returns one of the response objects (see above). Some rarely used properties cannot be configured through API configuration functions and must be specified as optional properties when calling `api()` or one of the API's execution functions.

For a complete list of all properties `request()` accepts, please refer to the documentation for [request()](#module_zotero-api-client..request).

Local API
=========

The Zotero desktop application can serve a local version of the API at `http://localhost:23119/api/` (enable "Allow other applications on this computer to communicate with Zotero" in Zotero's Advanced settings). It mirrors the web API, user ID `0` refers to the local profile's user. Read requests require no API key:

```javascript
const localapi = api('', { apiScheme: 'http', apiAuthorityPart: 'localhost:23119', apiPath: 'api/' });
const response = await localapi.library('user', 0).items().get();
```

Write requests require two extra pieces:

1. **Server ID**: every write must carry a `Zotero-Server-ID` header identifying the Zotero instance. Every local API response includes this header, so it can be bootstrapped with a bare root request.
2. **Local API key**: requested with `local().authorize()`, which makes Zotero prompt the user to allow write access for your app.

```javascript
const serverID = (await localapi.get()).getServerID();
const auth = await localapi.serverID(serverID).local().authorize('My App').post();
const key = auth.getKey();
```

If the user picks "Always allow", `auth.isRemembered()` returns `true` and the key remains valid until revoked in Zotero's settings. Otherwise the key is single-use: it is consumed by the first write request, and a write with a used or unknown key fails with `401`, at which point authorization should be requested again.

With both in hand, writes look exactly like web API writes:

```javascript
await api(key, { apiScheme: 'http', apiAuthorityPart: 'localhost:23119', apiPath: 'api/' })
	.library('user', 0).serverID(serverID).items().post([ /* items */ ]);
```

Note: the local API drops requests that appear to come from a browser (a `Mozilla/` user agent or an `Origin` header) unless the `Zotero-Allowed-Request` header is present; set it via the `zoteroAllowedRequest` option.

API Reference
=============


* [zotero-api-client](#module_zotero-api-client)
    * [~ApiResponse](#module_zotero-api-client..ApiResponse)
        * [.getResponseType()](#module_zotero-api-client..ApiResponse+getResponseType) ⇒ <code>string</code>
        * [.getData()](#module_zotero-api-client..ApiResponse+getData) ⇒ <code>object</code>
        * [.getLinks()](#module_zotero-api-client..ApiResponse+getLinks) ⇒ <code>object</code>
        * [.getMeta()](#module_zotero-api-client..ApiResponse+getMeta) ⇒ <code>object</code>
        * [.getVersion()](#module_zotero-api-client..ApiResponse+getVersion) ⇒ <code>number</code>
        * [.getServerID()](#module_zotero-api-client..ApiResponse+getServerID) ⇒ <code>string</code>
    * [~FullTextStatusResponse](#module_zotero-api-client..FullTextStatusResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..FullTextStatusResponse+getResponseType)
        * [.getStatus()](#module_zotero-api-client..FullTextStatusResponse+getStatus) ⇒ <code>string</code>
        * [.getIndexedCount()](#module_zotero-api-client..FullTextStatusResponse+getIndexedCount) ⇒ <code>number</code>
        * [.getExpectedCount()](#module_zotero-api-client..FullTextStatusResponse+getExpectedCount) ⇒ <code>number</code>
    * [~SingleReadResponse](#module_zotero-api-client..SingleReadResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..SingleReadResponse+getResponseType)
        * [.getData()](#module_zotero-api-client..SingleReadResponse+getData) ⇒ <code>Object</code>
    * [~MultiReadResponse](#module_zotero-api-client..MultiReadResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..MultiReadResponse+getResponseType)
        * [.getData()](#module_zotero-api-client..MultiReadResponse+getData) ⇒ <code>Array</code>
        * [.getLinks()](#module_zotero-api-client..MultiReadResponse+getLinks) ⇒ <code>Array</code>
        * [.getMeta()](#module_zotero-api-client..MultiReadResponse+getMeta) ⇒ <code>Array</code>
        * [.getTotalResults()](#module_zotero-api-client..MultiReadResponse+getTotalResults) ⇒ <code>number</code>
        * [.getRelLinks()](#module_zotero-api-client..MultiReadResponse+getRelLinks) ⇒ <code>object</code>
    * [~SingleWriteResponse](#module_zotero-api-client..SingleWriteResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..SingleWriteResponse+getResponseType)
        * [.getData()](#module_zotero-api-client..SingleWriteResponse+getData) ⇒ <code>Object</code>
    * [~MultiWriteResponse](#module_zotero-api-client..MultiWriteResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..MultiWriteResponse+getResponseType)
        * [.isSuccess()](#module_zotero-api-client..MultiWriteResponse+isSuccess) ⇒ <code>Boolean</code>
        * [.getData()](#module_zotero-api-client..MultiWriteResponse+getData) ⇒ <code>Array</code>
        * [.getLinks()](#module_zotero-api-client..MultiWriteResponse+getLinks)
        * [.getMeta()](#module_zotero-api-client..MultiWriteResponse+getMeta)
        * [.getErrors()](#module_zotero-api-client..MultiWriteResponse+getErrors) ⇒ <code>Object</code>
        * [.getEntityByKey(key)](#module_zotero-api-client..MultiWriteResponse+getEntityByKey) ⇒ <code>Object</code>
        * [.getEntityByIndex(index)](#module_zotero-api-client..MultiWriteResponse+getEntityByIndex) ⇒ <code>Object</code>
    * [~DeleteResponse](#module_zotero-api-client..DeleteResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..DeleteResponse+getResponseType)
    * [~AuthorizeResponse](#module_zotero-api-client..AuthorizeResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..AuthorizeResponse+getResponseType)
        * [.getKey()](#module_zotero-api-client..AuthorizeResponse+getKey) ⇒ <code>string</code>
        * [.isRemembered()](#module_zotero-api-client..AuthorizeResponse+isRemembered) ⇒ <code>boolean</code>
    * [~FileUploadResponse](#module_zotero-api-client..FileUploadResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..FileUploadResponse+getResponseType)
        * [.getVersion()](#module_zotero-api-client..FileUploadResponse+getVersion)
    * [~FileDownloadResponse](#module_zotero-api-client..FileDownloadResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..FileDownloadResponse+getResponseType)
    * [~FileUrlResponse](#module_zotero-api-client..FileUrlResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..FileUrlResponse+getResponseType)
    * [~RawApiResponse](#module_zotero-api-client..RawApiResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..RawApiResponse+getResponseType)
    * [~PretendResponse](#module_zotero-api-client..PretendResponse) ⇐ <code>ApiResponse</code>
        * [.getResponseType()](#module_zotero-api-client..PretendResponse+getResponseType)
        * [.getVersion()](#module_zotero-api-client..PretendResponse+getVersion) ⇒ <code>Object</code>
    * [~ErrorResponse](#module_zotero-api-client..ErrorResponse) ⇐ <code>Error</code>
        * [.getVersion()](#module_zotero-api-client..ErrorResponse+getVersion) ⇒ <code>number</code>
        * [.getServerID()](#module_zotero-api-client..ErrorResponse+getServerID) ⇒ <code>string</code>
        * [.getResponseType()](#module_zotero-api-client..ErrorResponse+getResponseType)
    * [~api()](#module_zotero-api-client..api) ⇒ <code>Object</code>
        * [~api(key, opts)](#module_zotero-api-client..api..api) ⇒ <code>Object</code>
        * [~library([typeOrKey], [id])](#module_zotero-api-client..api..library) ⇒ <code>Object</code>
        * [~items(items)](#module_zotero-api-client..api..items) ⇒ <code>Object</code>
        * [~itemTypes()](#module_zotero-api-client..api..itemTypes) ⇒ <code>Object</code>
        * [~itemFields()](#module_zotero-api-client..api..itemFields) ⇒ <code>Object</code>
        * [~creatorFields()](#module_zotero-api-client..api..creatorFields) ⇒ <code>Object</code>
        * [~schema()](#module_zotero-api-client..api..schema) ⇒ <code>Object</code>
        * [~fulltextStatus()](#module_zotero-api-client..api..fulltextStatus) ⇒ <code>Object</code>
        * [~fulltext()](#module_zotero-api-client..api..fulltext) ⇒ <code>Object</code>
        * [~itemTypeFields(itemType)](#module_zotero-api-client..api..itemTypeFields) ⇒ <code>Object</code>
        * [~itemTypeCreatorTypes(itemType)](#module_zotero-api-client..api..itemTypeCreatorTypes) ⇒ <code>Object</code>
        * [~template(itemType, subType)](#module_zotero-api-client..api..template) ⇒ <code>Object</code>
        * [~collections(collections)](#module_zotero-api-client..api..collections) ⇒ <code>Object</code>
        * [~subcollections()](#module_zotero-api-client..api..subcollections) ⇒ <code>Object</code>
        * [~publications()](#module_zotero-api-client..api..publications) ⇒ <code>Object</code>
        * [~tags(tags)](#module_zotero-api-client..api..tags) ⇒ <code>Object</code>
        * [~searches(searches)](#module_zotero-api-client..api..searches) ⇒ <code>Object</code>
        * [~top()](#module_zotero-api-client..api..top) ⇒ <code>Object</code>
        * [~trash()](#module_zotero-api-client..api..trash) ⇒ <code>Object</code>
        * [~children()](#module_zotero-api-client..api..children) ⇒ <code>Object</code>
        * [~settings(settings)](#module_zotero-api-client..api..settings) ⇒ <code>Object</code>
        * [~deleted(since)](#module_zotero-api-client..api..deleted) ⇒ <code>Object</code>
        * [~groups()](#module_zotero-api-client..api..groups) ⇒ <code>Object</code>
        * [~version(version)](#module_zotero-api-client..api..version) ⇒ <code>Object</code>
        * [~apiVersion(apiVersion)](#module_zotero-api-client..api..apiVersion) ⇒ <code>Object</code>
        * [~serverID(serverID)](#module_zotero-api-client..api..serverID) ⇒ <code>Object</code>
        * [~attachment([fileName], [file], [mtime], [md5sum], [patch], [algorithm], [zipFilename])](#module_zotero-api-client..api..attachment) ⇒ <code>Object</code>
        * [~registerAttachment(fileName, fileSize, mtime, md5sum, [zipMD5], [zipFilename])](#module_zotero-api-client..api..registerAttachment) ⇒ <code>Object</code>
        * [~attachmentUrl()](#module_zotero-api-client..api..attachmentUrl) ⇒ <code>Object</code>
        * [~verifyKeyAccess()](#module_zotero-api-client..api..verifyKeyAccess) ⇒ <code>Object</code>
        * [~local()](#module_zotero-api-client..api..local) ⇒ <code>Object</code>
        * [~authorize(appName)](#module_zotero-api-client..api..authorize) ⇒ <code>Object</code>
        * [~get(opts)](#module_zotero-api-client..api..get) ⇒ <code>Promise</code>
        * [~post(data, opts)](#module_zotero-api-client..api..post) ⇒ <code>Promise</code>
        * [~put(data, opts)](#module_zotero-api-client..api..put) ⇒ <code>Promise</code>
        * [~patch(data, opts)](#module_zotero-api-client..api..patch) ⇒ <code>Promise</code>
        * [~del(keysToDelete, opts)](#module_zotero-api-client..api..del) ⇒ <code>Promise</code>
        * [~getConfig()](#module_zotero-api-client..api..getConfig) ⇒ <code>Object</code>
        * [~pretend(verb, data, opts)](#module_zotero-api-client..api..pretend) ⇒ <code>Promise</code>
        * [~use(extend)](#module_zotero-api-client..api..use) ⇒ <code>Object</code>
    * [~request(config)](#module_zotero-api-client..request) ⇒ <code>Promise</code>

<a name="module_zotero-api-client..ApiResponse"></a>

### zotero-api-client~ApiResponse
Represents a generic Zotero API response. Usually a specialised variant inheriting from
this class is returned when doing an API request

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  

* [~ApiResponse](#module_zotero-api-client..ApiResponse)
    * [.getResponseType()](#module_zotero-api-client..ApiResponse+getResponseType) ⇒ <code>string</code>
    * [.getData()](#module_zotero-api-client..ApiResponse+getData) ⇒ <code>object</code>
    * [.getLinks()](#module_zotero-api-client..ApiResponse+getLinks) ⇒ <code>object</code>
    * [.getMeta()](#module_zotero-api-client..ApiResponse+getMeta) ⇒ <code>object</code>
    * [.getVersion()](#module_zotero-api-client..ApiResponse+getVersion) ⇒ <code>number</code>
    * [.getServerID()](#module_zotero-api-client..ApiResponse+getServerID) ⇒ <code>string</code>

<a name="module_zotero-api-client..ApiResponse+getResponseType"></a>

#### apiResponse.getResponseType() ⇒ <code>string</code>
Name of the class, useful to determine instance of which specialised class
	  has been returned

**Kind**: instance method of [<code>ApiResponse</code>](#module_zotero-api-client..ApiResponse)  
**Returns**: <code>string</code> - name of the class  
<a name="module_zotero-api-client..ApiResponse+getData"></a>

#### apiResponse.getData() ⇒ <code>object</code>
Content of the response. Specialised classes provide extracted data depending on context.

**Kind**: instance method of [<code>ApiResponse</code>](#module_zotero-api-client..ApiResponse)  
<a name="module_zotero-api-client..ApiResponse+getLinks"></a>

#### apiResponse.getLinks() ⇒ <code>object</code>
Links available in the response. Specialised classes provide extracted links depending on context.

**Kind**: instance method of [<code>ApiResponse</code>](#module_zotero-api-client..ApiResponse)  
<a name="module_zotero-api-client..ApiResponse+getMeta"></a>

#### apiResponse.getMeta() ⇒ <code>object</code>
Meta data available in the response. Specialised classes provide extracted meta data depending on context.

**Kind**: instance method of [<code>ApiResponse</code>](#module_zotero-api-client..ApiResponse)  
<a name="module_zotero-api-client..ApiResponse+getVersion"></a>

#### apiResponse.getVersion() ⇒ <code>number</code>
Value of the "Last-Modified-Version" header in response if present. Specialised classes provide
	  version depending on context

**Kind**: instance method of [<code>ApiResponse</code>](#module_zotero-api-client..ApiResponse)  
**Returns**: <code>number</code> - Version of the content in response  
<a name="module_zotero-api-client..ApiResponse+getServerID"></a>

#### apiResponse.getServerID() ⇒ <code>string</code>
Value of the "Zotero-Server-ID" header in response if present. Identifies the Zotero
	  instance that served the request when using the local API

**Kind**: instance method of [<code>ApiResponse</code>](#module_zotero-api-client..ApiResponse)  
**Returns**: <code>string</code> - ID of the Zotero instance that produced the response  
<a name="module_zotero-api-client..FullTextStatusResponse"></a>

### zotero-api-client~FullTextStatusResponse ⇐ <code>ApiResponse</code>
Represents a response to a GET request for a library's full-text index status

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~FullTextStatusResponse](#module_zotero-api-client..FullTextStatusResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..FullTextStatusResponse+getResponseType)
    * [.getStatus()](#module_zotero-api-client..FullTextStatusResponse+getStatus) ⇒ <code>string</code>
    * [.getIndexedCount()](#module_zotero-api-client..FullTextStatusResponse+getIndexedCount) ⇒ <code>number</code>
    * [.getExpectedCount()](#module_zotero-api-client..FullTextStatusResponse+getExpectedCount) ⇒ <code>number</code>

<a name="module_zotero-api-client..FullTextStatusResponse+getResponseType"></a>

#### fullTextStatusResponse.getResponseType()
**Kind**: instance method of [<code>FullTextStatusResponse</code>](#module_zotero-api-client..FullTextStatusResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..FullTextStatusResponse+getStatus"></a>

#### fullTextStatusResponse.getStatus() ⇒ <code>string</code>
**Kind**: instance method of [<code>FullTextStatusResponse</code>](#module_zotero-api-client..FullTextStatusResponse)  
**Returns**: <code>string</code> - Index status, one of "indexed", "incomplete", "reindexing" or "deindexed"  
<a name="module_zotero-api-client..FullTextStatusResponse+getIndexedCount"></a>

#### fullTextStatusResponse.getIndexedCount() ⇒ <code>number</code>
**Kind**: instance method of [<code>FullTextStatusResponse</code>](#module_zotero-api-client..FullTextStatusResponse)  
**Returns**: <code>number</code> - Number of items currently indexed, or null when not reported (status "indexed"/"deindexed")  
<a name="module_zotero-api-client..FullTextStatusResponse+getExpectedCount"></a>

#### fullTextStatusResponse.getExpectedCount() ⇒ <code>number</code>
**Kind**: instance method of [<code>FullTextStatusResponse</code>](#module_zotero-api-client..FullTextStatusResponse)  
**Returns**: <code>number</code> - Number of items expected to be indexed, or null when not reported (status "indexed"/"deindexed")  
<a name="module_zotero-api-client..SingleReadResponse"></a>

### zotero-api-client~SingleReadResponse ⇐ <code>ApiResponse</code>
Represents a response to a GET request containing a single entity

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~SingleReadResponse](#module_zotero-api-client..SingleReadResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..SingleReadResponse+getResponseType)
    * [.getData()](#module_zotero-api-client..SingleReadResponse+getData) ⇒ <code>Object</code>

<a name="module_zotero-api-client..SingleReadResponse+getResponseType"></a>

#### singleReadResponse.getResponseType()
**Kind**: instance method of [<code>SingleReadResponse</code>](#module_zotero-api-client..SingleReadResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..SingleReadResponse+getData"></a>

#### singleReadResponse.getData() ⇒ <code>Object</code>
**Kind**: instance method of [<code>SingleReadResponse</code>](#module_zotero-api-client..SingleReadResponse)  
**Returns**: <code>Object</code> - entity returned in this response  
<a name="module_zotero-api-client..MultiReadResponse"></a>

### zotero-api-client~MultiReadResponse ⇐ <code>ApiResponse</code>
represents a response to a GET request containing multiple entities

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~MultiReadResponse](#module_zotero-api-client..MultiReadResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..MultiReadResponse+getResponseType)
    * [.getData()](#module_zotero-api-client..MultiReadResponse+getData) ⇒ <code>Array</code>
    * [.getLinks()](#module_zotero-api-client..MultiReadResponse+getLinks) ⇒ <code>Array</code>
    * [.getMeta()](#module_zotero-api-client..MultiReadResponse+getMeta) ⇒ <code>Array</code>
    * [.getTotalResults()](#module_zotero-api-client..MultiReadResponse+getTotalResults) ⇒ <code>number</code>
    * [.getRelLinks()](#module_zotero-api-client..MultiReadResponse+getRelLinks) ⇒ <code>object</code>

<a name="module_zotero-api-client..MultiReadResponse+getResponseType"></a>

#### multiReadResponse.getResponseType()
**Kind**: instance method of [<code>MultiReadResponse</code>](#module_zotero-api-client..MultiReadResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..MultiReadResponse+getData"></a>

#### multiReadResponse.getData() ⇒ <code>Array</code>
**Kind**: instance method of [<code>MultiReadResponse</code>](#module_zotero-api-client..MultiReadResponse)  
**Returns**: <code>Array</code> - a list of entities returned in this response  
<a name="module_zotero-api-client..MultiReadResponse+getLinks"></a>

#### multiReadResponse.getLinks() ⇒ <code>Array</code>
**Kind**: instance method of [<code>MultiReadResponse</code>](#module_zotero-api-client..MultiReadResponse)  
**Returns**: <code>Array</code> - a list of links, indexes of the array match indexes of entities in [getData](#module_zotero-api-client..MultiReadResponse+getData)  
<a name="module_zotero-api-client..MultiReadResponse+getMeta"></a>

#### multiReadResponse.getMeta() ⇒ <code>Array</code>
**Kind**: instance method of [<code>MultiReadResponse</code>](#module_zotero-api-client..MultiReadResponse)  
**Returns**: <code>Array</code> - a list of meta-data, indexes of the array match indexes of entities in [getData](#module_zotero-api-client..MultiReadResponse+getData)  
<a name="module_zotero-api-client..MultiReadResponse+getTotalResults"></a>

#### multiReadResponse.getTotalResults() ⇒ <code>number</code>
**Kind**: instance method of [<code>MultiReadResponse</code>](#module_zotero-api-client..MultiReadResponse)  
**Returns**: <code>number</code> - Total number of results  
<a name="module_zotero-api-client..MultiReadResponse+getRelLinks"></a>

#### multiReadResponse.getRelLinks() ⇒ <code>object</code>
**Kind**: instance method of [<code>MultiReadResponse</code>](#module_zotero-api-client..MultiReadResponse)  
**Returns**: <code>object</code> - Parsed content of "Link" header as an object where value of "rel" is a key and
	  the URL is the value. For paginated responses contain URLs for "first", "next", "prev" and "last".  
<a name="module_zotero-api-client..SingleWriteResponse"></a>

### zotero-api-client~SingleWriteResponse ⇐ <code>ApiResponse</code>
Represents a response to a PUT or PATCH request

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~SingleWriteResponse](#module_zotero-api-client..SingleWriteResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..SingleWriteResponse+getResponseType)
    * [.getData()](#module_zotero-api-client..SingleWriteResponse+getData) ⇒ <code>Object</code>

<a name="module_zotero-api-client..SingleWriteResponse+getResponseType"></a>

#### singleWriteResponse.getResponseType()
**Kind**: instance method of [<code>SingleWriteResponse</code>](#module_zotero-api-client..SingleWriteResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..SingleWriteResponse+getData"></a>

#### singleWriteResponse.getData() ⇒ <code>Object</code>
**Kind**: instance method of [<code>SingleWriteResponse</code>](#module_zotero-api-client..SingleWriteResponse)  
**Returns**: <code>Object</code> - For put requests, this represents a complete, updated object.
                 For patch requests, this represents only updated fields of the updated object.  
<a name="module_zotero-api-client..MultiWriteResponse"></a>

### zotero-api-client~MultiWriteResponse ⇐ <code>ApiResponse</code>
Represents a response to a POST request

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~MultiWriteResponse](#module_zotero-api-client..MultiWriteResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..MultiWriteResponse+getResponseType)
    * [.isSuccess()](#module_zotero-api-client..MultiWriteResponse+isSuccess) ⇒ <code>Boolean</code>
    * [.getData()](#module_zotero-api-client..MultiWriteResponse+getData) ⇒ <code>Array</code>
    * [.getLinks()](#module_zotero-api-client..MultiWriteResponse+getLinks)
    * [.getMeta()](#module_zotero-api-client..MultiWriteResponse+getMeta)
    * [.getErrors()](#module_zotero-api-client..MultiWriteResponse+getErrors) ⇒ <code>Object</code>
    * [.getEntityByKey(key)](#module_zotero-api-client..MultiWriteResponse+getEntityByKey) ⇒ <code>Object</code>
    * [.getEntityByIndex(index)](#module_zotero-api-client..MultiWriteResponse+getEntityByIndex) ⇒ <code>Object</code>

<a name="module_zotero-api-client..MultiWriteResponse+getResponseType"></a>

#### multiWriteResponse.getResponseType()
**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..MultiWriteResponse+isSuccess"></a>

#### multiWriteResponse.isSuccess() ⇒ <code>Boolean</code>
**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**Returns**: <code>Boolean</code> - Indicates whether all write operations were successful  
<a name="module_zotero-api-client..MultiWriteResponse+getData"></a>

#### multiWriteResponse.getData() ⇒ <code>Array</code>
Returns all entities POSTed in an array. Entities that have been written successfully
are returned updated, other entities are returned unchanged. It is advised to verify
if the request was entirely successful (see isSuccess and getErrors) before using this method.

**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**Returns**: <code>Array</code> - A modified list of all entities posted.  
<a name="module_zotero-api-client..MultiWriteResponse+getLinks"></a>

#### multiWriteResponse.getLinks()
**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**See**: [getLinks](#module_zotero-api-client..ApiResponse+getLinks)  
<a name="module_zotero-api-client..MultiWriteResponse+getMeta"></a>

#### multiWriteResponse.getMeta()
**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**See**: [getMeta](#module_zotero-api-client..ApiResponse+getMeta)  
<a name="module_zotero-api-client..MultiWriteResponse+getErrors"></a>

#### multiWriteResponse.getErrors() ⇒ <code>Object</code>
Returns all errors that have occurred.

**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**Returns**: <code>Object</code> - Errors object where keys are indexes of the array of the original request and values are the errors occurred.  
<a name="module_zotero-api-client..MultiWriteResponse+getEntityByKey"></a>

#### multiWriteResponse.getEntityByKey(key) ⇒ <code>Object</code>
Allows getting an updated entity based on its key, otherwise identical to getEntityByIndex

**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**Throws**:

- <code>Error</code> If key is not present in the request

**See**: [getEntityByIndex](#module_zotero-api-client..MultiWriteResponse+getEntityByIndex)  

| Param | Type |
| --- | --- |
| key | <code>String</code> | 

<a name="module_zotero-api-client..MultiWriteResponse+getEntityByIndex"></a>

#### multiWriteResponse.getEntityByIndex(index) ⇒ <code>Object</code>
Allows getting an updated entity based on its index in the original request

**Kind**: instance method of [<code>MultiWriteResponse</code>](#module_zotero-api-client..MultiWriteResponse)  
**Throws**:

- <code>Error</code> If index is not present in the original request
- <code>Error</code> If error occurred in the POST for selected entity. Error message will contain the reason for failure.


| Param | Type |
| --- | --- |
| index | <code>Number</code> \| <code>String</code> | 

<a name="module_zotero-api-client..DeleteResponse"></a>

### zotero-api-client~DeleteResponse ⇐ <code>ApiResponse</code>
Represents a response to a DELETE request

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  
<a name="module_zotero-api-client..DeleteResponse+getResponseType"></a>

#### deleteResponse.getResponseType()
**Kind**: instance method of [<code>DeleteResponse</code>](#module_zotero-api-client..DeleteResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..AuthorizeResponse"></a>

### zotero-api-client~AuthorizeResponse ⇐ <code>ApiResponse</code>
Represents a response to a local API authorization request (POST /api/local/authorize).
Local API only

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~AuthorizeResponse](#module_zotero-api-client..AuthorizeResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..AuthorizeResponse+getResponseType)
    * [.getKey()](#module_zotero-api-client..AuthorizeResponse+getKey) ⇒ <code>string</code>
    * [.isRemembered()](#module_zotero-api-client..AuthorizeResponse+isRemembered) ⇒ <code>boolean</code>

<a name="module_zotero-api-client..AuthorizeResponse+getResponseType"></a>

#### authorizeResponse.getResponseType()
**Kind**: instance method of [<code>AuthorizeResponse</code>](#module_zotero-api-client..AuthorizeResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..AuthorizeResponse+getKey"></a>

#### authorizeResponse.getKey() ⇒ <code>string</code>
Local API key granted by the user, to be sent in the "Zotero-API-Key" header on
	  subsequent write requests

**Kind**: instance method of [<code>AuthorizeResponse</code>](#module_zotero-api-client..AuthorizeResponse)  
**Returns**: <code>string</code> - Local API key authorizing write requests  
<a name="module_zotero-api-client..AuthorizeResponse+isRemembered"></a>

#### authorizeResponse.isRemembered() ⇒ <code>boolean</code>
Whether the user granted persistent access ("Always Allow"). When false, the key
	  is single-use: the first write request that successfully validates it consumes it

**Kind**: instance method of [<code>AuthorizeResponse</code>](#module_zotero-api-client..AuthorizeResponse)  
**Returns**: <code>boolean</code> - Whether the key is persistent  
<a name="module_zotero-api-client..FileUploadResponse"></a>

### zotero-api-client~FileUploadResponse ⇐ <code>ApiResponse</code>
Represents a response to a file upload request

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| authResponse | <code>Object</code> | Response object for stage 1 (upload authorisation) request |
| response | <code>Object</code> | alias for "authResponse" |
| uploadResponse | <code>Object</code> | Response object for stage 2 (file upload) request |
| registerResponse | <code>Object</code> | Response object for stage 3 (upload registration) request |


* [~FileUploadResponse](#module_zotero-api-client..FileUploadResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..FileUploadResponse+getResponseType)
    * [.getVersion()](#module_zotero-api-client..FileUploadResponse+getVersion)

<a name="module_zotero-api-client..FileUploadResponse+getResponseType"></a>

#### fileUploadResponse.getResponseType()
**Kind**: instance method of [<code>FileUploadResponse</code>](#module_zotero-api-client..FileUploadResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..FileUploadResponse+getVersion"></a>

#### fileUploadResponse.getVersion()
**Kind**: instance method of [<code>FileUploadResponse</code>](#module_zotero-api-client..FileUploadResponse)  
**See**: [getVersion](#module_zotero-api-client..ApiResponse+getVersion)  
<a name="module_zotero-api-client..FileDownloadResponse"></a>

### zotero-api-client~FileDownloadResponse ⇐ <code>ApiResponse</code>
Represents a response to a file download request

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  
<a name="module_zotero-api-client..FileDownloadResponse+getResponseType"></a>

#### fileDownloadResponse.getResponseType()
**Kind**: instance method of [<code>FileDownloadResponse</code>](#module_zotero-api-client..FileDownloadResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..FileUrlResponse"></a>

### zotero-api-client~FileUrlResponse ⇐ <code>ApiResponse</code>
Represents a response containing temporary url for file download

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  
<a name="module_zotero-api-client..FileUrlResponse+getResponseType"></a>

#### fileUrlResponse.getResponseType()
**Kind**: instance method of [<code>FileUrlResponse</code>](#module_zotero-api-client..FileUrlResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..RawApiResponse"></a>

### zotero-api-client~RawApiResponse ⇐ <code>ApiResponse</code>
Represents a raw response, e.g. to data requests with format other than JSON

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  
<a name="module_zotero-api-client..RawApiResponse+getResponseType"></a>

#### rawApiResponse.getResponseType()
**Kind**: instance method of [<code>RawApiResponse</code>](#module_zotero-api-client..RawApiResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..PretendResponse"></a>

### zotero-api-client~PretendResponse ⇐ <code>ApiResponse</code>
Represents a response for pretended request, mostly for debug purposes. See [module:zotero-api-client.api~pretend](module:zotero-api-client.api~pretend)

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>ApiResponse</code>  

* [~PretendResponse](#module_zotero-api-client..PretendResponse) ⇐ <code>ApiResponse</code>
    * [.getResponseType()](#module_zotero-api-client..PretendResponse+getResponseType)
    * [.getVersion()](#module_zotero-api-client..PretendResponse+getVersion) ⇒ <code>Object</code>

<a name="module_zotero-api-client..PretendResponse+getResponseType"></a>

#### pretendResponse.getResponseType()
**Kind**: instance method of [<code>PretendResponse</code>](#module_zotero-api-client..PretendResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..PretendResponse+getVersion"></a>

#### pretendResponse.getVersion() ⇒ <code>Object</code>
**Kind**: instance method of [<code>PretendResponse</code>](#module_zotero-api-client..PretendResponse)  
**Returns**: <code>Object</code> - For pretended request version will always be null.  
<a name="module_zotero-api-client..ErrorResponse"></a>

### zotero-api-client~ErrorResponse ⇐ <code>Error</code>
Represents an error response from the api

**Kind**: inner class of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Extends**: <code>Error</code>  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| response | <code>Object</code> | Response object for the request, with untouched body |
| message | <code>String</code> | What error occurred, usually contains response code and status |
| reason | <code>String</code> | More detailed reason for the failure, if provided by the API |
| options | <code>Object</code> | Configuration object used for this request |


* [~ErrorResponse](#module_zotero-api-client..ErrorResponse) ⇐ <code>Error</code>
    * [.getVersion()](#module_zotero-api-client..ErrorResponse+getVersion) ⇒ <code>number</code>
    * [.getServerID()](#module_zotero-api-client..ErrorResponse+getServerID) ⇒ <code>string</code>
    * [.getResponseType()](#module_zotero-api-client..ErrorResponse+getResponseType)

<a name="module_zotero-api-client..ErrorResponse+getVersion"></a>

#### errorResponse.getVersion() ⇒ <code>number</code>
Value of the "Last-Modified-Version" header in response if present. This is generally only available if the server responded with 412 due to a version mismatch.

**Kind**: instance method of [<code>ErrorResponse</code>](#module_zotero-api-client..ErrorResponse)  
**Returns**: <code>number</code> - Version of the content in response  
<a name="module_zotero-api-client..ErrorResponse+getServerID"></a>

#### errorResponse.getServerID() ⇒ <code>string</code>
Value of the "Zotero-Server-ID" header in response if present. Identifies the Zotero
	  instance that served the request when using the local API

**Kind**: instance method of [<code>ErrorResponse</code>](#module_zotero-api-client..ErrorResponse)  
**Returns**: <code>string</code> - ID of the Zotero instance that produced the response  
<a name="module_zotero-api-client..ErrorResponse+getResponseType"></a>

#### errorResponse.getResponseType()
**Kind**: instance method of [<code>ErrorResponse</code>](#module_zotero-api-client..ErrorResponse)  
**See**: [getResponseType](#module_zotero-api-client..ApiResponse+getResponseType)  
<a name="module_zotero-api-client..api"></a>

### zotero-api-client~api() ⇒ <code>Object</code>
Wrapper function creates closure scope and calls api()

**Kind**: inner method of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Returns**: <code>Object</code> - Partially configured api functions  

* [~api()](#module_zotero-api-client..api) ⇒ <code>Object</code>
    * [~api(key, opts)](#module_zotero-api-client..api..api) ⇒ <code>Object</code>
    * [~library([typeOrKey], [id])](#module_zotero-api-client..api..library) ⇒ <code>Object</code>
    * [~items(items)](#module_zotero-api-client..api..items) ⇒ <code>Object</code>
    * [~itemTypes()](#module_zotero-api-client..api..itemTypes) ⇒ <code>Object</code>
    * [~itemFields()](#module_zotero-api-client..api..itemFields) ⇒ <code>Object</code>
    * [~creatorFields()](#module_zotero-api-client..api..creatorFields) ⇒ <code>Object</code>
    * [~schema()](#module_zotero-api-client..api..schema) ⇒ <code>Object</code>
    * [~fulltextStatus()](#module_zotero-api-client..api..fulltextStatus) ⇒ <code>Object</code>
    * [~fulltext()](#module_zotero-api-client..api..fulltext) ⇒ <code>Object</code>
    * [~itemTypeFields(itemType)](#module_zotero-api-client..api..itemTypeFields) ⇒ <code>Object</code>
    * [~itemTypeCreatorTypes(itemType)](#module_zotero-api-client..api..itemTypeCreatorTypes) ⇒ <code>Object</code>
    * [~template(itemType, subType)](#module_zotero-api-client..api..template) ⇒ <code>Object</code>
    * [~collections(collections)](#module_zotero-api-client..api..collections) ⇒ <code>Object</code>
    * [~subcollections()](#module_zotero-api-client..api..subcollections) ⇒ <code>Object</code>
    * [~publications()](#module_zotero-api-client..api..publications) ⇒ <code>Object</code>
    * [~tags(tags)](#module_zotero-api-client..api..tags) ⇒ <code>Object</code>
    * [~searches(searches)](#module_zotero-api-client..api..searches) ⇒ <code>Object</code>
    * [~top()](#module_zotero-api-client..api..top) ⇒ <code>Object</code>
    * [~trash()](#module_zotero-api-client..api..trash) ⇒ <code>Object</code>
    * [~children()](#module_zotero-api-client..api..children) ⇒ <code>Object</code>
    * [~settings(settings)](#module_zotero-api-client..api..settings) ⇒ <code>Object</code>
    * [~deleted(since)](#module_zotero-api-client..api..deleted) ⇒ <code>Object</code>
    * [~groups()](#module_zotero-api-client..api..groups) ⇒ <code>Object</code>
    * [~version(version)](#module_zotero-api-client..api..version) ⇒ <code>Object</code>
    * [~apiVersion(apiVersion)](#module_zotero-api-client..api..apiVersion) ⇒ <code>Object</code>
    * [~serverID(serverID)](#module_zotero-api-client..api..serverID) ⇒ <code>Object</code>
    * [~attachment([fileName], [file], [mtime], [md5sum], [patch], [algorithm], [zipFilename])](#module_zotero-api-client..api..attachment) ⇒ <code>Object</code>
    * [~registerAttachment(fileName, fileSize, mtime, md5sum, [zipMD5], [zipFilename])](#module_zotero-api-client..api..registerAttachment) ⇒ <code>Object</code>
    * [~attachmentUrl()](#module_zotero-api-client..api..attachmentUrl) ⇒ <code>Object</code>
    * [~verifyKeyAccess()](#module_zotero-api-client..api..verifyKeyAccess) ⇒ <code>Object</code>
    * [~local()](#module_zotero-api-client..api..local) ⇒ <code>Object</code>
    * [~authorize(appName)](#module_zotero-api-client..api..authorize) ⇒ <code>Object</code>
    * [~get(opts)](#module_zotero-api-client..api..get) ⇒ <code>Promise</code>
    * [~post(data, opts)](#module_zotero-api-client..api..post) ⇒ <code>Promise</code>
    * [~put(data, opts)](#module_zotero-api-client..api..put) ⇒ <code>Promise</code>
    * [~patch(data, opts)](#module_zotero-api-client..api..patch) ⇒ <code>Promise</code>
    * [~del(keysToDelete, opts)](#module_zotero-api-client..api..del) ⇒ <code>Promise</code>
    * [~getConfig()](#module_zotero-api-client..api..getConfig) ⇒ <code>Object</code>
    * [~pretend(verb, data, opts)](#module_zotero-api-client..api..pretend) ⇒ <code>Promise</code>
    * [~use(extend)](#module_zotero-api-client..api..use) ⇒ <code>Object</code>

<a name="module_zotero-api-client..api..api"></a>

#### api~api(key, opts) ⇒ <code>Object</code>
Entry point of the interface. Configures authentication.
Can be used to configure any other properties of the api
Returns a set of functions that are bound to that configuration
and can be called to specify further api configuration.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| key | <code>String</code> | Authentication key |
| opts | <code>Object</code> | Optional api configuration. For a list of all                         possible properties, see documentation for                         request() function |
| opts.skipValidation | <code>Boolean</code> | skip client-side validation of the                         resource/method combination. Validation is a chain-layer                         feature only; calling request() directly is never validated. |

<a name="module_zotero-api-client..api..library"></a>

#### api~library([typeOrKey], [id]) ⇒ <code>Object</code>
Configures which library api requests should use.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [typeOrKey] | <code>\*</code> |  | Library key, e.g. g1234. Alternatively, if                           the second parameter is present, library type i.e.                          either 'group' or 'user' |
| [id] | <code>Number</code> | <code></code> | Only when first argument is a type, library id |

<a name="module_zotero-api-client..api..items"></a>

#### api~items(items) ⇒ <code>Object</code>
Configures api to use items or a specific item
Can be used in conjunction with library(), collections(), top(), trash(),
children(), tags() and any execution function (e.g. get(), post())

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| items | <code>String</code> | <code></code> | Item key, if present, configure api to point at                          this specific item |

<a name="module_zotero-api-client..api..itemTypes"></a>

#### api~itemTypes() ⇒ <code>Object</code>
Configure api to request all item types
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..itemFields"></a>

#### api~itemFields() ⇒ <code>Object</code>
Configure api to request all item fields
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..creatorFields"></a>

#### api~creatorFields() ⇒ <code>Object</code>
Configure api to request localized creator fields
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..schema"></a>

#### api~schema() ⇒ <code>Object</code>
Configure api to request schema
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..fulltextStatus"></a>

#### api~fulltextStatus() ⇒ <code>Object</code>
Configure api to request the full-text index status for a library
Must be used in conjunction with library() and get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..fulltext"></a>

#### api~fulltext() ⇒ <code>Object</code>
Configure api to request or write full-text content.
When used in conjunction with library() and items() with a single item key,
use get() to retrieve and put() to store full-text content for that
attachment item.
When used in conjunction with library() alone, use get() with a `since`
option to request a map of item keys to full-text content versions, or
post() to write full-text content for multiple items at a time.
The library-scoped endpoint only accepts `format: 'versions'`.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..itemTypeFields"></a>

#### api~itemTypeFields(itemType) ⇒ <code>Object</code>
Configure api to request all valid fields for an item type
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| itemType | <code>String</code> | item type for which valid fields will be                             requested, e.g. 'book' or 'journalType' |

<a name="module_zotero-api-client..api..itemTypeCreatorTypes"></a>

#### api~itemTypeCreatorTypes(itemType) ⇒ <code>Object</code>
Configure api to request valid creator types for an item type
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| itemType | <code>String</code> | item type for which valid creator types                             will be requested, e.g. 'book' or                             'journalType' |

<a name="module_zotero-api-client..api..template"></a>

#### api~template(itemType, subType) ⇒ <code>Object</code>
Configure api to request template for a new item
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| itemType | <code>String</code> | item type for which template will be requested, e.g. 'book' or 'journalType' |
| subType | <code>String</code> | annotationType if itemType is 'annotation' or linkMode if itemType is 'attachment' |

<a name="module_zotero-api-client..api..collections"></a>

#### api~collections(collections) ⇒ <code>Object</code>
Configure api to use collections or a specific collection
Can be used in conjunction with library(), items(), top(), tags() and
any of the execution function (e.g. get(), post())

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| collections | <code>String</code> | Collection key, if present, configure api to                          point to this specific collection |

<a name="module_zotero-api-client..api..subcollections"></a>

#### api~subcollections() ⇒ <code>Object</code>
Configure api to use subcollections that reside underneath the specified
collection.
Should only be used in conjunction with both library() and collections()
and any of the execution function (e.g. get(), post())

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..publications"></a>

#### api~publications() ⇒ <code>Object</code>
Configure api to narrow the request to only consider items filed under
"My Publications"
Should only be used in conjunction with both library() and items()
and any of the execution function (e.g. get(), post())

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..tags"></a>

#### api~tags(tags) ⇒ <code>Object</code>
Configure api to request or delete tags or request a specific tag
Can be used in conjunction with library(), items(), collections() and
any of the following execution functions: get(), delete() but only
if the first argument is not present. Otherwise, can only be used in
conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| tags | <code>String</code> | <code></code> | name of a tag to request. If present, configure                         api to request a specific tag. |

<a name="module_zotero-api-client..api..searches"></a>

#### api~searches(searches) ⇒ <code>Object</code>
Configure api to use saved searches or a specific saved search
Can be used in conjunction with library() and any of the execution
functions

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| searches | <code>String</code> | <code></code> | Search key, if present, configure api to point at                             this specific saved search |

<a name="module_zotero-api-client..api..top"></a>

#### api~top() ⇒ <code>Object</code>
Configure api to narrow the request only to the top level items
Can be used in conjunction with items() and collections() and only
with conjunction with a get() execution function

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..trash"></a>

#### api~trash() ⇒ <code>Object</code>
Configure api to narrow the request only to the items in the trash
Can be only used in conjunction with items() and get() execution
function

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..children"></a>

#### api~children() ⇒ <code>Object</code>
Configure api to narrow the request only to the children of given
item
Can be only used in conjunction with items() and get() execution
function

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..settings"></a>

#### api~settings(settings) ⇒ <code>Object</code>
Configure api to request settings
Can only be used in conjunction with get(), put(), post() and delete()
For usage with put() and delete() a settings key must be provided
For usage with post() a settings key must not be included

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| settings | <code>String</code> | <code></code> | Settings "key", if present, configures api to point at                             this specific key within settings, e.g. `tagColors`. |

<a name="module_zotero-api-client..api..deleted"></a>

#### api~deleted(since) ⇒ <code>Object</code>
Configure api to request deleted content
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| since | <code>Number</code> | library version to request deletions since |

<a name="module_zotero-api-client..api..groups"></a>

#### api~groups() ⇒ <code>Object</code>
Configure api to request user-accessible groups (i.e. The set of groups
the current API key has access to, including public groups the key owner
belongs to even if the key doesn't have explicit permissions for them.)
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..version"></a>

#### api~version(version) ⇒ <code>Object</code>
Configure api to specify a local version of a given entity.
When used in conjunction with the get() exec function, it will populate the
If-Modified-Since-Version header.
When used in conjunction with post(), put(), patch() or delete(), it will
populate the If-Unmodified-Since-Version header.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| version | <code>Number</code> | local version of the entity |

<a name="module_zotero-api-client..api..apiVersion"></a>

#### api~apiVersion(apiVersion) ⇒ <code>Object</code>
Configure api to request a specific version of the Zotero API, populating
the Zotero-API-Version header.
This is optional: the API defaults to version 3 when no version is
requested. Pinning a version insulates a client against a future,
backwards-incompatible API version becoming the default.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| apiVersion | <code>Number</code> | Zotero API version to request, e.g. 3 |

<a name="module_zotero-api-client..api..serverID"></a>

#### api~serverID(serverID) ⇒ <code>Object</code>
Configure api to send the "Zotero-Server-ID" header with the request.
Only used with the local API: every local API response identifies the Zotero
instance that produced it in a "Zotero-Server-ID" header (see [getServerID](#module_zotero-api-client..ApiResponse+getServerID)) and write requests
must echo that value back to confirm they're reaching the same instance.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| serverID | <code>String</code> | Server ID previously obtained from a local API response |

<a name="module_zotero-api-client..api..attachment"></a>

#### api~attachment([fileName], [file], [mtime], [md5sum], [patch], [algorithm], [zipFilename]) ⇒ <code>Object</code>
Configure api to upload or download an attachment file.
Can be only used in conjunction with items() and post()/get()/patch().
Method patch() can only be used to upload a binary patch, in this case the last two arguments
must be provided.
Method post() is used for full uploads. If `md5sum` is provided, it will update an existing
file, otherwise it uploads a new file. The last two arguments are not used in this scenario.
Method get() is used for downloads, in this case skip all arguments.
Use items() to select the attachment item for which the file is uploaded/downloaded.
Will populate format on download as well as Content-Type, If*Match headers in case of upload.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| [fileName] | <code>String</code> | For upload: name of the file, should match values in attachment item entry |
| [file] | <code>ArrayBuffer</code> | New file to be uploaded |
| [mtime] | <code>Number</code> | New file's mtime, leave empty to assume current date/time |
| [md5sum] | <code>String</code> | MD5 hash of an existing file, required for uploads that update existing file |
| [patch] | <code>ArrayBuffer</code> | Binary patch, to be applied to the old file, to produce a new file |
| [algorithm] | <code>String</code> | Algorithm used to compute a diff: xdelta, vcdiff or bsdiff |
| [zipFilename] | <code>String</code> | Filename of the zip wrapper on S3 (typically `<itemKey>.zip`) for zip-stored attachments (e.g. HTML snapshots). When provided, `file` is interpreted as the wrapper bytes; the wrapper MD5 is computed and sent as `zipMD5`, while the existing `md5sum` value populates the body's inner `md5` field (preserving `attachmentStorageHash`). Requires `md5sum`; incompatible with `patch`/`algorithm`. |

<a name="module_zotero-api-client..api..registerAttachment"></a>

#### api~registerAttachment(fileName, fileSize, mtime, md5sum, [zipMD5], [zipFilename]) ⇒ <code>Object</code>
Advanced function that will attempt to register an existing file with a given attachment item
based on known file metadata. Can also be used to rename an existing file.
Can be only used in conjunction with items() and post().
Use items() to select the attachment item for which a file is registered.
Will populate Content-Type, If-Match headers.
Will fail with a ErrorResponse if API does not return "exists".

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| fileName | <code>String</code> | name of the file, should match value in the item, unless renaming |
| fileSize | <code>Number</code> | size of the existing file |
| mtime | <code>Number</code> | mtime of the existing file |
| md5sum | <code>String</code> | md5sum of the existing file |
| [zipMD5] | <code>String</code> | MD5 hash of the existing zip wrapper on S3 (for zip-stored attachments such as HTML snapshots). Required together with `zipFilename` when re-registering a zip-stored attachment so the server can look up the wrapper on S3 and link it to the new item without re-uploading. |
| [zipFilename] | <code>String</code> | Filename of the existing zip wrapper on S3 (typically `<itemKey>.zip`). Required together with `zipMD5`. |

<a name="module_zotero-api-client..api..attachmentUrl"></a>

#### api~attachmentUrl() ⇒ <code>Object</code>
Configure api to request a temporary attachment file url
Can be only used in conjunction with items() and get()
Use items() to select the attachment item for which file url is requested
Will populate format, redirect.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..verifyKeyAccess"></a>

#### api~verifyKeyAccess() ⇒ <code>Object</code>
Configure api to request information on the API key.
Can only be used in conjunction with get()

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..local"></a>

#### api~local() ⇒ <code>Object</code>
Configure api to use endpoints that only exist in the local API.
Can only be used in conjunction with authorize() and post().

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  
<a name="module_zotero-api-client..api..authorize"></a>

#### api~authorize(appName) ⇒ <code>Object</code>
Configure api to request a key that authorizes write requests to the local API.
Can only be used in conjunction with local() and post(), where post() should be
called without arguments. Zotero prompts the user to allow or deny access for
the given application name. Note that the local API requires the
"Zotero-Server-ID" header on this request (see serverID()).

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Chainable**  
**Returns**: <code>Object</code> - Partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| appName | <code>String</code> | Name of the calling application, displayed to the                            user in the authorization prompt |

<a name="module_zotero-api-client..api..get"></a>

#### api~get(opts) ⇒ <code>Promise</code>
Execution function. Specifies that the request should use a GET method.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Promise</code> - A promise that will eventually return either an
                  ApiResponse, SingleReadResponse or MultiReadResponse.
                  Might throw Error or ErrorResponse.  

| Param | Type | Description |
| --- | --- | --- |
| opts | <code>Object</code> | Optional api configuration. If duplicate,                         overrides properties already present. For a list                         of all possible properties, see documentation                         for request() function |

<a name="module_zotero-api-client..api..post"></a>

#### api~post(data, opts) ⇒ <code>Promise</code>
Execution function. Specifies that the request should use a POST method.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Promise</code> - A promise that will eventually return MultiWriteResponse.
                  Might throw Error or ErrorResponse  

| Param | Type | Description |
| --- | --- | --- |
| data | <code>Array</code> | An array of entities to post |
| opts | <code>Object</code> | Optional api configuration. If duplicate,                         overrides properties already present. For a list                         of all possible properties, see documentation                         for request() function |

<a name="module_zotero-api-client..api..put"></a>

#### api~put(data, opts) ⇒ <code>Promise</code>
Execution function. Specifies that the request should use a PUT method.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Promise</code> - A promise that will eventually return SingleWriteResponse.
                  Might throw Error or ErrorResponse  

| Param | Type | Description |
| --- | --- | --- |
| data | <code>Object</code> | An entity to put |
| opts | <code>Object</code> | Optional api configuration. If duplicate,                         overrides properties already present. For a list                         of all possible properties, see documentation                         for request() function |

<a name="module_zotero-api-client..api..patch"></a>

#### api~patch(data, opts) ⇒ <code>Promise</code>
Execution function. Specifies that the request should use a PATCH
method.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Promise</code> - A promise that will eventually return SingleWriteResponse.
                  Might throw Error or ErrorResponse  

| Param | Type | Description |
| --- | --- | --- |
| data | <code>Object</code> | Partial entity data to patch |
| opts | <code>Object</code> | Optional api configuration. If duplicate,                         overrides properties already present. For a list                         of all possible properties, see documentation                         for request() function |

<a name="module_zotero-api-client..api..del"></a>

#### api~del(keysToDelete, opts) ⇒ <code>Promise</code>
Execution function. Specifies that the request should use a DELETE
method.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Promise</code> - A promise that will eventually return DeleteResponse.
                  Might throw Error or ErrorResponse  

| Param | Type | Description |
| --- | --- | --- |
| keysToDelete | <code>Array</code> | An array of keys to delete. Depending on                                how api has been configured, these will                                be item keys, collection keys, search                                keys or tag names. If not present, api                                should be configured to use specific                                item, collection, saved search or settings                                key, in which case, that entity will be deleted.                                Tag names are joined into a single ' || '-separated                                query parameter, hence a tag name that contains                                ' || ' cannot be deleted (see zotero/dataserver#118) |
| opts | <code>Object</code> | Optional api configuration. If duplicate,                         overrides properties already present. For a list                         of all possible properties, see documentation                         for request() function |

<a name="module_zotero-api-client..api..getConfig"></a>

#### api~getConfig() ⇒ <code>Object</code>
Execution function. Returns current config without doing any requests.
Usually used in advanced scenarios where config needs to be tweaked
manually before submitted to the request method or as a debugging tool.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Object</code> - current config  
<a name="module_zotero-api-client..api..pretend"></a>

#### api~pretend(verb, data, opts) ⇒ <code>Promise</code>
Execution function. Prepares the request but does not execute fetch(),
instead returning a "pretended" response where details for the actual
fetch that would have been used are included.
Usually used in advanced scenarios where config needs to be tweaked
manually before it is submitted to the request method or as a debugging tool.

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Promise</code> - A promise that will eventually return PretendResponse.
                  Might throw Error or ErrorResponse  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| verb | <code>String</code> | <code>get</code> | Defines which execution function is used to prepare                         the request. Should be one of 'get', 'post', 'patch'                         'put', 'delete'. Defaults to 'get'. |
| data | <code>Object</code> |  | This argument is passed over to the actual execution                         function. For 'get' it is ignored, for 'post', 'patch'                         and 'put' see 'data' of that execution function, for                         'delete' see 'keysToDelete' |
| opts | <code>Object</code> |  | Optional api configuration. If duplicate,                         overrides properties already present. For a list                         of all possible properties, see documentation                         for request() function |

<a name="module_zotero-api-client..api..use"></a>

#### api~use(extend) ⇒ <code>Object</code>
Used for extending capabilities of the library by installing plugins.
In most cases plugins inject additional executors or bind api to an
alternative/extended set of functions

**Kind**: inner method of [<code>api</code>](#module_zotero-api-client..api)  
**Returns**: <code>Object</code> - Extended/partially configured api functions  

| Param | Type | Description |
| --- | --- | --- |
| extend | <code>function</code> | function that installs alternative                              or additional functionality of the api.                              It should return bound api functions,                              usually by calling arguments[0].ef() |

<a name="module_zotero-api-client..request"></a>

### zotero-api-client~request(config) ⇒ <code>Promise</code>
Executes request and returns a response. Not meant to be called directly, instead use [api](#module_zotero-api-client..api).

**Kind**: inner method of [<code>zotero-api-client</code>](#module_zotero-api-client)  
**Returns**: <code>Promise</code> - Returns a Promise that will eventually return a response object  
**Throws**:

- <code>Error</code> If options specify impossible configuration
- <code>ErrorResponse</code> If API responds with a non-ok response


| Param | Type | Description |
| --- | --- | --- |
| config | <code>Object</code> | Configuration object |
| config.apiScheme | <code>String</code> | Scheme part of the API URL |
| config.apiAuthorityPart | <code>String</code> | Authority part of the API URL |
| config.apiPath | <code>String</code> | Path part of the API URL |
| config.authorization | <code>String</code> | 'Authorization' header |
| config.zoteroApiVersion | <code>Number</code> | 'Zotero-API-Version' header. Optional. |
| config.zoteroServerID | <code>String</code> | 'Zotero-Server-ID' header. Used with the local API only |
| config.zoteroAllowedRequest | <code>String</code> | 'Zotero-Allowed-Request' header. Used with the local API only; Zotero's local server drops requests that carry a browser-like user agent (or an Origin header) unless this header is present |
| config.zoteroWriteToken | <code>String</code> | 'Zotero-Write-Token' header |
| config.ifModifiedSinceVersion | <code>String</code> | 'If-Modified-Since-Version' header |
| config.ifUnmodifiedSinceVersion | <code>String</code> | 'If-Unmodified-Since-Version' header |
| config.contentType | <code>String</code> | 'Content-Type' header |
| config.collectionKey | <code>String</code> | 'collectionKey' query argument |
| config.content | <code>String</code> | 'content' query argument |
| config.direction | <code>String</code> | 'direction' query argument |
| config.format | <code>String</code> | 'format' query argument |
| config.include | <code>String</code> | 'include' query argument |
| config.includeTrashed | <code>String</code> | 'includeTrashed' query argument |
| config.itemKey | <code>String</code> | 'itemKey' query argument |
| config.itemQ | <code>String</code> | 'itemQ' query argument |
| config.itemQMode | <code>String</code> | 'itemQMode' query argument |
| config.itemTag | <code>String</code> \| <code>Array.&lt;String&gt;</code> | 'itemTag' query argument |
| config.itemType | <code>String</code> | 'itemType' query argument |
| config.limit | <code>Number</code> | 'limit' query argument |
| config.linkMode | <code>String</code> | 'linkMode' query argument |
| config.linkwrap | <code>String</code> | 'linkwrap' query argument |
| config.locale | <code>String</code> | 'locale' query argument |
| config.q | <code>String</code> | 'q' query argument |
| config.qmode | <code>String</code> | 'qmode' query argument |
| config.searchKey | <code>String</code> | 'searchKey' query argument |
| config.since | <code>Number</code> | 'since' query argument |
| config.sort | <code>String</code> | 'sort' query argument |
| config.start | <code>Number</code> | 'start' query argument |
| config.style | <code>String</code> | 'style' query argument |
| config.tag | <code>String</code> \| <code>Array.&lt;String&gt;</code> | 'tag' query argument |
| config.pretend | <code>Boolean</code> | triggers pretend mode where fetch request is prepared and returned without execution |
| config.resource.top | <code>String</code> | use 'top' resource |
| config.resource.trash | <code>String</code> | use 'trash' resource |
| config.resource.children | <code>String</code> | use 'children' resource |
| config.resource.groups | <code>String</code> | use 'groups' resource |
| config.resource.itemTypes | <code>String</code> | use 'itemTypes' resource |
| config.resource.itemFields | <code>String</code> | use 'itemFields' resource |
| config.resource.creatorFields | <code>String</code> | use 'creatorFields' resource |
| config.resource.itemTypeFields | <code>String</code> | use 'itemTypeFields' resource |
| config.resource.itemTypeCreatorTypes | <code>String</code> | use 'itemTypeCreatorTypes' resource |
| config.resource.library | <code>String</code> | use 'library' resource |
| config.resource.collections | <code>String</code> | use 'collections' resource |
| config.resource.items | <code>String</code> | use 'items' resource |
| config.resource.searches | <code>String</code> | use 'searches' resource |
| config.resource.tags | <code>String</code> | use 'tags' resource |
| config.resource.template | <code>String</code> | use 'template' resource |
| config.resource.local | <code>String</code> | use 'local' resource. Local API only |
| config.resource.authorize | <code>String</code> | use 'authorize' resource. Local API only |
| config.resource.fulltext | <code>String</code> | use 'fulltext' resource |
| config.method | <code>String</code> | forwarded to fetch() |
| config.body | <code>String</code> | forwarded to fetch() |
| config.appName | <code>String</code> | name of the calling application, used to construct the body of a local API authorization request. Local API only. Incompatible with "body" |
| config.mode | <code>String</code> | forwarded to fetch() |
| config.cache | <code>String</code> | forwarded to fetch() |
| config.credentials | <code>String</code> | forwarded to fetch() |
| config.uploadRegisterOnly | <code>Boolean</code> | this file upload should only perform stage 1 |
| config.retry | <code>Number</code> | retry this many times after transient error |
| config.retryDelay | <code>Number</code> | wait this many seconds before retry. If not set an exponential backoff algorithm will be used |

---
_Source: https://npm.io/package/zotero-api-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
