---
title: "Add a subject to Index"
method: POST
path: "/v0/indices/{index_id}/subjects"
tags: ["目录"]
---

# Add a subject to Index

`POST /v0/indices/{index_id}/subjects`

## Request

- The document declares no server URL.
- Auth: HTTP bearer

## Path parameters

- `index_id` integer, required

## Request body

- IndexSubjectAddInfo: 新增某条目到目录的请求信息
  - `subject_id` integer
  - `sort` integer: 排序条件，越小越靠前
  - `comment` string

## Response `200`

Successful Response

## Other responses

- `400`: Unauthorized
- `401`: Bad Request
- `404`: Not Found

## Changes

- **2022-11-19** (v0) `bb6bcec42206`: 3 warning, 3 info
  - removed the optional property `detail` from the response with the `400` status
  - removed the optional property `detail` from the response with the `401` status
  - removed the optional property `detail` from the response with the `404` status
  - added the optional property `details` to the response with the `400` status
  - …2 more
- **2022-10-24** (v0) `bbacb4142fa3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bangumi/apis/bangumi-open-api/changes/v0/indices/:index_id/subjects/post.md)

---

[API](https://skmtc.dev/bangumi/apis/bangumi-open-api.md) - [All operations](https://skmtc.dev/bangumi/apis/bangumi-open-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bangumi/apis/bangumi-open-api/revisions/6aafdbda7895?raw)
