# List library

URL: https://docs.hanzo.ai/docs/openapi/library/get-library

> Lists what you made and what members of your organization shared with you, newest first.

`GET /v1/library`

> [Library →](https://docs.hanzo.ai/docs/openapi/library) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/library`      |
| **Method**    | `GET`                                  |
| **Operation** | `get_library`                          |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

Lists what you made and what members of your organization shared
with you, newest first. Narrow it by kind, source, ref, project, a name search
and a time range; `scope` mine keeps only yours and shared only what others
shared. Each item carries signed URLs that work for an hour.

## Request

10 fields.

| Field     | In    | Type    | Required | Description                                                                            |
| --------- | ----- | ------- | -------- | -------------------------------------------------------------------------------------- |
| `kind`    | query | string  | —        | Kind keeps one kind: image, video, audio, document, slides, type, model, code or file. |
| `source`  | query | string  | —        | Source keeps what one product made: chat, dev, studio or workflow.                     |
| `ref`     | query | string  | —        | Ref keeps what one conversation, run or Studio run made.                               |
| `project` | query | string  | —        | Project keeps one project's items.                                                     |
| `q`       | query | string  | —        | Q keeps the items whose name contains it, ignoring case.                               |
| `since`   | query | string  | —        | Since and Until bound when it was made: RFC 3339, or a date (YYYY-MM-DD).              |
| `until`   | query | string  | —        |                                                                                        |
| `scope`   | query | string  | —        | Scope is all (yours and what your org shared, the default), mine, or shared.           |
| `limit`   | query | integer | —        | Limit bounds the page: default 60, at most 200.                                        |
| `cursor`  | query | string  | —        | Cursor continues a list from the page before's `next`.                                 |

## Response

| Status    | Body             | Meaning |
| --------- | ---------------- | ------- |
| `200`     | library.itemPage | ok      |
| `default` | problem-details  | refused |

`200` body — 31 fields.

| Field                           | In   | Type                   | Always | Description                                                                                                               |
| ------------------------------- | ---- | ---------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `data`                          | body | library.LibraryItem\[] | —      | Data are the items, newest first.                                                                                         |
| `data[].by`                     | body | string                 | —      | By is the owner as a reader names them: the name, else the address, the identity boundary carried when the item was made. |
| `data[].bytes`                  | body | integer (int64)        | —      |                                                                                                                           |
| `data[].created`                | body | string                 | —      |                                                                                                                           |
| `data[].download`               | body | string                 | —      |                                                                                                                           |
| `data[].expires`                | body | string                 | —      |                                                                                                                           |
| `data[].height`                 | body | integer (int64)        | —      |                                                                                                                           |
| `data[].id`                     | body | string                 | —      |                                                                                                                           |
| `data[].kind`                   | body | string                 | —      |                                                                                                                           |
| `data[].mime`                   | body | string                 | —      |                                                                                                                           |
| `data[].mine`                   | body | boolean                | —      |                                                                                                                           |
| `data[].name`                   | body | string                 | —      |                                                                                                                           |
| `data[].origin`                 | body | string                 | —      |                                                                                                                           |
| `data[].owner`                  | body | string                 | —      |                                                                                                                           |
| `data[].pages`                  | body | integer (int64)        | —      |                                                                                                                           |
| `data[].preview`                | body | string                 | —      |                                                                                                                           |
| `data[].project`                | body | string                 | —      |                                                                                                                           |
| `data[].ref`                    | body | string                 | —      |                                                                                                                           |
| `data[].seconds`                | body | number (double)        | —      |                                                                                                                           |
| `data[].shared`                 | body | boolean                | —      |                                                                                                                           |
| `data[].source`                 | body | string                 | —      |                                                                                                                           |
| `data[].updated`                | body | string                 | —      |                                                                                                                           |
| `data[].upload`                 | body | library.LibraryUpload  | —      |                                                                                                                           |
| `data[].upload.expires`         | body | string                 | —      |                                                                                                                           |
| `data[].upload.headers`         | body | library.Field\[]       | —      | Headers are the ones the PUT must carry.                                                                                  |
| `data[].upload.headers[].name`  | body | string                 | —      | Name is the field's name.                                                                                                 |
| `data[].upload.headers[].value` | body | string                 | —      | Value is the field's value, verbatim.                                                                                     |
| `data[].upload.url`             | body | string                 | —      |                                                                                                                           |
| `data[].url`                    | body | string                 | —      |                                                                                                                           |
| `data[].width`                  | body | integer (int64)        | —      |                                                                                                                           |
| `next`                          | body | string                 | —      | Next continues the list as `cursor`; empty at its end.                                                                    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo library list
```

**SDK**

**.ts**

```ts
import { Configuration, LibraryApi } from 'hanzoai';

const api = new LibraryApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getLibrary();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import LibraryApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = LibraryApi(client).get_library()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.LibraryAPI.GetLibrary(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, library_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = library_api::get_library(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.LibraryApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new LibraryApi(client).getLibrary();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/library \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **library** through the `library` tool, which names its 6 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_libraries"
         }
       }
     }'
```

---

[Library API](https://docs.hanzo.ai/docs/openapi/library) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
