---
title: "Index PDF file"
method: POST
path: "/api/v1/index/{index_id}/file"
tags: ["PDF File"]
---

# Index PDF file

`POST /api/v1/index/{index_id}/file`

Index PDF file (byte array) to the index with the specified apikey and index_id, and return the number of indexed docs.
- Converts PDF to a JSON document with "title", "body", "url" and "date" fields and indexes it.
- extracts title from metatag, or first line of text, or from filename
- extracts creation date from metatag, or from file creation date (Unix timestamp: the number of seconds since 1 January 1970)
- copies all ingested pdf files to "files" subdirectory in index

## Path parameters

- `index_id` integer, required

## Headers

- `apikey` string, required
- `file` string, required
- `date` string, required

## Response `200`

PDF file indexed, returns the number of indexed documents

## Other responses

- `400` — Document object invalid
- `401` — api_key missing
- `404` — API key does not exist

## Changes

- **2026-06-22** `39cce1ef7d95` — 1 info
  - api operation id `index_file_api` removed and replaced with `index_pdf_file`
- **2026-06-21** `4cfd9d95648c` — 1 info
  - api operation id `index_pdf_file` removed and replaced with `index_file_api`

[Change history](https://skmtc.dev/seekstorm/apis/seekstorm-rest-api-documentation/changes/api/v1/index/:index_id/file/post.md)

---

[API](https://skmtc.dev/seekstorm/apis/seekstorm-rest-api-documentation.md) · [All operations](https://skmtc.dev/seekstorm/apis/seekstorm-rest-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/seekstorm/seekstorm-rest-api-documentation/revisions/f7d6b04ac5a6/schema)
