---
title: "Add a library to a chat"
method: POST
path: "/chats/{chat_id}/libraries/{library_id}"
tags: ["Chat"]
---

# Add a library to a chat

`POST /chats/{chat_id}/libraries/{library_id}`

Enables a library in a chat by creating a new association

## Path parameters

- `chat_id` integer, required
- `library_id` integer, required

## Query parameters

- `cookie_name` string, nullable

## Response `201`

Successful Response

- ChatLibrary
  - `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.
  - `chat_id` integer, required — ID of the chat.
  - `library_id` integer, required — ID of the library linked to the chat.

## Other responses

- `401` — Missing or invalid authentication.
- `403` — No access to the chat or the library.
- `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/versions/b53e89b98c2b/schema)
