---
title: "Index one project file as a document"
method: POST
path: "/api/v0/desk/projects/{project_id}/index"
tags: ["Desk"]
---

# Index one project file as a document

`POST /api/v0/desk/projects/{project_id}/index`

## Request

- Base URL: `https://api.outerport.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.outerport.com/api/v0/desk/projects/{project_id}/index`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/outerport/apis/outerport-api/docs/api/v0/desk/projects/:project_id/index/post.ts> (a function with typed inputs; its response is checked against the schema)

Uploads the file as a document of the project's owner, in the organization the project is shared with, and starts its processing; a document the file was indexed as before is deleted. In a project connected to a collection, a file indexed as one of the collection's documents replaces that document's file instead (409 while the document still processes its previous file), and a new document is added to the collection, in the folder the file's directory is. Counts against the owner's page limit, whoever asks. A file already indexed at its current content, and not failed, is not sent again: its record is the answer.

## Path parameters

- `project_id` string, uuid, required

## Request body

- DeskIndexRequest
  - `path` string, required

## Response `200`

Successful Response

- DeskIndexRecord: One project file's indexing record, in the shape of ``IndexedFileRecord`` in ``op-desk/src/core/indexing.ts``. ``status`` is read off the document's job when the record is read.
  - `filePath` string, required
  - `sha256` string, required
  - `documentId` string, uuid, required
  - `jobStatusId` string
  - `status` 'processing' | 'indexed' | 'error', required
  - `errorMessage` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-26** `07854361a13b`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/outerport/apis/outerport-api/changes/api/v0/desk/projects/:project_id/index/post.md)

---

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