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

# Create a question

> Create a new question owned by the caller's account.

The question is one of six types selected by the required ``question_type``
discriminator (categorical, rating, number, free_text, form, or timestamp),
and each type carries its own ``configuration`` block; ``name`` and ``prompt``
are required for every type. Questions are the reusable units that are grouped
into question sets and referenced by rubrics, so create them before assembling
a question set. The created question is scoped to the caller's account and
records the creating identity. The question type and its configuration are set
at creation time and cannot be changed afterward through the update endpoint.



## OpenAPI

````yaml https://api.sgp.scale.com/openapi-versions/v5/openapi.json post /v5/questions
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/questions:
    post:
      tags:
        - Questions
      summary: Create a question
      description: >-
        Create a new question owned by the caller's account.


        The question is one of six types selected by the required
        ``question_type``

        discriminator (categorical, rating, number, free_text, form, or
        timestamp),

        and each type carries its own ``configuration`` block; ``name`` and
        ``prompt``

        are required for every type. Questions are the reusable units that are
        grouped

        into question sets and referenced by rubrics, so create them before
        assembling

        a question set. The created question is scoped to the caller's account
        and

        records the creating identity. The question type and its configuration
        are set

        at creation time and cannot be changed afterward through the update
        endpoint.
      operationId: POST-V5-/v5/questions
      parameters:
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QuestionCreateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Question'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    QuestionCreateRequest:
      oneOf:
        - $ref: '#/components/schemas/CategoricalQuestionRequest'
        - $ref: '#/components/schemas/RatingQuestionRequest'
        - $ref: '#/components/schemas/NumberQuestionRequest'
        - $ref: '#/components/schemas/FreeTextQuestionRequest'
        - $ref: '#/components/schemas/FormQuestionRequest'
        - $ref: '#/components/schemas/TimestampQuestionRequest'
      title: QuestionCreateRequest
      discriminator:
        propertyName: question_type
        mapping:
          categorical:
            $ref: '#/components/schemas/CategoricalQuestionRequest'
          form:
            $ref: '#/components/schemas/FormQuestionRequest'
          free_text:
            $ref: '#/components/schemas/FreeTextQuestionRequest'
          number:
            $ref: '#/components/schemas/NumberQuestionRequest'
          rating:
            $ref: '#/components/schemas/RatingQuestionRequest'
          timestamp:
            $ref: '#/components/schemas/TimestampQuestionRequest'
    Question:
      oneOf:
        - $ref: '#/components/schemas/CategoricalQuestion'
        - $ref: '#/components/schemas/RatingQuestion'
        - $ref: '#/components/schemas/NumberQuestion'
        - $ref: '#/components/schemas/FreeTextQuestion'
        - $ref: '#/components/schemas/FormQuestion'
        - $ref: '#/components/schemas/TimestampQuestion'
      title: Question
      discriminator:
        propertyName: question_type
        mapping:
          categorical:
            $ref: '#/components/schemas/CategoricalQuestion'
          form:
            $ref: '#/components/schemas/FormQuestion'
          free_text:
            $ref: '#/components/schemas/FreeTextQuestion'
          number:
            $ref: '#/components/schemas/NumberQuestion'
          rating:
            $ref: '#/components/schemas/RatingQuestion'
          timestamp:
            $ref: '#/components/schemas/TimestampQuestion'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CategoricalQuestionRequest:
      properties:
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        question_type:
          type: string
          const: categorical
          title: Question Type
          default: categorical
        configuration:
          $ref: '#/components/schemas/CategoricalQuestionConfiguration'
      type: object
      required:
        - name
        - prompt
        - configuration
      title: CategoricalQuestionRequest
    RatingQuestionRequest:
      properties:
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        question_type:
          type: string
          const: rating
          title: Question Type
          default: rating
        configuration:
          $ref: '#/components/schemas/RatingQuestionConfiguration'
      type: object
      required:
        - name
        - prompt
        - configuration
      title: RatingQuestionRequest
    NumberQuestionRequest:
      properties:
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        question_type:
          type: string
          const: number
          title: Question Type
          default: number
        configuration:
          $ref: '#/components/schemas/NumberQuestionConfiguration'
      type: object
      required:
        - name
        - prompt
      title: NumberQuestionRequest
    FreeTextQuestionRequest:
      properties:
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        question_type:
          type: string
          const: free_text
          title: Question Type
          default: free_text
        configuration:
          $ref: '#/components/schemas/FreeTextQuestionConfiguration'
      type: object
      required:
        - name
        - prompt
      title: FreeTextQuestionRequest
    FormQuestionRequest:
      properties:
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        question_type:
          type: string
          const: form
          title: Question Type
          default: form
        configuration:
          $ref: '#/components/schemas/FormQuestionConfiguration'
      type: object
      required:
        - name
        - prompt
        - configuration
      title: FormQuestionRequest
    TimestampQuestionRequest:
      properties:
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        question_type:
          type: string
          const: timestamp
          title: Question Type
          default: timestamp
        configuration:
          $ref: '#/components/schemas/TimestampQuestionConfiguration'
      type: object
      required:
        - name
        - prompt
      title: TimestampQuestionRequest
    CategoricalQuestion:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the entity
        object:
          type: string
          const: question
          title: Object
          default: question
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-timestamp when the entity was created
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        archived_at:
          title: Archived At
          description: ISO-timestamp when the entity was archived
          type: string
          format: date-time
        question_type:
          type: string
          const: categorical
          title: Question Type
          default: categorical
        configuration:
          $ref: '#/components/schemas/CategoricalQuestionConfiguration'
      type: object
      required:
        - created_by
        - id
        - created_at
        - name
        - prompt
        - configuration
    RatingQuestion:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the entity
        object:
          type: string
          const: question
          title: Object
          default: question
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-timestamp when the entity was created
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        archived_at:
          title: Archived At
          description: ISO-timestamp when the entity was archived
          type: string
          format: date-time
        question_type:
          type: string
          const: rating
          title: Question Type
          default: rating
        configuration:
          $ref: '#/components/schemas/RatingQuestionConfiguration'
      type: object
      required:
        - created_by
        - id
        - created_at
        - name
        - prompt
        - configuration
    NumberQuestion:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the entity
        object:
          type: string
          const: question
          title: Object
          default: question
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-timestamp when the entity was created
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        archived_at:
          title: Archived At
          description: ISO-timestamp when the entity was archived
          type: string
          format: date-time
        question_type:
          type: string
          const: number
          title: Question Type
          default: number
        configuration:
          $ref: '#/components/schemas/NumberQuestionConfiguration'
      type: object
      required:
        - created_by
        - id
        - created_at
        - name
        - prompt
    FreeTextQuestion:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the entity
        object:
          type: string
          const: question
          title: Object
          default: question
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-timestamp when the entity was created
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        archived_at:
          title: Archived At
          description: ISO-timestamp when the entity was archived
          type: string
          format: date-time
        question_type:
          type: string
          const: free_text
          title: Question Type
          default: free_text
        configuration:
          $ref: '#/components/schemas/FreeTextQuestionConfiguration'
      type: object
      required:
        - created_by
        - id
        - created_at
        - name
        - prompt
    FormQuestion:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the entity
        object:
          type: string
          const: question
          title: Object
          default: question
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-timestamp when the entity was created
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        archived_at:
          title: Archived At
          description: ISO-timestamp when the entity was archived
          type: string
          format: date-time
        question_type:
          type: string
          const: form
          title: Question Type
          default: form
        configuration:
          $ref: '#/components/schemas/FormQuestionConfiguration'
      type: object
      required:
        - created_by
        - id
        - created_at
        - name
        - prompt
        - configuration
    TimestampQuestion:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the entity
        object:
          type: string
          const: question
          title: Object
          default: question
        created_by:
          $ref: '#/components/schemas/Identity'
          description: The identity that created the entity.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: ISO-timestamp when the entity was created
        name:
          type: string
          title: Name
        prompt:
          type: string
          title: Prompt
          description: user-facing question prompt
        conditions:
          title: Conditions
          description: Conditions for the question to be shown
          items:
            additionalProperties: true
            type: object
          type: array
        archived_at:
          title: Archived At
          description: ISO-timestamp when the entity was archived
          type: string
          format: date-time
        question_type:
          type: string
          const: timestamp
          title: Question Type
          default: timestamp
        configuration:
          $ref: '#/components/schemas/TimestampQuestionConfiguration'
      type: object
      required:
        - created_by
        - id
        - created_at
        - name
        - prompt
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    CategoricalQuestionConfiguration:
      properties:
        choices:
          items:
            type: string
          type: array
          minItems: 1
          title: Choices
          description: Categorical answer choices (must contain at least one entry)
        multi:
          title: Multi
          description: Whether the question allows multiple answers.
          type: boolean
        dropdown:
          title: Dropdown
          description: Whether the question is displayed as a dropdown in the UI.
          type: boolean
      type: object
      required:
        - choices
      title: CategoricalQuestionConfiguration
    RatingQuestionConfiguration:
      properties:
        min_label:
          type: string
          title: Min Label
          description: Label shown for the minimum rating
        max_label:
          type: string
          title: Max Label
          description: Label shown for the maximum rating
        steps:
          type: integer
          minimum: 1
          title: Steps
          description: Number of discrete points on the scale (e.g., 5 for a 1–5 scale)
      type: object
      required:
        - min_label
        - max_label
        - steps
      title: RatingQuestionConfiguration
    NumberQuestionConfiguration:
      properties:
        min:
          title: Min
          description: Minimum value for the number
          type: number
        max:
          title: Max
          description: Maximum value for the number
          type: number
      type: object
      title: NumberQuestionConfiguration
    FreeTextQuestionConfiguration:
      properties:
        min_length:
          type: integer
          minimum: 0
          title: Min Length
          description: Minimum characters required
          default: 50
        max_length:
          type: integer
          minimum: 1
          title: Max Length
          description: Maximum characters allowed
          default: 1000
      type: object
      title: FreeTextQuestionConfiguration
    FormQuestionConfiguration:
      properties:
        form_schema:
          additionalProperties: true
          type: object
          title: Form Schema
          description: The JSON schema of the desired form object
      type: object
      required:
        - form_schema
      title: FormQuestionConfiguration
    TimestampQuestionConfiguration:
      properties:
        multi:
          type: boolean
          title: Multi
          description: Whether to allow multiple timestamps
          default: false
      type: object
      title: TimestampQuestionConfiguration
    Identity:
      properties:
        id:
          type: string
          title: Id
        object:
          type: string
          const: identity
          title: Object
          default: identity
        type:
          $ref: '#/components/schemas/IdentityType'
      type: object
      required:
        - id
        - type
      title: Identity
    IdentityType:
      type: string
      enum:
        - user
        - service_account
      title: IdentityType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````