---
title: "Create agent document"
method: POST
path: "/api/v1/projects/{projectUuid}/aiAgents/{agentUuid}/documents"
---

# Create agent document

`POST /api/v1/projects/{projectUuid}/aiAgents/{agentUuid}/documents`

Create a knowledge document scoped to this project and agent.

## Path parameters

- `projectUuid` string, uuid, required — Stringified UUIDv4. See [RFC 4112](https://tools.ietf.org/html/rfc4122)
- `agentUuid` string, uuid, required — Stringified UUIDv4. See [RFC 4112](https://tools.ietf.org/html/rfc4122)

## Request body

- ApiCreateAgentDocument — Body of POST /api/v1/projects/{projectUuid}/aiAgents/{agentUuid}/documents.
  - `content` string, required
  - `mimeType` string, required
  - `originalFilename` string, required
  - `name` string, required

## Response `201`

Created

- ApiAiAgentDocumentResponse
  - `results` AiAgentDocument, required
    - `updatedAt` string, date-time, required
    - `createdAt` string, date-time, required
    - `updatedByUserUuid` string, nullable, required
    - `createdByUserUuid` string, nullable, required
    - `agentAccess` string[], required
    - `storageKey` string, required
    - `summary` AiAgentDocumentStructuredSummary, required
      - `warning` string, nullable, required
      - `relevance` 'high' | 'medium' | 'low' | 'none', required
      - `useWhen` string, required
      - `relatedExploreNames` string[], required
      - `definedTerms` string[], required
      - `description` string, required
    - `alwaysIncludeInContext` boolean, required
    - `contentSizeBytes` number, double, required
    - `mimeType` string, required
    - `originalFilename` string, required
    - `name` string, required
    - `projectUuid` string, nullable, required
    - `organizationUuid` string, required
    - `uuid` string, required
  - `status` 'ok', required

## Other responses

- `default` — Error

---

[API](https://skmtc.net/lightdash/apis/lightdash-api.md) · [All operations](https://skmtc.net/lightdash/apis/lightdash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lightdash/lightdash-api/versions/40c933755c9a/schema)
