# Ingest a file into a chunked document

> Parses an already-uploaded file and creates one Document split into one or

<Heading
  as={"h1"}
  className={"openapi__heading"}
  children={"Ingest a file into a chunked document"}
>
</Heading>

<MethodEndpoint
  method={"post"}
  path={"/api/v1/documents/ingest"}
  context={"endpoint"}
>
  
</MethodEndpoint>

Parses an already-uploaded file and creates one Document split into one or
more embedded chunks. The source format is detected from the file's content
type: PDFs are parsed page-by-page; `text/plain` and `text/markdown` files
are read as a single source. How the source is chunked is controlled by
`chunk_strategy`.

A file can only back one Document — a second call with the same `file_id`
returns `409 FILE_ALREADY_INGESTED`. To re-process an already-ingested file
(e.g. with a different `chunk_strategy`), use
`POST /documents/{document_id}/ingest`; to ingest the same source under a
different path, upload a new copy of the file first.

<Heading
  id={"request"}
  as={"h2"}
  className={"openapi-tabs__heading"}
>
  <Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails
  {...require("./ingest-document.ParamsDetails.json")}
>
  
</ParamsDetails>

<RequestSchema
  {...require("./ingest-document.RequestSchema.json")}
>
  
</RequestSchema>

<StatusCodes
  {...require("./ingest-document.StatusCodes.json")}
>
  
</StatusCodes>
