---
title: "Add a document to a project"
method: POST
path: "/api/v1/project-rooms/{id}/files"
tags: ["Projects"]
---

# Add a document to a project

`POST /api/v1/project-rooms/{id}/files`

## Request

- Base URL: `https://askthegrid.com`
- URL: `https://askthegrid.com/api/v1/project-rooms/{id}/files`
- Auth: HTTP bearer

Provide base64 content to store the file and queue reading, or omit content to prepare metadata for multipart upload; readJobId is null until original bytes arrive. A file with the name of one already in the folder becomes a replacement of its current original. Base64 content is limited to 20 MiB; multipart transport accepts up to 250 MiB. Replacement invalidates extraction. Poll `getProjectFile` until `extraction` is `ready` (or `failed`); a planning case (PSS/E RAW) is then studied at the project's POI on its own.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string, required
  - `content` string
  - `folder` string
  - `role` 'evidence' | 'estimate' | 'reference' | 'generated'
  - `mimeType` string

## Response `200`

Success

- object
  - `file` object, required
    - `documentRef` object
      - `organizationId` string, uuid, required
      - `datasetId` string, uuid, required
      - `projectId` string, required
      - `fileId` string, required
      - `warehouse` string, required
      - `schema` string, required
      - `dataset` string, required
    - `originalRevision` string, uuid
    - `originalVersion` integer
    - `sha256` string
    - `active` boolean
    - `id` string, required
    - `name` string, required
    - `folder` string, required
    - `kind` string, required
    - `role` 'evidence' | 'estimate' | 'reference' | 'generated', required
    - `sensitivity` string, required
    - `version` integer, required
    - `extraction` string, required
    - `size` number
    - `addedAt` string, required
    - `updatedAt` string, required
    - `workflow` object
      - `slug` string, required
      - `runAt` string, required
      - `citedFileIds` string[], required
  - `readJobId` string, nullable, required

## Other responses

- `400`: The request did not match the contract.
- `401`: Missing or invalid credentials.
- `429`: Rate limit exceeded. Wait `Retry-After` seconds; `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset` report the budget. Signed-in sessions and API keys have larger budgets than anonymous callers.

---

[API](https://skmtc.dev/askthegrid/apis/ask-the-grid-api.md) · [All operations](https://skmtc.dev/askthegrid/apis/ask-the-grid-api/llms.txt) · [OpenAPI document](https://skmtc.dev/askthegrid/apis/ask-the-grid-api/revisions/9cd80115e395?raw)
