openapi: 3.1.0
info:
  title: Mabyduck API
  version: 0.7.5
  description: API for managing subjective studies on Mabyduck.
paths:
  /projects/{project_id}/datasets/:
    get:
      operationId: datasets_list
      description: Returns a list of datasets belonging to the given project.
      summary: List all datasets
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Datasets
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Dataset'
          description: ''
    post:
      operationId: datasets_create
      description: >-
        Creates a new dataset and returns a signed URL for uploading the dataset
        file.
      summary: Create a dataset
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Datasets
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicDatasetCreate'
            examples:
              Request:
                value:
                  name: Dataset
                  filename: dataset.zip
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PublicDatasetCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PublicDatasetCreate'
        required: true
      security:
        - ApiKeyAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicDatasetCreate'
              examples:
                Response:
                  value:
                    upload_url: >-
                      https://mabyduck-temp.s3.nl-ams.scw.cloud/{signed-upload-url}
                    status_url: >-
                      https://api.mabyduck.com/projects/{project_id}/datasets/{dataset_id}/status/
          description: ''
      x-codeSamples:
        - lang: curl
          label: cURL
          source: |-
            # Create an empty dataset
            curl -X POST \
                'https://api.mabyduck.com/projects/{project_id}/datasets/' \
                -H 'Authorization: Api-Key <YOUR_TOKEN_HERE>' \
                -H 'Content-Type: application/json' \
                -d '{"name": "Dataset", "filename": "dataset.zip"}'

            # Upload dataset file to the returned URL
            curl --upload-file 'dataset.zip' {upload_url}
        - lang: Python
          label: Python
          source: |-
            import requests

            url = f"https://api.mabyduck.com/projects/{project_id}/datasets/"
            payload = {"name": "Dataset", "filename": "dataset.zip"}
            headers = {
              "Content-Type": "application/json",
              "Authorization": "Api-Key <YOUR_TOKEN_HERE>"
            }

            # Create an empty dataset
            response = requests.post(url, json=payload, headers=headers)
            data = response.json()

            # Upload dataset file
            with open('dataset.zip', 'rb') as f:
                response = requests.put(data['upload_url'], data=f)
  /projects/{project_id}/datasets/{dataset_id}/:
    get:
      operationId: datasets_retrieve
      description: >-
        Returns detailed information for a single dataset identified by
        `dataset_id`.
      summary: Retrieve a dataset
      parameters:
        - in: path
          name: dataset_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Datasets
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetDetail'
          description: ''
  /projects/{project_id}/datasets/{dataset_id}/status/:
    get:
      operationId: datasets_status_retrieve
      description: >-
        Returns the current status of a dataset, including any error messages if
        processing failed.
      summary: Get dataset status
      parameters:
        - in: path
          name: dataset_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Datasets
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasetStatus'
          description: ''
  /projects/{project_id}/experiments/:
    get:
      operationId: experiments_list
      description: Returns a list of experiments belonging to the given project.
      summary: List all experiments
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Experiment'
          description: ''
    post:
      operationId: experiments_create
      description: Creates a new draft experiment with the specified configuration.
      summary: Create an experiment
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateExperiment'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateExperiment'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateExperiment'
        required: true
      security:
        - ApiKeyAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Experiment'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/:
    get:
      operationId: experiments_retrieve
      description: >-
        Returns detailed information for a single experiment identified by
        `experiment_id`.
      summary: Retrieve an experiment
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExperimentDetail'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/jobs/:
    get:
      operationId: experiments_jobs_list
      description: Returns a list of jobs belonging to the given experiment.
      summary: List all jobs
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Job'
          description: ''
    post:
      operationId: experiments_jobs_create
      description: Creates a new draft job with the specified configuration.
      summary: Create a job
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Experiments
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateJob'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateJob'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateJob'
        required: true
      security:
        - ApiKeyAuth: []
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/raters/:
    get:
      operationId: experiments_raters_list
      description: Returns a list of raters of a given experiment.
      summary: List all raters
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Rater'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/ratings/:
    get:
      operationId: experiments_ratings_list
      description: Returns a list of ratings belonging to the given experiment.
      summary: List all ratings
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: query
          name: training
          schema:
            type: string
            enum:
              - 'false'
              - 'true'
          description: Whether to include training data.
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RatingDetail'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/results/:
    get:
      operationId: experiments_results_list
      description: Returns a list of metrics derived from the results of an experiment.
      summary: List all results
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: query
          name: metric
          schema:
            type: string
            enum:
              - bayesian_elo
              - elo
              - mean
              - stats
              - win_loss
          description: Filter by this type of metric.
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: query
          name: source
          schema:
            type: string
          description: An optional comma-separated list of job or experiment IDs.
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Results'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/sessions/:
    get:
      operationId: experiments_sessions_list
      description: Returns a list of sessions belonging to the given experiment.
      summary: List all sessions
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: query
          name: training
          schema:
            type: string
            enum:
              - 'false'
              - 'true'
          description: Whether to include training data.
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Session'
          description: ''
  /projects/{project_id}/experiments/{experiment_id}/slates/:
    get:
      operationId: experiments_slates_list
      description: Returns a list of slates and ratings belonging to the given experiment.
      summary: List all slates
      parameters:
        - in: path
          name: experiment_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: query
          name: training
          schema:
            type: string
            enum:
              - 'false'
              - 'true'
          description: Whether to include training data.
      tags:
        - Experiments
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Slate'
          description: ''
  /projects/{project_id}/metrics/:
    get:
      operationId: metrics_list
      description: Returns a list of metrics corresponding to various sources.
      summary: List metrics
      parameters:
        - in: query
          name: metric
          schema:
            type: string
            enum:
              - bayesian_elo
              - elo
              - mean
              - stats
              - win_loss
          description: Filter by this type of metric.
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: query
          name: source
          schema:
            type: string
          description: A comma-separated list of job, experiment, or leaderboard IDs.
      tags:
        - Metrics
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Metric'
          description: ''
  /projects/{project_id}/rubrics/:
    get:
      operationId: rubrics_list
      description: Returns a list of rubrics belonging to the given project.
      summary: List all rubrics
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Rubrics
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Rubric'
          description: ''
  /projects/{project_id}/rubrics/{rubric_id}/:
    get:
      operationId: rubrics_retrieve
      description: Returns data of all leaderboards belonging to a rubric.
      summary: Retrieve a rubric
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: rubric_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Rubrics
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RubricDetail'
          description: ''
  /projects/{project_id}/rubrics/{rubric_id}/leaderboards/:
    get:
      operationId: rubrics_leaderboards_list
      description: Lists all leaderboards belonging to the given rubric.
      summary: List all leaderboards
      parameters:
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: rubric_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Rubrics
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LeaderboardDetail'
          description: ''
  /projects/{project_id}/rubrics/{rubric_id}/leaderboards/{leaderboard_id}/:
    get:
      operationId: rubrics_leaderboards_retrieve
      description: Returns only the data of a specific leaderboard.
      summary: Retrieve a leaderboard
      parameters:
        - in: path
          name: leaderboard_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: project_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
        - in: path
          name: rubric_id
          schema:
            type: string
            pattern: ^[a-zA-Z0-9]+$
          required: true
      tags:
        - Rubrics
      security:
        - ApiKeyAuth: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LeaderboardDetail'
          description: ''
