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

# Create a dataset

> Create a new dataset



## OpenAPI

````yaml https://raw.githubusercontent.com/gentrace/gentrace-openapi/main/spec.json post /v4/datasets
openapi: 3.1.0
info:
  title: Gentrace API
  version: 0.1.0
  description: API documentation for Gentrace services.
  contact:
    name: Gentrace
    url: https://gentrace.ai
    email: support@gentrace.ai
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://gentrace.ai/api
    description: API Endpoint
security:
  - bearerAuth: []
externalDocs:
  url: https://github.com/gentrace/gentrace-openapi
  description: Gentrace OpenAPI Github
paths:
  /v4/datasets:
    post:
      tags:
        - Datasets
      summary: Create a dataset
      description: Create a new dataset
      operationId: createDataset
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDataset'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dataset'
        '400':
          description: >-
            Client provided an invalid request for the dataset. Please check the
            request format and parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: No valid API key provided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: The dataset resource does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Something went wrong on Gentrace's end.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    CreateDataset:
      type: object
      properties:
        name:
          type: string
          description: Dataset name
          example: Dataset - negative user feedback - 2025-04-01
        description:
          type:
            - string
            - 'null'
          description: Dataset description
          example: Negative user feedback collected from our production environment
        isGolden:
          type: boolean
          description: Whether the dataset is golden
          example: false
        pipelineSlug:
          type: string
          description: Pipeline slug (mutually exclusive with pipelineId)
          example: email-summarizer
        pipelineId:
          type: string
          format: uuid
          description: Pipeline ID (mutually exclusive with pipelineSlug)
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - name
        - description
    Dataset:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Dataset UUID
          example: 123e4567-e89b-12d3-a456-426614174000
        createdAt:
          type: string
          description: Creation timestamp (ISO 8601)
          example: '2025-04-01T00:00:00.000Z'
        updatedAt:
          type: string
          description: Last update timestamp (ISO 8601)
          example: '2025-04-01T00:00:00.000Z'
        name:
          type: string
          description: Dataset name
          example: Dataset - negative user feedback - 2025-04-01
        description:
          type:
            - string
            - 'null'
          description: Dataset description
          example: Negative user feedback collected from our production environment
        archivedAt:
          type:
            - string
            - 'null'
          description: Archive timestamp (ISO 8601)
          example: '2025-04-01T00:00:00.000Z'
        pipelineId:
          type: string
          description: Pipeline UUID
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - description
        - archivedAt
        - pipelineId
    BadRequestError:
      type: object
      properties:
        message:
          type: string
          description: A description of the validation error
          example: 'Invalid parameters: ''name'' field is required'
      required:
        - message
    UnauthorizedError:
      type: object
      properties:
        message:
          type: string
          description: Authentication error details
          example: Invalid or expired API key
      required:
        - message
    NotFoundError:
      type: object
      properties:
        message:
          type: string
          description: Resource not found details
          example: Resource with ID '123e4567-e89b-12d3-a456-426614174000' not found
      required:
        - message
    InternalServerError:
      type: object
      properties:
        message:
          type: string
          description: Internal server error details
          example: Internal server error occurred while processing the request
      required:
        - message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Enter Gentrace API key (Format: Authorization: Bearer <token>)'

````