---
title: "Add a library to an assistant"
method: POST
path: "/assistants/{assistant_id}/libraries/{library_id}"
tags: ["Assistant"]
---

# Add a library to an assistant

`POST /assistants/{assistant_id}/libraries/{library_id}`

Enables a library for a assistant by creating a new association

## Path parameters

- `assistant_id` integer, required
- `library_id` integer, required

## Query parameters

- `cookie_name` string, nullable

## Response `201`

Successful Response

- AssistantLibrary
  - `created_at` string, date-time — UTC timestamp when the record was created.
  - `updated_at` string, date-time — UTC timestamp when the record was last updated.
  - `creator_user_id` integer, required — ID of the user who created the record.
  - `updater_user_id` integer, nullable — ID of the user who last updated the record, if any.
  - `assistant_id` integer, required — ID of the assistant.
  - `library_id` integer, required — ID of the library linked to the assistant.

## Other responses

- `401` — Missing or invalid authentication.
- `403` — No access to the library, or not the creator of the assistant.
- `404` — Assistant or library does not exist.
- `422` — Validation Error

---

[API](https://skmtc.net/neulandai/apis/neuland-ai-hub-api.md) · [All operations](https://skmtc.net/neulandai/apis/neuland-ai-hub-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/neulandai/neuland-ai-hub-api/revisions/b53e89b98c2b/schema)