components:
  schemas:
    CreateExperiment:
      type: object
      description: Serializer for creating draft experiments via API.
      properties:
        name:
          type: string
          description: A description identifying the experiment.
          maxLength: 128
        version:
          type: integer
          description: ID of the experiment version/type to use
        datasets:
          type: array
          items:
            type: integer
          description: List of dataset IDs to use in this experiment
        training_datasets:
          type: array
          items:
            type: integer
          description: List of training dataset IDs (optional)
        config: {}
        language:
          allOf:
            - $ref: '#/components/schemas/LanguageEnum'
          description: |-
            The language used for the experiment’s interface.

            * `en` - English
            * `fr` - French
            * `de` - German
            * `zh-hans` - Chinese (simplified)
            * `es` - Spanish
            * `hi` - Hindi
            * `pl` - Polish
            * `vi` - Vietnamese
      required:
        - datasets
        - name
        - version
    CreateJob:
      type: object
      description: Serializer for creating draft jobs via API.
      properties:
        rater_pool:
          type: integer
          description: ID of the rater pool to use for this job
        num_sessions:
          type: integer
          minimum: 1
          description: Number of sessions (times the task is performed)
        num_comparisons:
          type: integer
          minimum: 1
          description: Number of comparisons per session
        num_training:
          type: integer
          minimum: 0
          default: 2
          description: Number of training comparisons
        max_repetitions:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Maximum number of repetitions
          description: How often an individual rater is allowed to repeat the task.
        min_rest_time:
          type: integer
          maximum: 2147483647
          minimum: 0
          title: Minimum rest time
          description: How many minutes should pass before a rater can repeat the task.
        strategy:
          allOf:
            - $ref: '#/components/schemas/StrategyEnum'
          default: randomized
          description: |-
            Strategy for presenting stimuli

            * `randomized` - randomized
            * `active` - active
            * `neighbour` - neighbour
        note:
          type:
            - string
            - 'null'
          description: An optional note for this job. Not visible to raters.
      required:
        - num_comparisons
        - num_sessions
        - rater_pool
    Dataset:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: A short name identifying the dataset.
          maxLength: 64
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_last_used:
          type: string
          format: date-time
          readOnly: true
          title: Last used
        is_deleted:
          type: boolean
          description: The files in this dataset have been deleted.
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          description: |-
            Current status of the dataset.

            * `draft` - Draft
            * `processing` - Processing
            * `ready` - Ready
            * `error` - Error
      required:
        - date_created
        - date_last_used
        - id
        - name
    DatasetDetail:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: A short name identifying the dataset.
          maxLength: 64
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_last_used:
          type: string
          format: date-time
          readOnly: true
          title: Last used
        is_deleted:
          type: boolean
          description: The files in this dataset have been deleted.
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          description: |-
            Current status of the dataset.

            * `draft` - Draft
            * `processing` - Processing
            * `ready` - Ready
            * `error` - Error
        stimuli:
          type: array
          items:
            $ref: '#/components/schemas/Stimulus'
          readOnly: true
      required:
        - date_created
        - date_last_used
        - id
        - name
        - stimuli
    DatasetStatus:
      type: object
      description: Serializer for dataset status information.
      properties:
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          readOnly: true
          description: |-
            Current status of the dataset.

            * `draft` - Draft
            * `processing` - Processing
            * `ready` - Ready
            * `error` - Error
        error:
          type:
            - string
            - 'null'
          readOnly: true
          description: Error message if processing failed.
      required:
        - error
        - status
    Experiment:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: A description identifying the experiment.
          maxLength: 128
        type:
          type: string
        language:
          allOf:
            - $ref: '#/components/schemas/LanguageEnum'
          description: |-
            The language used for the experiment’s interface.

            * `en` - English
            * `fr` - French
            * `de` - German
            * `zh-hans` - Chinese (simplified)
            * `es` - Spanish
            * `hi` - Hindi
            * `pl` - Polish
            * `vi` - Vietnamese
        dataset_ids:
          type: array
          items:
            type: string
          readOnly: true
        job_ids:
          type: array
          items:
            type: string
          readOnly: true
        training_dataset_ids:
          type: array
          items:
            type: string
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
        config: {}
      required:
        - dataset_ids
        - date_created
        - date_updated
        - id
        - job_ids
        - name
        - training_dataset_ids
        - type
    ExperimentDetail:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: A description identifying the experiment.
          maxLength: 128
        type:
          type: string
        language:
          allOf:
            - $ref: '#/components/schemas/LanguageEnum'
          description: |-
            The language used for the experiment’s interface.

            * `en` - English
            * `fr` - French
            * `de` - German
            * `zh-hans` - Chinese (simplified)
            * `es` - Spanish
            * `hi` - Hindi
            * `pl` - Polish
            * `vi` - Vietnamese
        datasets:
          type: array
          items:
            $ref: '#/components/schemas/Dataset'
          readOnly: true
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/Job'
          readOnly: true
        training_datasets:
          type: array
          items:
            $ref: '#/components/schemas/Dataset'
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
        config: {}
      required:
        - datasets
        - date_created
        - date_updated
        - id
        - jobs
        - name
        - training_datasets
        - type
    Job:
      type: object
      properties:
        id:
          type: string
        experiment_id:
          type: string
          readOnly: true
        num_sessions:
          type: integer
          maximum: 10000
          minimum: 0
          title: Number of sessions
          description: How often the task is performed.
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
        date_launched:
          type:
            - string
            - 'null'
          format: date-time
        pool:
          type: integer
          readOnly: true
        status:
          type: string
          readOnly: true
        config:
          description: Configures stimulus selection strategy.
      required:
        - date_created
        - date_updated
        - experiment_id
        - id
        - num_sessions
        - pool
        - status
    KindEnum:
      enum:
        - bayesian_elo
        - elo
        - mean
        - win_loss
        - stats
      type: string
      description: |-
        * `bayesian_elo` - Elo
        * `elo` - Elo (vanilla)
        * `mean` - MOS
        * `win_loss` - Win/loss
        * `stats` - Statistics
    LanguageEnum:
      enum:
        - en
        - fr
        - de
        - zh-hans
        - es
        - hi
        - pl
        - vi
      type: string
      description: |-
        * `en` - English
        * `fr` - French
        * `de` - German
        * `zh-hans` - Chinese (simplified)
        * `es` - Spanish
        * `hi` - Hindi
        * `pl` - Polish
        * `vi` - Vietnamese
    Leaderboard:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: A descriptive name for the leaderboard.
          maxLength: 100
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
      required:
        - date_updated
        - id
        - name
    LeaderboardDetail:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          description: A descriptive name for the leaderboard.
          maxLength: 100
        description:
          type: string
          description: Optional description of the leaderboard.
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
        include_patterns:
          type: string
          title: Include conditions
          description: >-
            Comma-separated list of conditions to include. Supports wildcards
            (*). Leave empty to include all methods.
        exclude_patterns:
          type: string
          title: Exclude conditions
          description: >-
            Comma-separated list of conditions to exclude. Supports wildcards.
            Applied after include patterns.
        entries:
          type: array
          items:
            type: object
            additionalProperties: {}
          readOnly: true
      required:
        - date_created
        - date_updated
        - entries
        - id
        - name
    Metric:
      type: object
      properties:
        kind:
          $ref: '#/components/schemas/KindEnum'
        dimension:
          type:
            - string
            - 'null'
          description: Used by experiments evaluating multiple criteria simultaneously.
          maxLength: 32
        source:
          type:
            - string
            - 'null'
          description: Return the source of the metric (job or experiment).
          readOnly: true
        scores:
          type: array
          items: {}
          description: Return the scores for each method.
          readOnly: true
      required:
        - kind
        - scores
        - source
    PublicDatasetCreate:
      type: object
      description: >-
        Serializer for creating a new dataset with single file (used by public
        API).
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
          description: A short name identifying the dataset.
          maxLength: 64
        filename:
          type: string
          writeOnly: true
          description: The name of the zip file that will be uploaded.
        upload_url:
          type: string
          format: uri
          readOnly: true
        retention_days:
          type:
            - integer
            - 'null'
          maximum: 2147483647
          minimum: -1
          description: >-
            Number of days to retain this dataset. Use -1 for unlimited
            retention. Empty means use project default.
      required:
        - filename
        - id
        - name
        - upload_url
    Rater:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        user:
          $ref: '#/components/schemas/User'
        meta: {}
      required:
        - id
        - user
    Rating:
      type: object
      properties:
        score:
          type:
            - number
            - 'null'
          format: double
        stimulus_id:
          type: integer
          readOnly: true
        stimulus:
          type: string
        condition:
          type: string
        dimension:
          type:
            - string
            - 'null'
          maxLength: 32
        meta:
          description: For example, expected score range.
        is_correct:
          type:
            - boolean
            - 'null'
          description: >-
            Checks if score is within expectation.


            First checks for explicit correctness in `meta['isCorrect']`.

            Falls back to comparing score within bounds given in
            `meta['expectedScores']` (inclusive).


            Returns:
                `True` if score is correct, `False` if incorrect, or `None` if neither.
          readOnly: true
      required:
        - condition
        - is_correct
        - stimulus
        - stimulus_id
    RatingDetail:
      type: object
      properties:
        score:
          type:
            - number
            - 'null'
          format: double
        rater_id:
          type: integer
        slate_id:
          type: integer
          readOnly: true
        session_id:
          type: string
        job_id:
          type: string
        stimulus_id:
          type: integer
          readOnly: true
        stimulus:
          type: string
        dimension:
          type:
            - string
            - 'null'
          maxLength: 32
        is_training:
          type: boolean
        meta:
          description: For example, expected score range.
        is_correct:
          type:
            - boolean
            - 'null'
          description: >-
            Checks if score is within expectation.


            First checks for explicit correctness in `meta['isCorrect']`.

            Falls back to comparing score within bounds given in
            `meta['expectedScores']` (inclusive).


            Returns:
                `True` if score is correct, `False` if incorrect, or `None` if neither.
          readOnly: true
      required:
        - is_correct
        - is_training
        - job_id
        - rater_id
        - session_id
        - slate_id
        - stimulus
        - stimulus_id
    Results:
      type: object
      description: Add options used by the front-end to render results.
      properties:
        kind:
          $ref: '#/components/schemas/KindEnum'
        dimension:
          type:
            - string
            - 'null'
          description: Used by experiments evaluating multiple criteria simultaneously.
          maxLength: 32
        source:
          type:
            - string
            - 'null'
          description: Return the source of the metric (job or experiment).
          readOnly: true
        scores:
          type: array
          items: {}
          description: Return the scores for each method.
          readOnly: true
        options:
          type: object
          additionalProperties: {}
          description: Front-end options.
          readOnly: true
      required:
        - kind
        - options
        - scores
        - source
    Rubric:
      type: object
      properties:
        id:
          type: string
        leaderboards:
          type: array
          items:
            $ref: '#/components/schemas/Leaderboard'
          readOnly: true
        name:
          type: string
          description: A descriptive name for the rubric.
          maxLength: 100
        description:
          type: string
          description: Optional description of the rubric.
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
      required:
        - date_created
        - date_updated
        - id
        - leaderboards
        - name
    RubricDetail:
      type: object
      properties:
        id:
          type: string
        leaderboards:
          type: array
          items:
            $ref: '#/components/schemas/LeaderboardDetail'
          readOnly: true
        name:
          type: string
          description: A descriptive name for the rubric.
          maxLength: 100
        description:
          type: string
          description: Optional description of the rubric.
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
      required:
        - date_created
        - date_updated
        - id
        - leaderboards
        - name
    Session:
      type: object
      properties:
        id:
          type: string
        job_id:
          type: string
          readOnly: true
        experiment_id:
          type: string
          readOnly: true
        date_created:
          type: string
          format: date-time
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
        date_completed:
          type:
            - string
            - 'null'
          format: date-time
          title: Completion date
        meta: {}
        rater:
          $ref: '#/components/schemas/Rater'
      required:
        - date_created
        - date_updated
        - experiment_id
        - id
        - job_id
        - rater
    Slate:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        rater_id:
          type: string
          readOnly: true
        session_id:
          type: string
          readOnly: true
        job_id:
          type: string
          readOnly: true
        ratings:
          type: array
          items:
            $ref: '#/components/schemas/Rating'
          readOnly: true
        date_updated:
          type: string
          format: date-time
          readOnly: true
          title: Last updated
        meta:
          oneOf:
            - {}
            - type: 'null'
          description: For example, the time it took to complete the slate.
        is_training:
          type: boolean
      required:
        - date_updated
        - id
        - is_training
        - job_id
        - rater_id
        - ratings
        - session_id
    StatusEnum:
      enum:
        - draft
        - processing
        - ready
        - error
      type: string
      description: |-
        * `draft` - Draft
        * `processing` - Processing
        * `ready` - Ready
        * `error` - Error
    Stimulus:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        filepath:
          type: string
        modifiers:
          description: Parameters of signal processors modifying the stimulus.
        group_id:
          type:
            - integer
            - 'null'
          readOnly: true
      required:
        - filepath
        - group_id
        - id
    StrategyEnum:
      enum:
        - randomized
        - active
        - neighbour
      type: string
      description: |-
        * `randomized` - randomized
        * `active` - active
        * `neighbour` - neighbour
    User:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
          title: Full name
          maxLength: 256
      required:
        - id
        - name
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: Api-Key
    basicAuth:
      type: http
      scheme: basic
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid
servers:
  - url: https://api.mabyduck.com
tags:
  - name: Datasets
    description: Operations related to datasets.
  - name: Experiments
    description: Operations related to experiments.
  - name: Rubrics
    description: Operations related to rubrics and leaderboards.
