---
title: "Upload text for retrieval"
method: POST
path: "/v1/projects/{project_id}/retrieval/text"
tags: ["retrieval"]
---

# Upload text for retrieval

`POST /v1/projects/{project_id}/retrieval/text`

## Request

- Base URL: `https://api.connic.co`
- URL: `https://api.connic.co/v1/projects/{project_id}/retrieval/text`
- Auth: HTTP bearer

Ingests plain text for managed semantic retrieval. The text is chunked, embedded, and indexed asynchronously; the entry appears in `GET /retrieval/entries` once indexing finishes.

Required permission: `retrieval.manage`.

## Path parameters

- `project_id` string, uuid, required

## Query parameters

- `environment_id` string, uuid, required: Environment ID from `GET /environments`.

## Request body

- RetrievalTextUploadRequest
  - `content` string, required: Text to index, up to 250,000 characters. Upload longer documents as a file or split them into several entries.
  - `namespace` string, nullable: Dot-separated namespace such as `docs.api`, up to 10 levels. Omit for the default namespace.
  - `entry_id` string, nullable: Entry identifier. Uploading again with the same ID and namespace replaces the entry. Defaults to a generated UUID.
  - `metadata` object, nullable: JSON object stored with every chunk of the entry, up to 64 KB.
  - `chunk_size` integer, nullable: Target chunk length in characters. Defaults to 1800 when omitted or 0; values below 400 are raised to 400.
  - `chunk_overlap` integer, nullable: Characters repeated between consecutive chunks. Defaults to 200, capped at half of `chunk_size`.

## Response `202`

Successful Response

- PublicRetrievalIngestionResponse
  - `job_id` string, required: ID of the ingestion job that chunks and indexes the content.
  - `status` string, required: Job status at submission, `pending`.
  - `entry_id` string, required: Entry the content is stored under. Generated when not supplied.

## Other responses

- `401`: Missing or invalid API key.
- `403`: The API key lacks the required permission or access to the environment.
- `422`: Validation Error
- `429`: Rate limit exceeded.

---

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