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

# Upload Benchmark File

> Upload a pre-prepared benchmark file with questions and answers.


This endpoint allows you to upload a JSON file containing benchmark questions and answers, associating it with a specific document for evaluation purposes.


**Request Body (multipart/form-data):**

- `file`: JSON file containing benchmark questions and answers (required)
- `name`: Display name for the benchmark (required)
- `document_id`: Document ID that this benchmark is based on (required)
- `description` (optional): Description of the benchmark


**File Format:**

The uploaded JSON file should contain an array of question objects. Each question should have:

```json
[
  {
    "question_num": 1,
    "question": "What is...",
    "answer": "The answer is..."
  }
]
```


**Returns:**

- `id`: Unique identifier for the uploaded benchmark
- `name`: Name of the benchmark
- `status`: Upload status (`PROCESSING`, `READY`, `FAILED`)
- `questions`: List of benchmark question objects, each containing:
  - `question_num`: Question number
  - `question`: Question text
  - `answer`: Expected answer text
- `num_questions`: Total number of questions in the benchmark


**Raises:**

- `400`: If file format is invalid, JSON structure is incorrect, or document_id is not found
- `413`: If file size exceeds limit


**Example Request:**

```
POST /api/v3/benchmark/upload
Headers: {"Authorization": "Bearer <api_key>"}
Content-Type: multipart/form-data

Form Data:
  file: benchmark_questions.json
  name: "Customer Support Q&A"
  document_id: "doc-abc123"
  description: "Benchmark for customer support documentation"
```


**Example Response:**

```json
{
  "id": "benchmark-xyz789",
  "name": "Customer Support Q&A",
  "status": "READY",
  "questions": [
    {
      "question_num": 1,
      "question": "How do I reset my password?",
      "answer": "You can reset your password by clicking the 'Forgot Password' link on the login page."
    },
    {
      "question_num": 2,
      "question": "What are the system requirements?",
      "answer": "The system requires a modern web browser with JavaScript enabled."
    }
  ],
  "num_questions": 2
}
```


**Notes:**

- File must be in valid JSON format with proper question structure
- Each question must include `question_num`, `question`, and `answer` fields
- The benchmark is immediately available for use in evaluations after upload
- The `document_id` provided in the request is stored internally and will appear as a single-element `documents` array (e.g., `["doc-abc123"]`) when retrieving the benchmark via `/benchmark/list` or `/benchmark/{id}/data` endpoints



## OpenAPI

````yaml https://api.nugen.in/openapi-public.json post /api/v3/benchmark/upload
openapi: 3.1.0
info:
  title: Nugen Intelligence API
  description: 'Nugen Intelligence : Powering Specialized Intelligence At Scale'
  version: 25.4.20
servers: []
security: []
paths:
  /api/v3/benchmark/upload:
    post:
      tags:
        - Benchmark
      summary: Upload Benchmark File
      description: >-
        Upload a pre-prepared benchmark file with questions and answers.



        This endpoint allows you to upload a JSON file containing benchmark
        questions and answers, associating it with a specific document for
        evaluation purposes.



        **Request Body (multipart/form-data):**


        - `file`: JSON file containing benchmark questions and answers
        (required)

        - `name`: Display name for the benchmark (required)

        - `document_id`: Document ID that this benchmark is based on (required)

        - `description` (optional): Description of the benchmark



        **File Format:**


        The uploaded JSON file should contain an array of question objects. Each
        question should have:


        ```json

        [
          {
            "question_num": 1,
            "question": "What is...",
            "answer": "The answer is..."
          }
        ]

        ```



        **Returns:**


        - `id`: Unique identifier for the uploaded benchmark

        - `name`: Name of the benchmark

        - `status`: Upload status (`PROCESSING`, `READY`, `FAILED`)

        - `questions`: List of benchmark question objects, each containing:
          - `question_num`: Question number
          - `question`: Question text
          - `answer`: Expected answer text
        - `num_questions`: Total number of questions in the benchmark



        **Raises:**


        - `400`: If file format is invalid, JSON structure is incorrect, or
        document_id is not found

        - `413`: If file size exceeds limit



        **Example Request:**


        ```

        POST /api/v3/benchmark/upload

        Headers: {"Authorization": "Bearer <api_key>"}

        Content-Type: multipart/form-data


        Form Data:
          file: benchmark_questions.json
          name: "Customer Support Q&A"
          document_id: "doc-abc123"
          description: "Benchmark for customer support documentation"
        ```



        **Example Response:**


        ```json

        {
          "id": "benchmark-xyz789",
          "name": "Customer Support Q&A",
          "status": "READY",
          "questions": [
            {
              "question_num": 1,
              "question": "How do I reset my password?",
              "answer": "You can reset your password by clicking the 'Forgot Password' link on the login page."
            },
            {
              "question_num": 2,
              "question": "What are the system requirements?",
              "answer": "The system requires a modern web browser with JavaScript enabled."
            }
          ],
          "num_questions": 2
        }

        ```



        **Notes:**


        - File must be in valid JSON format with proper question structure

        - Each question must include `question_num`, `question`, and `answer`
        fields

        - The benchmark is immediately available for use in evaluations after
        upload

        - The `document_id` provided in the request is stored internally and
        will appear as a single-element `documents` array (e.g.,
        `["doc-abc123"]`) when retrieving the benchmark via `/benchmark/list` or
        `/benchmark/{id}/data` endpoints
      operationId: upload_benchmark_file
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_benchmark_file'
        required: true
      responses:
        '200':
          description: >-
            Returns the details of the uploaded benchmark including its unique
            identifier, name, status, and the list of questions with expected
            answers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadBenchmarkResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Body_upload_benchmark_file:
      properties:
        file:
          type: string
          format: binary
          title: File
          description: JSON file containing benchmark questions
        name:
          type: string
          title: Name
          description: Benchmark name
        document_id:
          type: string
          title: Document Id
          description: Document ID that this benchmark is based on
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Benchmark description
      type: object
      required:
        - file
        - name
        - document_id
      title: Body_upload_benchmark_file
    UploadBenchmarkResponse:
      properties:
        benchmark_id:
          type: string
          title: Benchmark Id
          description: Unique identifier for the benchmark
          example: benchmark-abc123
        benchmark_name:
          type: string
          title: Benchmark Name
          description: Name of the benchmark
          example: My Benchmark
        status:
          $ref: '#/components/schemas/TaskStatus'
          description: Status of the benchmark
          example: PROCESSING
        questions:
          items:
            $ref: '#/components/schemas/BenchmarkQuestion'
          type: array
          title: Questions
          description: List of uploaded benchmark questions
        num_questions:
          type: integer
          title: Num Questions
          description: Number of questions in the benchmark
          example: 10
      type: object
      required:
        - benchmark_id
        - benchmark_name
        - status
        - num_questions
      title: UploadBenchmarkResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - PROCESSING
        - READY
        - FAILED
        - DEPLOYING
        - EVALUATING
        - UNDEPLOYED
        - EVALUATED
        - STOPPED
      title: TaskStatus
    BenchmarkQuestion:
      properties:
        question_num:
          type: integer
          title: Question Num
          description: Question number
        question:
          type: string
          title: Question
          description: Question text
        answer:
          type: string
          title: Answer
          description: Answer text
      type: object
      required:
        - question_num
        - question
        - answer
      title: BenchmarkQuestion
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````