---
title: "Write directory listings"
method: POST
path: "/operations/index"
tags: ["operations"]
---

# Write directory listings

`POST /operations/index`

## Request

- Base URL: `http://localhost:5572`
- URL: `http://localhost:5572/operations/index`
- Auth: one of:
  - HTTP basic
  - none
- TypeScript: <https://skmtc.dev/rclone/apis/rclone-rc-api/docs/operations/index/post.ts> (a function with typed inputs; its response is checked against the schema)

Writes a listing file, such as `index.html`, into every directory of a remote, so that it can be browsed when served as a static website. Listings that haven't changed are left alone.

## Headers

- `Prefer` 'respond-async'

## Request body

- object
  - `_config` object: Config overrides for this call only.
  - `_filter` object: Filter overrides for this call only.
  - `_group` string: Stats group for this call.
  - `fs` union, required: Remote name or path to write listings into, for example `drive:`.
    - string
    - RemoteDefinition: A remote defined inline. Needs `type` or `_name`. Other keys are backend options and must be strings.
      - `type` string: Backend type, such as `s3`.
      - `_name` string: Name of a configured remote.
      - `_root` string: Root path within the remote.
  - `opt` object: Options that control the indexing.
    - `output` string[]: Listings to write in each directory, each as `NAME=FORMAT`. The built-in formats are `html`, `json` and `caddy`. Defaults to `["index.html=html"]`.
    - `rules` object: Filter rules that choose which directories get listings, for example `{"ExcludeRule": ["/private/**"]}`.
      - `FilterRule` string[]
      - `FilterFrom` string[]
      - `ExcludeRule` string[]
      - `ExcludeFrom` string[]
      - `IncludeRule` string[]
      - `IncludeFrom` string[]
    - `maxDepth` integer: Only make listings this many directories deep. Defaults to -1, which means no limit.
    - `linkIndex` boolean: Set to true to link to `dir/NAME` rather than `dir/`.
    - `dirTime` 'newest' | 'dir' | 'none': How to work out the time shown for a directory. `newest` uses the newest modification time of anything below the directory, and `dir` uses the directory's own modification time. Defaults to `newest`.
    - `noModTime` boolean: Set to true to leave modification times out of the listings.
    - `rewrite` boolean: Set to true to write every listing, even if it is unchanged.
    - `changed` string[]: Changed paths for a partial run, which only re-indexes the directories they affect. Directories end in `/`.
    - `changedFrom` string[]: Files that list changed paths for a partial run, one path per line.
    - `changedCombined` string[]: Files in the format of the `combined` sync report, used as the changed paths for a partial run.
    - `changedMaxDirs` integer: Do a full run if a partial run would list more directories than this. Defaults to 0, which means no limit.

## Response `200`

Request succeeded returning an empty JSON object.

- object

## Other responses

- `202`: The call is running in the background, because the request sent `Prefer: respond-async`. Poll `job/status` with the job ID. A job can be queried for up to 1 minute after it finishes.
- `401`: Missing or wrong credentials. The auth layer sends this as plain text, before rclone's JSON errors apply.
- `4XX`: Any error response (HTTP 4xx/5xx)
- `5XX`: Any error response (HTTP 4xx/5xx)

## Changes

- **2026-11-11** `a7af46c0c706`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rclone/apis/rclone-rc-api/changes/operations/index/post.md)

---

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