> ## Documentation Index
> Fetch the complete documentation index at: https://docs.narrative.video/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Index

> Create a new search index for video clips

## POST /api/v1/search/indexes

Create a new search index for organizing and searching video clips. Indexes allow you to group related videos and search across them with natural language queries.

### Parameters

| Parameter   | Type   | Required | Description                       |
| ----------- | ------ | -------- | --------------------------------- |
| name        | string | Yes      | Name for the search index         |
| description | string | No       | Optional description of the index |

### Response

| Field       | Description                                 |
| ----------- | ------------------------------------------- |
| index\_id   | Unique identifier for the index             |
| name        | Name of the index                           |
| created\_at | ISO timestamp of when the index was created |

### Example Request

```bash theme={null}
curl -X POST https://api.usenarrative.ai/api/v1/search/indexes \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sports Highlights Q4 2024",
    "description": "Collection of NFL game highlights from Q4 2024"
  }'
```

### Example Response

```json theme={null}
{
  "index_id": "idx_abc123xyz",
  "name": "Sports Highlights Q4 2024",
  "created_at": "2024-01-15T10:30:00Z"
}
```

### Notes

* Index names should be descriptive for easy organization
* Use the returned `index_id` for uploading files and searching
* There is no limit to the number of indexes you can create


## OpenAPI

````yaml POST /api/v1/search/indexes
openapi: 3.0.3
info:
  title: Search API
  description: Video clip indexing and natural language search API
  version: 1.0.0
servers:
  - url: https://api.usenarrative.ai
    description: Production
security: []
paths:
  /api/v1/search/indexes:
    post:
      tags:
        - Indexes
      summary: Create Index
      description: Create a new search index for organizing and searching video clips.
      operationId: createIndex
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIndexRequest'
      responses:
        '200':
          description: Index created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateIndexResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreateIndexRequest:
      type: object
      properties:
        name:
          type: string
          description: Name for the search index
          example: Sports Highlights Q4 2024
        description:
          type: string
          description: Optional description of the index
          example: Collection of NFL game highlights from Q4 2024
      required:
        - name
    CreateIndexResponse:
      type: object
      properties:
        index_id:
          type: string
          description: Unique identifier for the index
          example: idx_abc123xyz
        name:
          type: string
          description: Name of the index
          example: Sports Highlights Q4 2024
        created_at:
          type: string
          format: date-time
          description: ISO timestamp of when the index was created
          example: '2024-01-15T10:30:00Z'
      required:
        - index_id
        - name
        - created_at
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Error message
          example: Invalid request parameters

````