openapi: 3.1.0
info:
  version: '3.0'
  title: EGA Submission API
  description: Programmatic metadata submissions at the EGA.
  termsOfService: https://ega-archive.org/legal-notice/
  contact:
    email: dev.ega@crg.eu
servers:
  - url: "https://submission.ega-archive.org/api"
    description: The Submission API endpoint
security:
  - token: []
  - oauth2: []
tags:
  - name: Submissions
    description: Endpoints manipulating submissions
  - name: Studies
    description: Endpoints manipulating studies
  - name: Samples
    description: Endpoints manipulating samples
  - name: Experiments
    description: Endpoints manipulating experiments
  - name: Runs
    description: Endpoints manipulating runs
  - name: Analyses
    description: Endpoints manipulating analyses
  - name: Datasets
    description: Endpoints manipulating datasets
  - name: Policies
    description: Endpoints manipulating policies
  - name: Users
    description: Endpoints manipulating users
externalDocs:
  description: Submission Guide
  url: https://ega-archive.org/metadata/submission/submitter-portal-api/
paths:
  /users/{username}:
    get:
      description: Get the ID of this user
      tags:
        - Users
      parameters:
        - in: path
          name: username
          schema:
            type: string
          required: true
          description: Username of the user to get
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_45
                  id:
                    type: integer
                    description: ID of the user
                  username:
                    type: string
                    description: Username of the user
                example: &ref_46
                  id: 1234
                  username: batman
        '400':
          description: Bad request
          content: &ref_0
            text/plain:
              examples:
                input:
                  summary: Input
                  value: Missing or invalid JSON data
                mal-formatted:
                  summary: Mal Formatted
                  value: Only local or stable IDs should be used, but not both
        '502':
          description: Backend not available
          content: &ref_1
            text/plain:
              schema:
                type: string
              examples:
                not available:
                  summary: Not Available
                  value: Backend sleeping
  /submissions:
    get:
      description: Get information of all submissions of the current user
      tags:
        - Submissions
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_2
                    provisional_id:
                      type: integer
                      description: The submission provisional ID
                    accession_id:
                      type: string
                      description: The submission accession ID
                    status:
                      type: string
                      description: The submission status. See [/enums/status_types](/paths/enums-status_types/get)
                    access_type:
                      type: string
                      description: The submission access type
                    title:
                      type: string
                      description: The submission title
                    description:
                      type: string
                      description: The submission description
                    comment:
                      type: string
                      description: The submission owner message for the collaborator.
                    creator_username:
                      type: string
                      description: The submission owner
                    num_collaborators:
                      type: integer
                      description: Number of collaborators that the submission has
                    num_analyses:
                      type: integer
                      description: Number of analyses that the submission has
                    num_datasets:
                      type: integer
                      description: Number of datasets that the submission has
                    num_experiments:
                      type: integer
                      description: Number of experiments that the submission has
                    num_runs:
                      type: integer
                      description: Number of runs that the submission has
                    num_samples:
                      type: integer
                      description: Number of samples that the submission has
                    num_studies:
                      type: integer
                      description: Number of studies that the submission has
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a submission
      tags:
        - Submissions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: &ref_42
                title:
                  type: string
                  description: The submission title.
                  example: My Submission
                description:
                  type: string
                  description: The submission description.
                  example: My submission description
                collaborators:
                  type: array
                  description: The submission collaborators.
                  items:
                    properties:
                      id:
                        type: integer
                        description: The User ID
                        example: 1
                      access_type:
                        type: string
                        description: The Collaborator access type
                        example: read
                        enum:
                          - read
                          - write
                      comment:
                        type: string
                        description: A message for the collaborator
                        example: Please, help me to complete my submission
                    required:
                      - id
                      - access_type
              required: &ref_43
                - title
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_4
                  provisional_id:
                    type: integer
                    description: The submission provisional ID
                  title:
                    type: string
                    description: The submission title
                  description:
                    type: string
                    description: The submission description
                  access_type:
                    type: string
                    description: The submission access type
                  status:
                    type: string
                    description: The submission status. See [/enums/status_types](/paths/enums-status_types/get)
                  creator_user_id:
                    type: integer
                    description: The submission owner ID
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}:
    get:
      description: Get information of this submission
      tags:
        - Submissions
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: &ref_3
            type: integer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_2
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this submission, including all the objects in it.
      tags:
        - Submissions
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                input:
                  summary: Submission successfully deleted including objects and links
                  value: Submission 10 successfully deleted (including 14 objects and 8 links)!
                mal-formatted:
                  summary: Successfully deleted
                  value: Submission 10 successfully deleted!
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this submission
      tags:
        - Submissions
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: &ref_6
                title:
                  type: string
                  description: The submission title
                description:
                  type: string
                  description: The submission description
              required: &ref_7
                - title
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_4
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}:
    get:
      description: Get information of this submission
      tags:
        - Submissions
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: &ref_5
            type: string
            pattern: ^EGA\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_2
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this submission
      tags:
        - Submissions
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_6
              required: *ref_7
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties: *ref_4
                  - type: object
                    properties:
                      accession_id:
                        type: string
                        description: The submission accession ID
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/collaborators:
    get:
      description: Get information about the collaborators in this submission
      tags:
        - Submissions
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_8
                  id:
                    type: integer
                    description: The collaborator ID
                  username:
                    type: string
                    description: The collaborator username
                  access_type:
                    type: string
                    description: The collaborator access type
                  comment:
                    type: string
                    description: The comment used when adding the collaborator
                  created_at:
                    type: string
                    description: The date when the collaborator was added
                  edited_at:
                    type: string
                    description: The date when the collaborator was edited
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/collaborators:
    get:
      description: Get information about the collaborators in this submission
      tags:
        - Submissions
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_8
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/finalise:
    post:
      description: Finalise this submission
      tags:
        - Submissions
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: &ref_9
                expected_release_date:
                  type: string
                  description: The submission expected release date
                  format: '2018-12-10'
                dataset_changelogs:
                  type: array
                  items:
                    properties:
                      dataset:
                        type: string
                        example: EGAD00000000001
                        pattern: ^EGAD\d{11}$
                      message:
                        type: string
                        example: My changelog message
                    required:
                      - dataset
                      - message
              required: &ref_10
                - expected_release_date
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                succesfully:
                  summary: Successfully
                  value: Submission 10 successfully finalised!
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/finalise:
    post:
      description: Finalise this submission
      tags:
        - Submissions
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_9
              required: *ref_10
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                succesfully:
                  summary: Successfully reverted
                  value: Submission EGA12345678901 successfully finalised!
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/rollback:
    put:
      description: Undo all the changes done in all the object in this submission which have been modified, including the submission itself, and delete any new object that has been created.
      tags:
        - Submissions
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                input:
                  summary: Successfully reverted
                  value: Submission EGA12345678901 successfully reverted!
                mal-formatted:
                  summary: Not reverted
                  value: Submission EGA12345678901 not reverted!
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/files:
    get:
      description: Get information of all the files linked in this submission
      tags:
        - Submissions
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_11
                    provisional_id:
                      type: integer
                      description: The file provisional ID
                    relative_path:
                      type: string
                      description: The file relative path
                    extension:
                      type: string
                      description: The file extension
                    filesize:
                      type: integer
                      description: The file size
                    encrypted_checksum:
                      type: string
                      description: The file encrypted checksum
                    encrypted_checksum_type:
                      type: string
                      description: The file encrypted checksum type
                    unencrypted_checksum:
                      type: string
                      description: The file unencrypted checksum
                    unencrypted_checksum_type:
                      type: string
                      description: The file unencrypted checksum type
                    status:
                      type: string
                      description: The file status
                    user_error_message:
                      type: string
                      description: The file error message
                    created_at:
                      type: string
                      description: The file created at date
                    submission_provisional_id:
                      type: integer
                      description: The experiment's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The experiment's submission's accession ID
                    submission_title:
                      type: string
                      description: The experiment's submission's title
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /files:
    get:
      description: Get information of files of the current user.Use the status and the prefix parameter to limit the number of files retrieved. If you ask for more than 500 files in one call you will receive an error.
      tags:
        - Files
      parameters:
        - in: query
          name: status
          description: Status of file
          schema:
            type: string
        - in: query
          name: prefix
          description: Prefix of file
          schema:
            type: string
            enum:
              - inbox
              - ingested
              - processing
              - error
              - waiting_approval
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_11
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /policies:
    get:
      description: Get information of all existing policies
      tags:
        - Policies
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_12
                    accession_id:
                      type: string
                      description: The policy accession ID
                    title:
                      type: string
                      description: The policy title
                    dac_accession_id:
                      type: string
                      description: The DAC accession ID
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /dacs/{accession_id}/policies:
    get:
      description: Get information of all policies of this DAC
      tags:
        - Policies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a DAC
          required: true
          schema: &ref_41
            type: string
            pattern: ^EGAC\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_12
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/samples:
    get:
      description: Get information of all samples in this submission
      tags:
        - Samples
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_13
                    provisional_id:
                      type: integer
                      description: The sample provisional ID
                    accession_id:
                      type: string
                      description: The sample accession ID
                    alias:
                      type: string
                      description: The sample alias
                    title:
                      type: string
                      description: The sample title
                    description:
                      type: string
                      description: The sample description
                    biological_sex:
                      type: string
                      description: The sample biological sex. See enum [/enums/biological_sex](paths/enums-biological_sex/get)
                    subject_id:
                      type: string
                      description: The sample subject ID
                    phenotype:
                      type: string
                      description: The sample phenotype
                    biosample_id:
                      type: string
                      description: The sample biosample ID
                    case_control:
                      type: string
                      description: The sample case control. See [/enums/case_controls](/paths/enums-case_controls/get)
                    organism_part:
                      type: string
                      description: The sample organism part
                    cell_line:
                      type: string
                      description: The sample cell line
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    submission_provisional_id:
                      type: integer
                      description: The sample's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The sample's submission's accession ID
                    submission_title:
                      type: string
                      description: The sample's submission's title
                    status:
                      type: string
                      description: The sample status. See [/enums/status_types](/paths/enums-status_types/get)
                    created_at:
                      type: string
                      description: The sample create date
                    edited_at:
                      type: string
                      description: The sample edit date
                    creator_username:
                      type: string
                      description: The sample creator username
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a sample in this submission
      tags:
        - Samples
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: &ref_14
                alias:
                  type: string
                  description: The sample alias
                  example: My Sample Alias
                title:
                  type: string
                  description: The sample title
                  example: My Sample
                description:
                  type: string
                  description: The sample description
                  example: My Sample Description
                biological_sex:
                  type: string
                  description: |
                    The sample biological sex. See enum [/enums/biological_sex](paths/enums-biological_sex/get)
                  example: male
                subject_id:
                  type: string
                  description: The sample subject ID
                  example: 92837728-223872899
                phenotype:
                  type: string
                  description: The sample phenotype
                  example: Cancer
                biosample_id:
                  type: string
                  description: The sample biosample ID
                  example: null
                case_control:
                  type: string
                  description: |
                    The sample case control. See enum [/enums/case_controls](/paths/enums-case_controls/get)
                  example: case
                organism_part:
                  type: string
                  description: The sample organism part
                  example: null
                cell_line:
                  type: string
                  description: The sample cell line
                  example: null
                extra_attributes:
                  example: null
                  type: array
                  description: The extra attributes
                  items: &ref_18
                    properties:
                      tag:
                        type: string
                      value:
                        type: string
                      unit:
                        type: string
                    required:
                      - tag
                      - value
              required: &ref_15
                - alias
                - biological_sex
                - subject_id
                - phenotype
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_16
                  provisional_id:
                    type: integer
                    description: The sample provisional ID
                  accession_id:
                    type: string
                    description: The sample accession ID
                  alias:
                    type: string
                    description: The sample alias
                  title:
                    type: string
                    description: The sample title
                  description:
                    type: string
                    description: The sample description
                  biological_sex:
                    type: string
                    description: The sample biological sex. See [/enums/biological_sex](/paths/enums-biological_sex/get)
                  subject_id:
                    type: string
                    description: The sample subject ID
                  phenotype:
                    type: string
                    description: The sample phenotype
                  biosample_id:
                    type: string
                    description: The sample biosample ID
                  case_control:
                    type: string
                    description: The sample case control. See [/enums/case_controls](/paths/enums-case_controls/get)
                  organism_part:
                    type: string
                    description: The sample organism part
                  cell_line:
                    type: string
                    description: The sample cell line
                  extra_attributes:
                    type: string
                    format: json
                    description: The sample extra attributes
                  status:
                    type: string
                    description: The sample status. See [/enums/status_types](/paths/enums-status_types/get)
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the samples in this submission.
      tags:
        - Samples
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 samples within submission 10
                nothing:
                  summary: No deletion
                  value: No samples were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/samples:
    get:
      description: Get information of all samples in this submission
      tags:
        - Samples
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_13
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a sample in this submission
      tags:
        - Samples
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_14
              required: *ref_15
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_16
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/samples/rollback:
    put:
      description: Undo all the changes done to all the samples in this submission and delete any new sample created.
      tags:
        - Samples
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 samples
                nothing:
                  summary: Nothing to rollback
                  value: No samples were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /samples:
    get:
      description: Get information of all samples of the current user
      tags:
        - Samples
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_13
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of the samples listed
      tags:
        - Samples
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                oneOf:
                  - allOf:
                      - type: object
                        description: If the sample has no accession yet, use `provisional_id`.
                        properties:
                          provisional_id:
                            type: integer
                        required:
                          - provisional_id
                      - type: object
                        properties: *ref_14
                        required: *ref_15
                  - allOf:
                      - type: object
                        description: If the sample has an accession, use `accession_id`.
                        properties:
                          accession_id:
                            type: string
                            pattern: ^EGAN\d{11}$
                        required:
                          - accession_id
                      - type: object
                        properties: *ref_14
                        required: *ref_15
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_16
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the samples listed.
      tags:
        - Samples
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The sample provisional ID
              items:
                type: integer
                example: 1
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 samples
                nothing:
                  summary: No deletion
                  value: No samples were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /samples/{provisional_id}:
    get:
      description: Get information of this sample
      tags:
        - Samples
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_13
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this sample
      tags:
        - Samples
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_14
              required: *ref_15
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_16
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this sample.
      tags:
        - Samples
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 1 samples
                nothing:
                  summary: No deletion
                  value: No samples were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /samples/{accession_id}:
    get:
      description: Get information of this sample
      tags:
        - Samples
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Sample
          required: true
          schema: &ref_17
            type: string
            pattern: ^EGAN\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_13
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this sample
      tags:
        - Samples
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Sample
          required: true
          schema: *ref_17
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_14
              required: *ref_15
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_16
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /samples/rollback:
    put:
      description: Undo all the changes done to the samples listed.
      tags:
        - Samples
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The sample accession IDs
              items:
                type: string
                pattern: ^EGAN\d{11}$
                example: EGAN12345678901
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 samples
                nothing:
                  summary: Nothing to rollback
                  value: No samples were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /samples/{accession_id}/rollback:
    put:
      description: Undo the changes done to this sample.
      tags:
        - Samples
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Sample
          required: true
          schema: *ref_17
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 1 samples
                nothing:
                  summary: Nothing to rollback
                  value: No samples were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/experiments:
    get:
      description: Get information of all experiments in this submission
      tags:
        - Experiments
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_20
                    provisional_id:
                      type: integer
                      description: The experiment provisional ID
                    accession_id:
                      type: string
                      description: The experiment accession ID
                    design_description:
                      type: string
                      description: The experiment alias
                    library_name:
                      type: string
                      description: The experiment title
                    library_construction_protocol:
                      type: string
                      description: The experiment library construction protocol
                    paired_nominal_length:
                      type: integer
                      description: The experiment paired nominal length
                    paired_nominal_sdev:
                      type: string
                      description: The experiment paired nominal sdev
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    platform:
                      type: string
                      description: The experiment instrument platform
                    model:
                      type: string
                      description: The experiment instrument model
                    library_layout:
                      type: string
                      description: The experiment library layout
                    library_strategy:
                      type: string
                      description: The experiment library strategy
                    library_source:
                      type: string
                      description: The experiment library source
                    library_selection:
                      type: string
                      description: The experiment library selection
                    study_provisional_id:
                      type: integer
                      description: The experiment's study provisional ID
                    study_accession_id:
                      type: string
                      description: The experiment's study accession ID
                    study_title:
                      type: string
                      description: The experiment's study title
                    submission_provisional_id:
                      type: integer
                      description: The experiment's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The experiment's submission's accession ID
                    submission_title:
                      type: string
                      description: The experiment's submission's title
                    status:
                      type: string
                      description: The experiment status. See [/enums/status_types](/paths/enums-status_types/get)
                    created_at:
                      type: string
                      description: The experiment create date
                    edited_at:
                      type: string
                      description: The experiment edit date
                    creator_username:
                      type: string
                      description: The experiment creator username
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create an experiment in this submission
      tags:
        - Experiments
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_provisional_id
                  type: object
                  properties: &ref_19
                    design_description:
                      type: string
                      description: The experiment alias
                      example: My Experiment
                    library_name:
                      type: string
                      description: The experiment title
                      example: null
                    library_construction_protocol:
                      type: string
                      description: The experiment library construction protocol
                      example: null
                    paired_nominal_length:
                      type: integer
                      description: The experiment paired nominal length
                      example: null
                    paired_nominal_sdev:
                      type: number
                      format: double
                      description: The experiment paired nominal sdev
                      example: null
                    instrument_model_id:
                      type: integer
                      description: |
                        The experiment instrument model id. See [/enums/platform_models](/paths/enums-platform_models/get)
                      example: 1
                    library_layout:
                      type: string
                      description: |
                        The experiment library layout. See [/enums/library_layouts](/paths/enums-library_layouts/get)
                      example: SINGLE
                    library_strategy:
                      type: string
                      description: |
                        The experiment library strategy. See [/enums/library_strategies](/paths/enums-library_strategies/get)
                      example: WGS
                    library_source:
                      type: string
                      description: |
                        The experiment library source. See [/enums/library_sources](/paths/enums-library_sources/get)
                      example: GENOMIC
                    library_selection:
                      type: string
                      description: |
                        The experiment library selection. See [/enums/library_selections](/paths/enums-library_selections/get)
                      example: RANDOM
                    study_provisional_id:
                      type: integer
                      description: The experiment's study provisional ID. Use this field if the referenced study does not have an accession
                      example: 23
                    study_accession_id:
                      description: The experiment's study accession ID. Use this field if the referenced study already has an accession
                      type: string
                      pattern: ^EGAS\d{11}$
                      example: EGAS0000000001
                    extra_attributes:
                      example: null
                      type: array
                      description: The extra attributes
                      items: *ref_18
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_accession_id
                  type: object
                  properties: *ref_19
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_21
                  provisional_id:
                    type: integer
                    description: The experiment provisional ID
                  accession_id:
                    type: string
                    description: The experiment accession ID
                  design_description:
                    type: string
                    description: The experiment alias
                  library_name:
                    type: string
                    description: The experiment title
                  library_construction_protocol:
                    type: string
                    description: The experiment library construction protocol
                  paired_nominal_length:
                    type: integer
                    description: The experiment paired nominal length
                  paired_nominal_sdev:
                    type: string
                    description: The experiment paired nominal sdev
                  extra_attributes:
                    type: string
                    format: json
                    description: The extra attributes
                  instrument_model_id:
                    type: integer
                    description: The experiment instrument model ID
                  library_layout:
                    type: string
                    description: The experiment library layout
                  library_strategy:
                    type: string
                    description: The experiment library strategy
                  library_source:
                    type: string
                    description: The experiment library source
                  library_selection:
                    type: string
                    description: The experiment library selection
                  study_provisional_id:
                    type: integer
                    description: The experiment's study provisional ID
                  study_accession_id:
                    type: string
                    description: The experiment's study accession ID
                  status:
                    type: string
                    description: The experiment status. See [/enums/status_types](/paths/enums-status_types/get)
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the experiments in this submission.
      tags:
        - Experiments
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 experiments within submission 10
                nothing:
                  summary: No deletion
                  value: No experiments were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/experiments:
    get:
      description: Get information of all experiments in this submission
      tags:
        - Experiments
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_20
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create an experiment in this submission
      tags:
        - Experiments
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_provisional_id
                  type: object
                  properties: *ref_19
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_accession_id
                  type: object
                  properties: *ref_19
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_21
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/experiments/rollback:
    put:
      description: Undo all the changes done to all the experiments in this submission and delete any new experiment created.
      tags:
        - Experiments
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 experiments
                nothing:
                  summary: Nothing to rollback
                  value: No experiments were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /experiments:
    get:
      description: Get information of all experiments of the current user
      tags:
        - Experiments
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_20
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of the experiments listed.
      tags:
        - Experiments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the experiment has no accession yet, use `provisional_id`. If the referenced study does NOT have an accession, use `study_provisional_id`.
                      required:
                        - design_description
                        - instrument_model_id
                        - library_layout
                        - library_strategy
                        - library_source
                        - library_selection
                        - study_provisional_id
                      type: object
                      properties: *ref_19
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAX\d{11}$
                      required:
                        - accession_id
                    - description: If the experiment has an accession, use `accession_id`. If the referenced study does NOT have an accession, use `study_provisional_id`.
                      required:
                        - design_description
                        - instrument_model_id
                        - library_layout
                        - library_strategy
                        - library_source
                        - library_selection
                        - study_provisional_id
                      type: object
                      properties: *ref_19
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the experiment has no accession yet, use `provisional_id`. If the referenced study HAS an accession, use `study_accession_id`.
                      required:
                        - design_description
                        - instrument_model_id
                        - library_layout
                        - library_strategy
                        - library_source
                        - library_selection
                        - study_accession_id
                      type: object
                      properties: *ref_19
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAX\d{11}$
                      required:
                        - accession_id
                    - description: If the experiment has an accession, use `accession_id`. If the referenced study HAS an accession, use `study_accession_id`.
                      required:
                        - design_description
                        - instrument_model_id
                        - library_layout
                        - library_strategy
                        - library_source
                        - library_selection
                        - study_accession_id
                      type: object
                      properties: *ref_19
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_21
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the experiments listed.
      tags:
        - Experiments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The experiment provisional ID
              items:
                type: integer
                example: 1
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 experiments
                nothing:
                  summary: No deletion
                  value: No samples were experiments
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /experiments/{provisional_id}:
    get:
      description: Get information of this experiment
      tags:
        - Experiments
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_20
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this experiment
      tags:
        - Experiments
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_provisional_id
                  type: object
                  properties: *ref_19
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_accession_id
                  type: object
                  properties: *ref_19
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_21
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this experiment.
      tags:
        - Experiments
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 1 experiments
                nothing:
                  summary: No deletion
                  value: No experiments were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /experiments/{accession_id}:
    get:
      description: Get information of this experiment
      tags:
        - Experiments
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of an Experiment
          required: true
          schema: &ref_22
            type: string
            pattern: ^EGAX\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_20
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this experiment
      tags:
        - Experiments
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of an Experiment
          required: true
          schema: *ref_22
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_provisional_id
                  type: object
                  properties: *ref_19
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - design_description
                    - instrument_model_id
                    - library_layout
                    - library_strategy
                    - library_source
                    - library_selection
                    - study_accession_id
                  type: object
                  properties: *ref_19
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_21
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /experiments/rollback:
    put:
      description: Undo all the changes done to the experiments listed.
      tags:
        - Experiments
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The experiment accession IDs
              items:
                type: string
                pattern: ^EGAX\d{11}$
                example: EGAX12345678901
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 experiments
                nothing:
                  summary: Nothing to rollback
                  value: No experiments were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /experiments/{accession_id}/rollback:
    put:
      description: Undo the changes done to this experiment.
      tags:
        - Experiments
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of an Experiment
          required: true
          schema: *ref_22
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 1 experiments
                nothing:
                  summary: Nothing to rollback
                  value: No experiments were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/studies:
    get:
      description: Get information of all studies in this submission
      tags:
        - Studies
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_24
                    provisional_id:
                      type: integer
                      description: The study provisional ID
                    accession_id:
                      type: string
                      description: The study accession ID
                    title:
                      type: string
                      description: The study title
                    description:
                      type: string
                      description: The study description
                    study_type:
                      type: string
                      description: The study type
                    pubmed_ids:
                      type: array
                      description: The study PubMedIDs
                      items:
                        type: integer
                    custom_tags:
                      type: array
                      description: The study custom tags
                      items:
                        type: string
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    repositories:
                      type: array
                      description: The study references to external repositories
                      items:
                        properties:
                          repository_id:
                            type: integer
                          repository_name:
                            type: string
                          url:
                            type: string
                          label:
                            type: string
                    submission_provisional_id:
                      type: integer
                      description: The study's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The study's submission's accession ID
                    submission_title:
                      type: string
                      description: The study's submission's title
                    status:
                      type: string
                      description: The study status. See [/enums/status_types](/paths/enums-status_types/get)
                    is_deprecated:
                      type: boolean
                      description: The study deprecated flag
                    created_at:
                      type: string
                      description: The study create date
                    edited_at:
                      type: string
                      description: The study edit date
                    creator_username:
                      type: string
                      description: The study creator username
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a study in this submission
      tags:
        - Studies
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: &ref_25
                title:
                  type: string
                  description: The study title
                  example: My study title
                description:
                  type: string
                  description: The study description
                  example: My study description
                study_type:
                  type: string
                  description: The study type. See See [/enums/study_types](/paths/enums-study_types/get)
                  example: Whole Genome Sequencing
                pubmed_ids:
                  type: array
                  description: The study PubMedIDs
                  items:
                    type: integer
                  example:
                    - 34791407
                custom_tags:
                  type: array
                  description: The study custom tags
                  items:
                    type: string
                  example:
                    - MONDO:0010781
                extra_attributes:
                  example: null
                  type: array
                  description: The extra attributes
                  items: *ref_18
                repositories:
                  example: null
                  type: array
                  description: The external references to other repositories
                  items: &ref_23
                    properties:
                      repository_id:
                        type: string
                      url:
                        type: string
                      label:
                        type: string
                    required:
                      - repository_id
                      - url
                      - label
              required: &ref_26
                - title
                - description
                - study_type
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_27
                  provisional_id:
                    type: integer
                    description: The study provisional ID
                  accession_id:
                    type: string
                    description: The study accession ID
                  title:
                    type: string
                    description: The study title
                  description:
                    type: string
                    description: The study description
                  study_type:
                    type: string
                    description: The study type
                  pubmed_ids:
                    type: array
                    description: The study PubMedIDs
                    items:
                      type: integer
                  custom_tags:
                    type: array
                    description: The study custom tags
                    items:
                      type: string
                  extra_attributes:
                    type: string
                    format: json
                    description: The study extra attributes
                  repositories:
                    type: array
                    description: The external references to other repositories
                    items: *ref_23
                  status:
                    type: string
                    description: The study status. See [/enums/status_types](/paths/enums-status_types/get)
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the studies in this submission.
      tags:
        - Studies
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 studies within submission 10
                nothing:
                  summary: No deletion
                  value: No studies were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/studies:
    get:
      description: Get information of all studies in this submission
      tags:
        - Studies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_24
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a study in this submission
      tags:
        - Studies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_25
              required: *ref_26
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_27
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/studies/rollback:
    put:
      description: Undo all the changes done to all the studies in this submission and delete any new study created.
      tags:
        - Studies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 studies
                nothing:
                  summary: Nothing to rollback
                  value: No studies were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /studies:
    get:
      description: Get information of all studies of the current user
      tags:
        - Studies
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_24
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of the studies listed
      tags:
        - Studies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                oneOf:
                  - allOf:
                      - type: object
                        description: If the study has no accession yet, use `provisional_id`.
                        properties:
                          provisional_id:
                            type: integer
                        required:
                          - provisional_id
                      - type: object
                        properties: *ref_25
                        required: *ref_26
                  - allOf:
                      - type: object
                        description: If the study has an accession, use `accession_id`.
                        properties:
                          accession_id:
                            type: string
                            pattern: ^EGAS\d{11}$
                        required:
                          - accession_id
                      - type: object
                        properties: *ref_25
                        required: *ref_26
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_27
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the studies listed.
      tags:
        - Studies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The study provisional ID
              items:
                type: integer
                example: 1
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 studies
                nothing:
                  summary: No deletion
                  value: No studies were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /studies/{provisional_id}:
    get:
      description: Get information of this study
      tags:
        - Studies
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_24
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this study
      tags:
        - Studies
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_25
              required: *ref_26
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_27
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this study.
      tags:
        - Studies
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 1 studies
                nothing:
                  summary: No deletion
                  value: No studies were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /studies/{accession_id}:
    get:
      description: Get information of this study
      tags:
        - Studies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Study
          required: true
          schema: &ref_28
            type: string
            pattern: ^EGAS\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_24
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this study
      tags:
        - Studies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Study
          required: true
          schema: *ref_28
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: *ref_25
              required: *ref_26
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_27
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /studies/rollback:
    put:
      description: Undo all the changes done to the studies listed.
      tags:
        - Studies
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The study accession IDs
              items:
                type: string
                pattern: ^EGAS\d{11}$
                example: EGAS12345678901
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 studies
                nothing:
                  summary: Nothing to rollback
                  value: No studies were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /studies/{accession_id}/rollback:
    put:
      description: Undo the changes done to this study.
      tags:
        - Studies
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Study
          required: true
          schema: *ref_28
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 1 studies
                nothing:
                  summary: Nothing to rollback
                  value: No studies were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/runs:
    get:
      description: Get information of all runs in this submission
      tags:
        - Runs
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_30
                    provisional_id:
                      type: integer
                      description: The run provisional ID
                    accession_id:
                      type: string
                      description: The run accession ID
                    run_file_type:
                      type: string
                      description: The run file type
                    run_file_type_display_name:
                      type: string
                      description: The run file type display name
                    files:
                      type: array
                      description: The run files
                      items:
                        properties:
                          provisional_id:
                            type: integer
                            description: The file provisional ID
                          filename:
                            type: string
                            description: The filename with path
                          accession_id:
                            type: string
                            description: The file accession ID
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    experiment:
                      type: object
                      description: The run's experiment
                      properties:
                        provisional_id:
                          type: integer
                          description: The run's experiment provisional ID
                        design_description:
                          type: string
                          description: The run's experiment design description
                        accession_id:
                          type: string
                          description: The run's experiment accession ID
                    sample:
                      type: object
                      description: The run's sample
                      properties:
                        provisional_id:
                          type: integer
                          description: The run's sample provisional ID
                        alias:
                          type: string
                          description: The run's sample alias
                        accession_id:
                          type: string
                          description: The run's sample accession ID
                    submission_provisional_id:
                      type: integer
                      description: The experiment's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The experiment's submission's accession ID
                    submission_title:
                      type: string
                      description: The experiment's submission's title
                    status:
                      type: string
                      description: The experiment status. See [/enums/status_types](/paths/enums-status_types/get)
                    created_at:
                      type: string
                      description: The experiment create date
                    edited_at:
                      type: string
                      description: The experiment edit date
                    creator_username:
                      type: string
                      description: The experiment creator username
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a run in this submission
      tags:
        - Runs
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_provisional_id
                  type: object
                  properties: &ref_29
                    run_file_type:
                      type: string
                      description: |
                        The run file type. See [/enums/run_file_types](/paths/enums-run_file_types/get)
                    files:
                      type: array
                      items:
                        type: integer
                        description: The run's file's ID
                    experiment_provisional_id:
                      type: integer
                      description: The run's experiment provisional ID
                    experiment_accession_id:
                      type: string
                      description: The run's experiment accession ID
                    sample_provisional_id:
                      type: integer
                      description: The run's sample provisional ID
                    sample_accession_id:
                      type: string
                      description: The run's sample accession ID
                    extra_attributes:
                      type: array
                      description: The experiment extra attributes
                      items:
                        properties:
                          tag:
                            type: string
                          value:
                            type: string
                          unit:
                            type: string
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: &ref_31
                  provisional_id:
                    type: integer
                    description: The run provisional ID
                  accession_id:
                    type: string
                    description: The run accession ID
                  run_file_type:
                    type: string
                    description: The run file type
                  files:
                    type: array
                    description: The run files
                    items:
                      type: integer
                      example:
                        - 123
                        - 456
                  extra_attributes:
                    type: string
                    format: json
                    description: The extra attributes
                  experiment_provisional_id:
                    type: integer
                    description: The run's experiment provisional ID
                  experiment_accession_id:
                    type: string
                    description: The run's experiment accession ID
                  sample_provisional_id:
                    type: integer
                    description: The run's sample provisional ID
                  sample_accession_id:
                    type: string
                    description: The run's sample accession ID
                  status:
                    type: string
                    description: The run status. See [/enums/status_types](/paths/enums-status_types/get)
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the runs in this submission.
      tags:
        - Runs
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 runs within submission 10
                nothing:
                  summary: No deletion
                  value: No runs were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/runs:
    get:
      description: Get information of all runs in this submission
      tags:
        - Runs
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_30
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create runs in this submission
      tags:
        - Runs
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
                - description: If the referenced study has an accession, use `study_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_31
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/runs/rollback:
    put:
      description: Undo all the changes done to all the runs in this submission and delete any new run created.
      tags:
        - Runs
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 runs
                nothing:
                  summary: Nothing to rollback
                  value: No runs were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /runs:
    get:
      description: Get information of all runs of the current user
      tags:
        - Runs
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_30
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of the runs listed
      tags:
        - Runs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                oneOf:
                  - allOf:
                      - type: object
                        properties:
                          provisional_id:
                            type: integer
                        required:
                          - provisional_id
                      - description: If the run has no accession yet, use `provisional_id`. If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                        required:
                          - run_file_type
                          - experiment_provisional_id
                          - files
                          - sample_provisional_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          provisional_id:
                            type: integer
                        required:
                          - provisional_id
                      - description: If the run has no accession yet, use `provisional_id`. If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                        required:
                          - run_file_type
                          - experiment_provisional_id
                          - files
                          - sample_accession_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          provisional_id:
                            type: integer
                        required:
                          - provisional_id
                      - description: If the run has no accession yet, use `provisional_id`. If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                        required:
                          - run_file_type
                          - experiment_accession_id
                          - files
                          - sample_provisional_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          provisional_id:
                            type: integer
                        required:
                          - provisional_id
                      - description: If the run has no accession yet, use `provisional_id`. If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                        required:
                          - run_file_type
                          - experiment_accession_id
                          - files
                          - sample_accession_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          accession_id:
                            type: string
                            pattern: ^EGAR\d{11}$
                        required:
                          - accession_id
                      - description: If the run has an accession, use `accession_id`. If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                        required:
                          - run_file_type
                          - experiment_provisional_id
                          - files
                          - sample_provisional_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          accession_id:
                            type: string
                            pattern: ^EGAR\d{11}$
                        required:
                          - accession_id
                      - description: If the run has an accession, use `accession_id`. If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                        required:
                          - run_file_type
                          - experiment_provisional_id
                          - files
                          - sample_accession_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          accession_id:
                            type: string
                            pattern: ^EGAR\d{11}$
                        required:
                          - accession_id
                      - description: If the run has an accession, use `accession_id`. If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                        required:
                          - run_file_type
                          - experiment_accession_id
                          - files
                          - sample_provisional_id
                        type: object
                        properties: *ref_29
                  - allOf:
                      - type: object
                        properties:
                          accession_id:
                            type: string
                            pattern: ^EGAR\d{11}$
                        required:
                          - accession_id
                      - description: If the run has an accession, use `accession_id`. If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                        required:
                          - run_file_type
                          - experiment_accession_id
                          - files
                          - sample_accession_id
                        type: object
                        properties: *ref_29
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_31
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the runs listed.
      tags:
        - Runs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The run provisional ID
              items:
                type: integer
                example: 1
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 runs
                nothing:
                  summary: No deletion
                  value: No runs were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /runs/{provisional_id}:
    get:
      description: Get information of this run
      tags:
        - Runs
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_30
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this run
      tags:
        - Runs
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
                - description: If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_31
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this run.
      tags:
        - Runs
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 1 runs
                nothing:
                  summary: No deletion
                  value: No runs were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /runs/{accession_id}:
    get:
      description: Get information of this run
      tags:
        - Runs
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Run
          required: true
          schema: &ref_32
            type: string
            pattern: ^EGAR\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_30
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this run
      tags:
        - Runs
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Run
          required: true
          schema: *ref_32
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample does NOT have an accession, use `sample_provisional_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_provisional_id
                  type: object
                  properties: *ref_29
                - description: If the referenced experiment does NOT have an accession, use `experiment_provisional_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_provisional_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
                - description: If the referenced experiment HAS an accession, use `experiment_accession_id`. If the referenced sample HAS an accession, use `sample_accession_id`.
                  required:
                    - run_file_type
                    - files
                    - experiment_accession_id
                    - sample_accession_id
                  type: object
                  properties: *ref_29
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_31
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /runs/rollback:
    put:
      description: Undo all the changes done to the runs listed.
      tags:
        - Runs
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The run accession IDs
              items:
                type: string
                pattern: ^EGAR\d{11}$
                example: EGAR12345678901
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 runs
                nothing:
                  summary: Nothing to rollback
                  value: No runs were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /runs/{accession_id}/rollback:
    put:
      description: Undo the changes done to this run.
      tags:
        - Runs
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Run
          required: true
          schema: *ref_32
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 1 runs
                nothing:
                  summary: Nothing to rollback
                  value: No runs were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/analyses:
    get:
      description: Get information of all analyses in this submission
      tags:
        - Analyses
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_34
                    provisional_id:
                      type: integer
                      description: The analysis provisional ID
                    accession_id:
                      type: string
                      description: The analysis accession ID
                    title:
                      type: string
                      description: The analysis title
                    description:
                      type: string
                      description: The analysis description
                    analysis_type:
                      type: string
                      description: The analysis type
                    files:
                      type: array
                      description: The analysis files
                      items:
                        properties:
                          provisional_id:
                            type: integer
                            description: The file provisional ID
                          filename:
                            type: string
                            description: The filename with path
                          accession_id:
                            type: string
                            description: The file accession ID
                    experiment_types:
                      type: array
                      description: The analysis experiment types
                      items:
                        type: string
                    genome:
                      type: string
                      description: The analysis genome
                    genome_id:
                      type: integer
                      description: The analysis genome id
                    genome_group_id:
                      type: integer
                      description: The analysis genome group id
                    chromosomes:
                      type: array
                      description: The analysis chromosomes
                      items:
                        properties:
                          id:
                            type: integer
                          label:
                            type: string
                    platform:
                      type: string
                      description: The analysis platform
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    study_provisional_id:
                      type: integer
                      description: The analysis study provisional ID
                    study_accession_id:
                      type: string
                      description: The analysis study accession ID
                    study_title:
                      type: string
                      description: The analysis study title
                    experiments:
                      type: array
                      description: The analysis' experiments
                      items:
                        properties:
                          provisional_id:
                            type: integer
                            description: The analysis' experiment provisional ID
                          design_description:
                            type: string
                            description: The analysis' experiment design description
                          accession_id:
                            type: string
                            description: The analysis' experiment accession ID
                    sample:
                      type: array
                      description: The analysis' samples
                      items:
                        properties:
                          provisional_id:
                            type: integer
                            description: The sample provisional ID
                          alias:
                            type: string
                            description: The sample alias
                          accession_id:
                            type: string
                            description: The sample accession ID
                    submission_provisional_id:
                      type: integer
                      description: The analysis' submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The analysis' submission's accession ID
                    submission_title:
                      type: string
                      description: The analysis' submission's title
                    status:
                      type: string
                      description: The analysis status. See [/enums/status_types](/paths/enums-status_types/get)
                    created_at:
                      type: string
                      description: The analysis create date
                    edited_at:
                      type: string
                      description: The analysis edit date
                    creator_username:
                      type: string
                      description: The analysis creator username
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create an analysis in this submission
      tags:
        - Analyses
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_provisional_ids
                  type: object
                  properties: &ref_33
                    title:
                      type: string
                      description: The analysis title
                    description:
                      type: string
                      description: The analysis description
                    analysis_type:
                      type: string
                      description: |
                        The analysis analysis type. See [/enums/analysis_types](/paths/enums-analysis_types/get)
                    files:
                      type: array
                      items:
                        type: integer
                        description: The analysis's file's ID
                    experiment_types:
                      type: array
                      items:
                        type: string
                        description: |
                          The analysis's experiment types. See [/enums/experiment_types](/paths/enums-experiment_types/get)
                    genome_id:
                      type: integer
                      description: |
                        The analysis genome id. See [/enums/genomes](/paths/enums-genomes/get)
                    chromosomes:
                      type: array
                      description: |
                        The analysis chromosomes. See [/enums/chromosomes](/paths/enums-chromosomes/get)
                      items:
                        properties:
                          id:
                            type: integer
                          label:
                            type: string
                    platform:
                      type: string
                      description: The analysis platform
                    study_provisional_id:
                      type: integer
                      description: The analysis's study's provisional ID
                    study_accession_id:
                      type: string
                      description: The analysis's study's accession ID
                      pattern: ^EGAS\d{11}$
                      example: EGAS0000000001
                    experiment_provisional_ids:
                      type: array
                      items:
                        type: integer
                        description: The analysis's experiments' provisional ID
                    experiment_accession_ids:
                      type: array
                      items:
                        type: string
                        description: The analysis's experiments' accession ID
                        pattern: ^EGAX\d{11}$
                        example: EGAX0000000001
                    sample_provisional_ids:
                      type: array
                      items:
                        type: integer
                        description: The analysis's samples' provisional ID
                    sample_accession_ids:
                      type: array
                      items:
                        type: string
                        description: The analysis's samples' accession ID
                        pattern: ^EGAN\d{11}$
                        example: EGAN0000000001
                    extra_attributes:
                      type: array
                      description: The extra attributes
                      items: *ref_18
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_35
                    provisional_id:
                      type: integer
                      description: The analysis provisional ID
                    accession_id:
                      type: string
                      description: The analysis accession ID
                    title:
                      type: string
                      description: The analysis title
                    description:
                      type: string
                      description: The analysis description
                    analysis_type:
                      type: string
                      description: The analysis type
                    files:
                      type: array
                      description: The analysis files
                      items:
                        type: integer
                        example:
                          - 123
                          - 456
                    experiment_types:
                      type: array
                      description: The analysis experiment types
                      items:
                        type: string
                    genome_id:
                      type: integer
                      description: The analysis genome id
                    chromosomes:
                      type: array
                      description: The analysis chromosomes
                      items:
                        properties:
                          id:
                            type: integer
                          label:
                            type: string
                    platform:
                      type: string
                      description: The analysis platform
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    study_provisional_id:
                      type: integer
                      description: The analysis' study provisional ID
                    study_accession_id:
                      type: string
                      description: The analysis' study accession ID
                    experiment_provisional_id:
                      type: integer
                      description: The analysis' experiment provisional ID
                    experiment_accession_id:
                      type: string
                      description: The analysis' experiment accession ID
                    sample_provisional_ids:
                      type: array
                      description: The analysis' samples
                      items:
                        type: integer
                        example:
                          - 1
                          - 6
                          - 7
                    sample_accession_ids:
                      type: array
                      description: The analysis' samples
                      items:
                        type: string
                    status:
                      type: string
                      description: The analysis status. See [/enums/status_types](/paths/enums-status_types/get)
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the analyses in this submission.
      tags:
        - Analyses
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 analyses within submission 10
                nothing:
                  summary: No deletion
                  value: No analyses were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/analyses:
    get:
      description: Get information of all analyses in this submission
      tags:
        - Analyses
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_34
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create an analysis in this submission
      tags:
        - Analyses
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_35
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/analyses/rollback:
    put:
      description: Undo all the changes done to all the analyses in this submission and delete any new analysis created.
      tags:
        - Analyses
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 analyses
                nothing:
                  summary: Nothing to rollback
                  value: No analyses were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /analyses:
    get:
      description: Get information of all analyses of the current user
      tags:
        - Analyses
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_34
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of the analyses listed
      tags:
        - Analyses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the analysis has no accession yet, use `provisional_id`. If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_provisional_id
                        - sample_provisional_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the analysis has no accession yet, use `provisional_id`. If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_accession_id
                        - sample_provisional_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the analysis has no accession yet, use `provisional_id`. If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_provisional_id
                        - sample_accession_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the analysis has no accession yet, use `provisional_id`. If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_accession_id
                        - sample_accession_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAZ\d{11}$
                      required:
                        - accession_id
                    - description: If the analysis HAS an accession yet, use `accession_id`. If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_provisional_id
                        - sample_provisional_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAZ\d{11}$
                      required:
                        - accession_id
                    - description: If the analysis HAS an accession yet, use `accession_id`. If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_accession_id
                        - sample_provisional_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAZ\d{11}$
                      required:
                        - accession_id
                    - description: If the analysis HAS an accession yet, use `accession_id`. If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_provisional_id
                        - sample_accession_ids
                      type: object
                      properties: *ref_33
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAZ\d{11}$
                      required:
                        - accession_id
                    - description: If the analysis HAS an accession yet, use `accession_id`. If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                      required:
                        - title
                        - description
                        - analysis_type
                        - files
                        - study_accession_id
                        - sample_accession_ids
                      type: object
                      properties: *ref_33
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_35
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the analyses listed.
      tags:
        - Analyses
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 analyses
                nothing:
                  summary: No deletion
                  value: No analyses were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /analyses/{provisional_id}:
    get:
      description: Get information of this analysis
      tags:
        - Analyses
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_34
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this analysis
      tags:
        - Analyses
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_35
            text/plain:
              schema:
                type: string
              example: Some informational message
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this analysis.
      tags:
        - Analyses
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 1 analyses
                nothing:
                  summary: No deletion
                  value: No analyses were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /analyses/{accession_id}:
    get:
      description: Get information of this analysis
      tags:
        - Analyses
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of an Analysis
          required: true
          schema: &ref_36
            type: string
            pattern: ^EGAZ\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_34
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this analysis
      tags:
        - Analyses
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of an Analysis
          required: true
          schema: *ref_36
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples do NOT have an accession, use `sample_provisional_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_provisional_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study does NOT have an accession, use `study_provisional_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_provisional_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
                - description: If the referenced study HAS an accession, use `study_accession_id`. If the referenced samples HAVE an accession, use `sample_accession_ids`. If the referenced experiments do NOT have an accession, use `experiment_provisional_ids`. Otherwise, use `experiment_accession_ids`.
                  required:
                    - title
                    - description
                    - analysis_type
                    - files
                    - study_accession_id
                    - sample_accession_ids
                  type: object
                  properties: *ref_33
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_35
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /analyses/rollback:
    put:
      description: Undo all the changes done to the analyses listed.
      tags:
        - Analyses
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The sample accession IDs
              items:
                type: string
                pattern: ^EGAZ\d{11}$
                example: EGAZ12345678901
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 analyses
                nothing:
                  summary: Nothing to rollback
                  value: No analyses were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /analyses/{accession_id}/rollback:
    put:
      description: Undo the changes done to this analysis.
      tags:
        - Analyses
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of an Analysis
          required: true
          schema: *ref_36
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 1 analyses
                nothing:
                  summary: Nothing to rollback
                  value: No analyses were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{provisional_id}/datasets:
    get:
      description: Get information of all datasets in this submission
      tags:
        - Datasets
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_38
                    provisional_id:
                      type: integer
                      description: The dataset provisional ID
                    accession_id:
                      type: string
                      description: The dataset accession ID
                    title:
                      type: string
                      description: The dataset title
                    description:
                      type: string
                      description: The dataset description
                    dataset_types:
                      type: array
                      description: The dataset types
                      items:
                        type: string
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    num_runs:
                      type: integer
                      description: The dataset number of runs
                    num_analyses:
                      type: integer
                      description: The dataset number of analyses
                    policy_accession_id:
                      type: string
                      description: The dataset policy accession ID
                    dac_accession_id:
                      type: string
                      description: The dataset DAC accession ID
                    status:
                      type: string
                      description: The dataset status. See [/enums/status_types](/paths/enums-status_types/get)
                    is_deprecated:
                      type: boolean
                      description: The dataset deprecated flag
                    is_released:
                      type: boolean
                      description: The dataset released flag
                    released_date:
                      type: string
                      description: The dataset edit date
                    submission_provisional_id:
                      type: integer
                      description: The dataset's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The dataset's submission's accession ID
                    submission_title:
                      type: string
                      description: The dataset's submission's title
                    created_at:
                      type: string
                      description: The dataset create date
                    edited_at:
                      type: string
                      description: The dataset edit date
                    creator_username:
                      type: string
                      description: The dataset creator username
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a dataset in this submission
      tags:
        - Datasets
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
#                     - run_provisional_ids
#                     - analysis_provisional_ids
                  type: object
                  properties: &ref_37
                    title:
                      type: string
                      description: The dataset title
                    description:
                      type: string
                      description: The dataset description. Must be 50 characters long at least.
                    dataset_types:
                      type: array
                      description: |
                        The dataset types. See [/enum/dataset_types](/paths/enums-dataset_types/get)
                      items:
                        type: string
                    policy_accession_id:
                      type: string
                      description: The policy accession ID
                      pattern: ^EGAP\d{11}$
                      example: EGAP0000000001
                    run_provisional_ids:
                      type: array
                      items:
                        type: integer
                        description: The runs' provisional ID
                    run_accession_ids:
                      type: array
                      items:
                        type: string
                        description: The runs' accession ID
                        pattern: ^EGAR\d{11}$
                        example: EGAR0000000001
                    analysis_provisional_ids:
                      type: array
                      items:
                        type: integer
                        description: The analyses' provisional ID
                    analysis_accession_ids:
                      type: array
                      items:
                        type: string
                        description: The analyses' accession ID
                        pattern: ^EGAZ\d{11}$
                        example: EGAZ0000000001
                    extra_attributes:
                      type: array
                      description: The extra attributes
                      items: *ref_18
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_39
                    provisional_id:
                      type: integer
                      description: The dataset provisional ID
                    accession_id:
                      type: string
                      description: The dataset accession ID
                    title:
                      type: string
                      description: The dataset title
                    description:
                      type: string
                      description: The dataset description
                    dataset_types:
                      type: array
                      description: The dataset types
                      items:
                        type: string
                    run_provisional_ids:
                      type: array
                      description: The dataset' runs
                      items:
                        type: integer
                        example:
                          - 1
                          - 6
                          - 7
                    run_accession_ids:
                      type: array
                      description: The dataset' runs
                      items:
                        type: string
                    analysis_provisional_ids:
                      type: array
                      description: The dataset' analysis
                      items:
                        type: integer
                        example:
                          - 1
                          - 6
                          - 7
                    analysis_accession_ids:
                      type: array
                      description: The dataset' analysis
                      items:
                        type: string
                    extra_attributes:
                      type: string
                      format: json
                      description: The extra attributes
                    policy_accession_id:
                      type: string
                      description: The dataset policy accession ID
                    status:
                      type: string
                      description: The dataset status. See [/enums/status_types](/paths/enums-status_types/get)
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the datasets in this submission.
      tags:
        - Datasets
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 datasets within submission 10
                nothing:
                  summary: No deletion
                  value: No datasets were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/datasets:
    get:
      description: Get information of all datasets in this submission
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_38
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    post:
      description: Create a dataset in this submission
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_39
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/datasets/changelog:
    get:
      description: Get the datasets affected by the changes done in this submission.
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: &ref_44
                    id:
                      type: integer
                      description: The dataset provisional ID
                    accession_id:
                      type: string
                      description: The dataset accession ID
                    title:
                      type: string
                      description: The dataset title
                    message:
                      type: string
                      description: Description of the changes done
                    creator_user_id:
                      type: string
                      description: The ID of the creator of the message
                    submission_provisional_id:
                      type: integer
                      description: The dataset's submission's provisional ID
                    submission_accession_id:
                      type: string
                      description: The dataset's submission's accession ID
                    user_id:
                      type: integer
                      description: A member of this submission
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /submissions/{accession_id}/datasets/rollback:
    put:
      description: Undo all the changes done to all the datasets in this submission and delete any new dataset created.
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Submission
          required: true
          schema: *ref_5
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 datasets
                nothing:
                  summary: Nothing to rollback
                  value: No datasets were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /datasets:
    get:
      description: Get information of all datasets of the current user
      tags:
        - Datasets
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_38
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of the datasets listed
      tags:
        - Datasets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the analysis has no accession yet, use `provisional_id`. If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_provisional_ids
                        - analysis_provisional_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_accession_ids
                        - analysis_provisional_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_provisional_ids
                        - analysis_accession_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        provisional_id:
                          type: integer
                      required:
                        - provisional_id
                    - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_accession_ids
                        - analysis_accession_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAD\d{11}$
                      required:
                        - accession_id
                    - description: If the dataset HAS an accession yet, use `accession_id`. If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_provisional_ids
                        - analysis_provisional_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAD\d{11}$
                      required:
                        - accession_id
                    - description: If the dataset HAS an accession yet, use `accession_id`. If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_accession_ids
                        - analysis_provisional_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAD\d{11}$
                      required:
                        - accession_id
                    - description: If the dataset HAS an accession yet, use `accession_id`. If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_provisional_ids
                        - analysis_accession_ids
                      type: object
                      properties: *ref_37
                - allOf:
                    - type: object
                      properties:
                        accession_id:
                          type: string
                          pattern: ^EGAD\d{11}$
                      required:
                        - accession_id
                    - description: If the dataset HAS an accession yet, use `accession_id`. If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                      required:
                        - title
                        - description
                        - dataset_types
                        - policy_accession_id
                        - run_accession_ids
                        - analysis_accession_ids
                      type: object
                      properties: *ref_37
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties: *ref_39
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete all the datasets listed.
      tags:
        - Datasets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The dataset provisional ID
              items:
                type: integer
                example: 1
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 5 datasets
                nothing:
                  summary: No deletion
                  value: No samples were datasets
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /datasets/{provisional_id}:
    get:
      description: Get information of this dataset
      tags:
        - Datasets
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_38
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this dataset
      tags:
        - Datasets
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_39
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    delete:
      description: Delete this dataset.
      tags:
        - Datasets
      parameters:
        - name: provisional_id
          in: path
          description: Provisional ID
          required: true
          schema: *ref_3
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully deletion
                  value: Successfully deleted 1 datasets
                nothing:
                  summary: No deletion
                  value: No datasets were deleted
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /datasets/{accession_id}:
    get:
      description: Get information of this dataset
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Dataset
          required: true
          schema: &ref_40
            type: string
            pattern: ^EGAD\d{11}$
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_38
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
    put:
      description: Update information of this dataset
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Dataset
          required: true
          schema: *ref_40
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses do NOT have an accession, use `analysis_provisional_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_provisional_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs does NOT have an accession, use `run_provisional_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_provisional_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
                - description: If the referenced runs HAVE an accession, use `run_accession_ids`. If the referenced analyses HAVE an accession, use `analysis_accession_ids`.
                  required:
                    - title
                    - description
                    - dataset_types
                    - policy_accession_id
                    - run_accession_ids
                    - analysis_accession_ids
                  type: object
                  properties: *ref_37
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties: *ref_39
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /datasets/rollback:
    put:
      description: Undo all the changes done to the datasets listed.
      tags:
        - Datasets
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              description: The dataset accession IDs
              items:
                type: string
                pattern: ^EGAD\d{11}$
                example: EGAD12345678901
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 10 datasets
                nothing:
                  summary: Nothing to rollback
                  value: No datasets were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /datasets/{accession_id}/rollback:
    put:
      description: Undo the changes done to this dataset.
      tags:
        - Datasets
      parameters:
        - name: accession_id
          in: path
          description: Accession ID of a Dataset
          required: true
          schema: *ref_40
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              examples:
                successful:
                  summary: Successfully rolled back
                  value: Successfully rolled back 1 datasets
                nothing:
                  summary: Nothing to rollback
                  value: No datasets were affected
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums:
    get:
      description: Get a list of all the enumerations available
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: status_type
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/status_types:
    get:
      description: Get the allowed values for an object status
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: open
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/study_types:
    get:
      description: Get the allowed values for the study types
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: Whole Genome Sequencing
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/biological_sex:
    get:
      description: Get the allowed values for biological sex
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: female
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/case_controls:
    get:
      description: Get the allowed values for case control
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: case
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/platform_models:
    get:
      description: Get the allowed values for platform models
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    id:
                      type: integer
                      example: 1
                    platform:
                      type: string
                      example: LS454
                    model:
                      type: string
                      example: 454 GS
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/library_layouts:
    get:
      description: Get the allowed values for library layouts
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: SINGLE
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/library_strategies:
    get:
      description: Get the allowed values for library strategies
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: WGS
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/library_sources:
    get:
      description: Get the allowed values for library sources
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: GENOMIC
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/library_selections:
    get:
      description: Get the allowed values for library selections
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: RANDOM
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/run_file_types:
    get:
      description: Get the allowed values for run file types
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    run_file_type:
                      type: string
                      example: srf
                    display_name:
                      type: string
                      example: SRF
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/analysis_types:
    get:
      description: Get the allowed values for analysis types
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: REFERENCE ALIGNMENT
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/experiment_types:
    get:
      description: Get the allowed values for experiment types
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: Whole genome sequencing
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/genomes:
    get:
      description: Get the allowed values for genomes
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    group_id:
                      type: integer
                      example: 1
                    id:
                      type: integer
                      example: 29
                    name:
                      type: string
                      example: NCBI36
                    accession:
                      type: string
                      example: GCF_000001405.12
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/chromosomes:
    get:
      description: Get the allowed values for chromosomes
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    genome_group_id:
                      type: integer
                      example: 1
                    id:
                      type: integer
                      example: 1
                    name:
                      type: string
                      example: chr1
                    accession:
                      type: string
                      example: NC_000001.9
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/dataset_types:
    get:
      description: Get the allowed values for dataset types
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  example: Whole genome sequencing
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
  /enums/repositories:
    get:
      description: Get the allowed values for repositories
      tags:
        - Enums
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  properties:
                    id:
                      type: integer
                      example: 2
                    name:
                      type: string
                      example: EuroBioimaging
                    icon:
                      type: string
                      example: data:image/jpeg;base64,/9j/4AAQSkZJRgABA...
        '400':
          description: Bad request
          content: *ref_0
        '502':
          description: Backend not available
          content: *ref_1
components:
  parameters:
    ProvisionalID:
      name: provisional_id
      in: path
      description: Provisional ID
      required: true
      schema: *ref_3
    SubmissionAccessionID:
      name: accession_id
      in: path
      description: Accession ID of a Submission
      required: true
      schema: *ref_5
    StudyAccessionID:
      name: accession_id
      in: path
      description: Accession ID of a Study
      required: true
      schema: *ref_28
    SampleAccessionID:
      name: accession_id
      in: path
      description: Accession ID of a Sample
      required: true
      schema: *ref_17
    ExperimentAccessionID:
      name: accession_id
      in: path
      description: Accession ID of an Experiment
      required: true
      schema: *ref_22
    RunAccessionID:
      name: accession_id
      in: path
      description: Accession ID of a Run
      required: true
      schema: *ref_32
    AnalysisAccessionID:
      name: accession_id
      in: path
      description: Accession ID of an Analysis
      required: true
      schema: *ref_36
    DatasetAccessionID:
      name: accession_id
      in: path
      description: Accession ID of a Dataset
      required: true
      schema: *ref_40
    DACAccessionID:
      name: accession_id
      in: path
      description: Accession ID of a DAC
      required: true
      schema: *ref_41
  schemas:
    SubmissionRequest:
      type: object
      properties: *ref_42
      required: *ref_43
    SubmissionPutRequest:
      type: object
      properties: *ref_6
      required: *ref_7
    SubmissionFinaliseRequest:
      type: object
      properties: *ref_9
      required: *ref_10
    SubmissionSimpleResponse:
      type: object
      properties: *ref_4
    SubmissionResponse:
      type: object
      properties: *ref_2
    CollaboratorResponse:
      type: object
      properties: *ref_8
    StudyRequest:
      type: object
      properties: *ref_25
      required: *ref_26
    StudySimpleResponse:
      type: object
      properties: *ref_27
    StudyResponse:
      type: object
      properties: *ref_24
    SampleRequest:
      type: object
      properties: *ref_14
      required: *ref_15
    SampleSimpleResponse:
      type: object
      properties: *ref_16
    SampleResponse:
      type: object
      properties: *ref_13
    ExperimentRequest:
      type: object
      description: You must provide either __study_provisional_id__ or __study_accession_id__ but not both
      properties: *ref_19
      required:
        - design_description
        - instrument_model_id
        - library_layout
        - library_strategy
        - library_source
        - library_selection
        - study_provisional_id
    ExperimentSimpleResponse:
      type: object
      properties: *ref_21
    ExperimentResponse:
      type: object
      properties: *ref_20
    RunRequest:
      type: object
      description: You must provide either __experiment_provisional_id__ or __experiment_accession_id__ but not both. You also must provide __sample_provisional_id__ or __sample_accession_id__ but not both
      properties: *ref_29
      required:
        - run_file_type
        - files
    RunSimpleResponse:
      type: object
      properties: *ref_31
    RunResponse:
      type: object
      properties: *ref_30
    AnalysisRequest:
      type: object
      description: You must provide either __experiment_provisional_id__ or __experiment_accession_id__ but not both. You also must provide __study_provisional_id__ or __study_accession_id__ but not both. Also __experiment_types__ and __genome_id__ are required if the analysis_type is not _SAMPLE_PHENOTYPE_
      properties: *ref_33
      required:
        - title
        - description
        - analysis_type
        - files
    AnalysisSimpleResponse:
      type: object
      properties: *ref_35
    AnalysisResponse:
      type: object
      properties: *ref_34
    FileResponse:
      type: object
      properties: *ref_11
    PolicyResponse:
      type: object
      properties: *ref_12
    DACResponse:
      type: object
      properties:
        accession_id:
          type: string
          description: The DAC accession ID
    DatasetRequest:
      type: object
      properties: *ref_37
      required:
        - title
        - description
        - dataset_types
        - policy_accession_id
    DatasetSimpleResponse:
      type: object
      properties: *ref_39
    DatasetResponse:
      type: object
      properties: *ref_38
    DatasetChangelogResponse:
      type: object
      properties: *ref_44
    ExtraAttributesType:
      type: array
      description: The extra attributes
      items: *ref_18
    RepositoryType:
      type: array
      description: The external references to other repositories
      items: *ref_23
    UserResponse:
      type: object
      properties: *ref_45
      example: *ref_46
  securitySchemes:
    token:
      type: http
      scheme: bearer
      bearerFormat: JWT
    oauth2:
      type: oauth2
      flows:
        password:
          tokenUrl: https://idp.test.ega-archive.org/realms/EGA/protocol/openid-connect/token
          scopes:
            openid: openid connect scope
  responses:
    '400':
      description: Bad request
      content: *ref_0
    '502':
      description: Backend not available
      content: *ref_1
