---
title: "Upload a library document"
method: POST
path: "/api/v1/businesses/library/documents"
tags: ["business-library"]
---

# Upload a library document

`POST /api/v1/businesses/library/documents`

## Request

- Base URL: `https://api.izap.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.izap.ai/api/v1/businesses/library/documents`
- Auth: HTTP bearer

Uploads a document or video to the library of the authenticated user's business so it can later be attached to messages. PDF, DOCX and MP4 are accepted; the type is read from the file's content, not its name.

## Headers

- `business-id` string, nullable, required: Business UUID whose library is targeted. Required when the user has more than one business.

## Response `201`

Successful Response

- BusinessLibraryImageOut: Metadata for an image stored in the business library. Backed by the :class:`aizap.models.documents.Document` model, filtered to image document types.
  - `id` string, uuid, required
  - `business_id` string, uuid, nullable, required
  - `filename` string, required
  - `original_filename` string, required
  - `content_type` string, required
  - `document_type` string, required
  - `file_size` integer, required
  - `url` string, required
  - `title` string, nullable
  - `description` string, nullable
  - `tags` string[], nullable
  - `uploaded_by_user_id` string, uuid, nullable
  - `created` string, date-time, required

## Other responses

- `401`: Missing or invalid credentials.
- `403`: The credential is valid but not authorized for this action.
- `404`: The resource, or the business named in the request, does not exist.
- `422`: Validation Error
- `default`: Unexpected error.

---

[API](https://skmtc.dev/izap/apis/izap-api.md) · [All operations](https://skmtc.dev/izap/apis/izap-api/llms.txt) · [OpenAPI document](https://skmtc.dev/izap/apis/izap-api/revisions/e6358c8bf5e9?raw)
