---
title: "Report file indexing result"
method: POST
path: "/files/encrypted/index-result"
tags: ["Files Encrypted"]
---

# Report file indexing result

`POST /files/encrypted/index-result`

## Request

- Base URL: `https://gateway.prem.io`
- URL: `https://gateway.prem.io/files/encrypted/index-result`
- Auth: API key in header `X-Enclave-Secret`

The Prem API Enclave sends file index results to this callback on the public Prem API Gateway. The callback updates the file's RAG status. The gateway checks the `X-Enclave-Secret` header before it accepts a result. To begin a file index job, use `POST /files/encrypted/index`. To read the file status, use `GET /files/encrypted/{id}`.

## Request body

- IndexResultFileEncryptedRequest: The file ID and RAG status that the Prem API Enclave sends to the callback on the public Prem API Gateway.
  - `file_id` string, required: The ID of the encrypted file
  - `rag_status` 'running' | 'stopped' | 'failure' | 'success' | 'null', nullable, required: The RAG indexing status

## Response `200`

RAG status updated successfully

- object: The response after the Prem API Gateway updates the file's RAG status.
  - `status` 200 | 201 | 202, required: Status code of the response
  - `data` object, nullable, required
    - `file_id` string, required: The ID of the encrypted file
    - `rag_status` 'running' | 'stopped' | 'failure' | 'success' | 'null', nullable, required: Updated RAG indexing status
    - `message` string, required: Status message
  - `error` string, nullable: Error message of the response, human readable
  - `message` string, nullable, required: Message of the response, human readable
  - `env` 'development' | 'production', required: API environment
  - `log` union: Useful informaiton, not always present, to debug the response
    - string
    - object
  - `validator` union: Validator response object, each key is the field name and value is the error message
    - object
    - unknown[]
      - unknown
  - `support_id` string, uuid, nullable: Support ID linked to the response, used to identify it when talking with our team.

## Other responses

- `400`: Bad request
- `401`: The callback secret is missing or invalid.
- `404`: Resource not found

## Changes

- **2026-11-13** `d46bc3931b34`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/premai-io/apis/prem-studio-api/changes/files/encrypted/index-result/post.md)

---

[API](https://skmtc.dev/premai-io/apis/prem-studio-api.md) - [All operations](https://skmtc.dev/premai-io/apis/prem-studio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/premai-io/apis/prem-studio-api/revisions/d46bc3931b34?raw)
