openapi: 3.0.2
servers:
  - url: https://api.flat.io/v2
info:
  contact:
    email: developers@flat.io
    name: Flat
    url: https://flat.io/developers/docs/api/
  description: |
    The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following:

    * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files
    * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI)
    * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments.

    The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body.
    The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/).
    This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).

    You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference).

    Getting Started and learn more:

    * [API Overview and introduction](https://flat.io/developers/docs/api/)
    * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html)
    * [SDKs](https://flat.io/developers/docs/api/sdks.html)
    * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html)
    * [Changelog](https://flat.io/developers/docs/api/changelog.html)
  termsOfService: https://flat.io/legal
  title: Flat API
  version: 2.13.0
  x-apisguru-categories:
    - media
    - collaboration
  x-logo:
    url: https://flat.io/img/logo-flat.svg
  x-origin:
    - format: openapi
      url: https://raw.githubusercontent.com/FlatIO/api-reference/master/spec/swagger.yaml
      version: "3.0"
  x-providerName: flat.io
tags:
  - description: |
      These API endpoints are related to the Flat account you are currently using. When using an OAuth2 access token, you can use [`GET /me`](#operation/getAuthenticatedUser) to get information about the account.
    name: Account
    x-displayName: Flat Account
  - description: |
      Sheet music is the main API object type available for all Flat account.
      Here is a typical lifecycle for a music score document on Flat:
        - An end user can **create a music score** or **import a document** using our [web interface](https://flat.io) or a third-party website/app (e.g. Google Drive) using this API (see [`POST /v2/scores`](#operation/createScore). The creation and import of music scores can be done with this single API endpoint. This one currently supports the [MusicXML](http://www.musicxml.com/) (compressed or not) and [MIDI](https://www.midi.org/specifications).
        - **List scores**:
          - The **owned scores** can be listed using the [collections API methods](#tag/Collection), especially [`GET /collections/{collection}/scores`](#operation/listCollectionScores).
          - The scores from a public account can be listed with [`GET /users/{user}/scores`](#operation/getUserScores).
          - Scores shared with a specific group can be listed with [`GET /groups/{group}/scores`](#operation/getGroupScores).
        - The metadata of a single score can be retrieved with [`GET /scores/{score}`](#operation/getScore).
        - Scores on Flat have **one or multiple revisions**: creating a new score will create a first revision. These **revisions can be listed** using [`GET /scores/{score}/revisions`](#operation/getScoreRevisions) and a specific **revision data can be downloaded** with [`GET /scores/{score}/revisions/{revision}/{format}`](#operation/getScoreRevisionData). New revisions can be created using our [sheet music editor](https://flat.io) or using [`POST /scores/{score}/revisions`](#operation/createScoreRevision) (this endpoint has similar parameters than during the score creation). The last revision of a document may not directly reflect the really last version of a music score: recent modifications can be made offline or not yet consolidated into a new revision. In average, a new revision is created every 100 modifications made with our editor.
        - Scores can be **shared publicly** by changing the privacy option with [`POST /scores/{score}`](#operation/editScore), or **individually shared** using the different collaborators API endpoints (see [`POST /scores/{score}/collaborators`](#operation/addScoreCollaborator)).
    name: Score
    x-displayName: Music scores
  - description: |
      Collections let you organize your content in a Flat account. They work like a regular _folder_ with some specificities:
        - Our design goal here is to create a system similar to a _book_ or a _playlist of songs_.
        - Collections can't have children collections (except the `trash` and `sharedWithMe` that are special collections).
        - Any score can be added to one or multiple collections. For example, you can have a single private score in two or more collections, or add any public or shared scores to one of your collections.

      All the collections don't have the same capabilities. Capabilities depend on the `type` of collection and the `rights` you have on a collection. They are available when [listing the collection](#operation/listCollections) or [retrieving the collection details](#operation/getCollection).

      At this time, only `private` privacy mode is widely available. Privacy modes `public`, `organizationPublic` and `privateLink`, and 1:1 sharing will be available in an upcoming update later this year.
    name: Collection
    x-displayName: Collections of music scores
  - description: Flat users
    name: User
  - description: Flat for Education organizations
    name: Organization
  - description: Flat for Education classes
    name: Class
  - description: Flat Groups
    name: Group
paths:
  /classes:
    get:
      operationId: listClasses
      parameters:
        - description: Filter the classes by state
          in: query
          name: state
          schema:
            default: active
            enum:
              - active
              - inactive
              - archived
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ClassDetails"
                type: array
          description: The list of classes
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
      summary: List the classes available for the current user
      tags:
        - Class
    post:
      description: |
        Classrooms on Flat allow you to create activities with assignments and post content to a specific group.

        When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group.

        If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated.

        You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response.
      operationId: createClass
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ClassCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The new class details
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Create a new class
      tags:
        - Class
      x-codegen-request-body-name: body
  "/classes/enroll/{enrollmentCode}":
    parameters:
      - description: |
          The enrollment code, available to the teacher in `ClassDetails`
        in: path
        name: enrollmentCode
        required: true
        schema:
          type: string
    post:
      description: |
        Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class.

        Flat will automatically add the user to the corresponding class group based on this role in the organization.
      operationId: enrollClass
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The new class details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Join a class
      tags:
        - Class
  "/classes/{class}":
    get:
      operationId: getClass
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The new class details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
      summary: Get the details of a single class
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
    put:
      description: |
        Update the meta information of the class
      operationId: updateClass
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ClassUpdate"
        description: Details of the Class
        required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The new class details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Update the class
      tags:
        - Class
      x-codegen-request-body-name: body
  "/classes/{class}/activate":
    parameters:
      - $ref: "#/components/parameters/class"
    post:
      description: |
        Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI.
      operationId: activateClass
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The class details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Activate the class
      tags:
        - Class
  "/classes/{class}/archive":
    delete:
      description: |
        Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
      operationId: unarchiveClass
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The class details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Unarchive the class
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
    post:
      description: |
        Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated.
      operationId: archiveClass
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ClassDetails"
          description: The class details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Archive the class
      tags:
        - Class
  "/classes/{class}/assignments":
    get:
      operationId: listAssignments
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Assignment"
                type: array
          description: List of assignments for the class
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
            - edu.assignments
            - edu.assignments.readonly
      summary: Assignments listing
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
    post:
      description: |
        Use this method as a teacher to create and post a new assignment to a class.

        If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course.
      operationId: createAssignment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentCreation"
        required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Assignment"
          description: The assignment has been created
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Assignment creation
      tags:
        - Class
      x-codegen-request-body-name: body
  "/classes/{class}/assignments/{assignment}/archive":
    delete:
      description: |
        Mark the assignment as `active`.
      operationId: unarchiveAssignment
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Assignment"
          description: The assignment details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Unarchive the assignment.
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
    post:
      description: |
        Archive the assignment
      operationId: archiveAssignment
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Assignment"
          description: The assignment details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Archive the assignment
      tags:
        - Class
  "/classes/{class}/assignments/{assignment}/copy":
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
    post:
      description: |
        Copy an assignment to a specified class.

        If the original assignment has a due date in the past, this new assingment will be created without a due date.

        If the new class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app.
      operationId: copyAssignment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentCopy"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Assignment"
          description: The new created assingment
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Copy an assignment
      tags:
        - Class
      x-codegen-request-body-name: body
  "/classes/{class}/assignments/{assignment}/submissions":
    get:
      operationId: getSubmissions
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AssignmentSubmission"
                type: array
          description: The submissions
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
            - edu.assignments
            - edu.assignments.readonly
      summary: List the students' submissions
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
    put:
      description: |
        Use this method as a student to create, update and submit a submission related to an assignment.
        Students can only set `attachments` and `submit`.
        Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id.
      operationId: createSubmission
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentSubmissionUpdate"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSubmission"
          description: The submission
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Create or edit a submission
      tags:
        - Class
      x-codegen-request-body-name: body
  "/classes/{class}/assignments/{assignment}/submissions/csv":
    get:
      description: Export list of submissions grades to a CSV file
      operationId: exportSubmissionsReviewsAsCsv
      responses:
        "200":
          content:
            text/csv:
              schema:
                format: binary
                type: string
          description: List of submissions
        default:
          content:
            text/csv:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
            - edu.assignments
            - edu.assignments.readonly
      summary: CSV Grades exports
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
  "/classes/{class}/assignments/{assignment}/submissions/excel":
    get:
      description: Export list of submissions grades to an Excel file
      operationId: exportSubmissionsReviewsAsExcel
      responses:
        "200":
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                format: binary
                type: string
          description: List of submissions
        default:
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
            - edu.assignments
            - edu.assignments.readonly
      summary: Excel Grades exports
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
  "/classes/{class}/assignments/{assignment}/submissions/{submission}":
    delete:
      description: |
        Use this method as a teacher to delete a submission and allow student to start over the assignment
      operationId: deleteSubmission
      parameters:
        - $ref: "#/components/parameters/class"
        - $ref: "#/components/parameters/assignment"
        - $ref: "#/components/parameters/submission"
      responses:
        "204":
          description: The submission has been deleted
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Delete a submission
      tags:
        - Class
      x-codegen-request-body-name: body
    get:
      operationId: getSubmission
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSubmission"
          description: A submission
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
            - edu.assignments
            - edu.assignments.readonly
      summary: Get a student submission
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
      - $ref: "#/components/parameters/submission"
    put:
      description: |
        Use this method as a teacher to update the different submission and give feedback.
        Teachers can only set `return`, `draftGrade` and `grade`
      operationId: editSubmission
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentSubmissionUpdate"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSubmission"
          description: The submission
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.assignments
      summary: Edit a submission
      tags:
        - Class
      x-codegen-request-body-name: body
  "/classes/{class}/assignments/{assignment}/submissions/{submission}/comments":
    get:
      operationId: getSubmissionComments
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AssignmentSubmissionComment"
                type: array
          description: The comments of the score
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this submission
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Submission not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.assignments
            - edu.assignments.readonly
      summary: List the feedback comments of a submission
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
      - $ref: "#/components/parameters/submission"
    post:
      operationId: postSubmissionComment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentSubmissionCommentCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSubmissionComment"
          description: The comment
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this submission
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Submission not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.assignments
      summary: Add a feedback comment to a submission
      tags:
        - Class
  "/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}":
    delete:
      operationId: deleteSubmissionComment
      responses:
        "204":
          description: The comment has been deleted
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.assignments
      summary: Delete a feedback comment to a submission
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
      - $ref: "#/components/parameters/submission"
      - $ref: "#/components/parameters/comment"
    put:
      operationId: updateSubmissionComment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignmentSubmissionCommentCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSubmissionComment"
          description: The comment
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this submission
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Submission not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.assignments
      summary: Update a feedback comment to a submission
      tags:
        - Class
  "/classes/{class}/assignments/{assignment}/submissions/{submission}/history":
    get:
      description: |
        For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories.
      operationId: getSubmissionHistory
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AssignmentSubmissionHistory"
                type: array
          description: The history of the submission
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this submission
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Submission not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.assignments
            - edu.assignments.readonly
      summary: Get the history of the submission
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - $ref: "#/components/parameters/assignment"
      - $ref: "#/components/parameters/submission"
  "/classes/{class}/students/{user}/submissions":
    get:
      description: |
        Use this method as a teacher to list all the assignment submissions sent by a student of the class
      operationId: listClassStudentSubmissions
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AssignmentSubmission"
                type: array
          description: The list of submissions
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
            - edu.classes.readonly
            - edu.assignments
            - edu.assignments.readonly
      summary: List the submissions for a student
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - description: Unique identifier of the user
        in: path
        name: user
        required: true
        schema:
          type: string
  "/classes/{class}/users/{user}":
    delete:
      description: |
        This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom.

        Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions.
      operationId: deleteClassUser
      responses:
        "204":
          description: The user has been removed from the class
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Remove a user from the class
      tags:
        - Class
    parameters:
      - $ref: "#/components/parameters/class"
      - description: Unique identifier of the user
        in: path
        name: user
        required: true
        schema:
          type: string
    put:
      description: |
        This method can be used by a teacher of the class to enroll another Flat user into the class.

        Only users that are part of your Organization can be enrolled in a class of this same Organization.

        When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization.
      operationId: addClassUser
      responses:
        "204":
          description: The user has been added to the class
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.classes
      summary: Add a user to the class
      tags:
        - Class
  /collections:
    get:
      description: |
        Use this method to list the user's collections contained in `parent` (by default in the `root` collection).
        If no sort option is provided, the collections are sorted by `creationDate` `desc`.

        Note that this method will not include the `parent` collection in the listing.
        For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`.
      operationId: listCollections
      parameters:
        - description: |
            List the collection contained in this `parent` collection.

            This option doesn't provide a complete multi-level collection support.
            When sharing a collection with someone, this one will have as `parent` `sharedWithMe`.
          in: query
          name: parent
          schema:
            default: root
            type: string
        - description: Sort
          in: query
          name: sort
          schema:
            enum:
              - creationDate
              - title
            type: string
        - description: Sort direction
          in: query
          name: direction
          schema:
            enum:
              - asc
              - desc
            type: string
        - description: This is the maximum number of objects that may be returned
          in: query
          name: limit
          schema:
            default: 25
            maximum: 100
            minimum: 1
            type: integer
        - description: |
            An opaque string cursor to fetch the next page of data.
            The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
          in: query
          name: next
          schema:
            type: string
        - description: |
            An opaque string cursor to fetch the previous page of data.
            The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
          in: query
          name: previous
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Collection"
                type: array
          description: List of collections
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
            - collections.readonly
      summary: List the collections
      tags:
        - Collection
    post:
      description: |
        This method will create a new collection and add it to your `root` collection.
      operationId: createCollection
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CollectionCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Collection"
          description: Collection created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Bad collection creation request
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
      summary: Create a new collection
      tags:
        - Collection
      x-codegen-request-body-name: body
  "/collections/{collection}":
    delete:
      description: |
        This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`.
      operationId: deleteCollection
      responses:
        "204":
          description: Collection deleted
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this collection
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Collection not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
      summary: Delete the collection
      tags:
        - Collection
    get:
      operationId: getCollection
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Collection"
          description: Collection details
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this collection
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Collection not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
            - collections.readonly
      summary: Get collection details
      tags:
        - Collection
    parameters:
      - description: |
          Unique identifier of the collection.
          The following aliases are supported:
          - `root`: The root collection of the account
          - `sharedWithMe`: Automatically contains new resources that have been shared individually
          - `trash`: Automatically contains resources that have been deleted
        in: path
        name: collection
        required: true
        schema:
          type: string
    put:
      operationId: editCollection
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CollectionModification"
        required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Collection"
          description: Collection details
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this collection
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Collection not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
      summary: Update a collection's metadata
      tags:
        - Collection
      x-codegen-request-body-name: body
  "/collections/{collection}/scores":
    get:
      description: |
        Use this method to list the scores contained in a collection.
        If no sort option is provided, the scores are sorted by `modificationDate` `desc`.
      operationId: listCollectionScores
      parameters:
        - description: Sort
          in: query
          name: sort
          schema:
            enum:
              - creationDate
              - modificationDate
              - title
            type: string
        - description: Sort direction
          in: query
          name: direction
          schema:
            enum:
              - asc
              - desc
            type: string
        - description: This is the maximum number of objects that may be returned
          in: query
          name: limit
          schema:
            default: 25
            maximum: 100
            minimum: 1
            type: integer
        - description: |
            An opaque string cursor to fetch the next page of data.
            The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
          in: query
          name: next
          schema:
            type: string
        - description: |
            An opaque string cursor to fetch the previous page of data.
            The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
          in: query
          name: previous
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreDetails"
                type: array
          description: List of scores
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
      summary: List the scores contained in a collection
      tags:
        - Collection
    parameters:
      - description: |
          Unique identifier of the collection.
          The following aliases are supported:
          - `root`: The root collection of the account
          - `sharedWithMe`: Automatically contains new resources that have been shared individually
          - `trash`: Automatically contains resources that have been deleted
        in: path
        name: collection
        required: true
        schema:
          type: string
      - description: |
          This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
        in: query
        name: sharingKey
        schema:
          type: string
  "/collections/{collection}/scores/{score}":
    delete:
      description: |
        This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection.
        This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections.
      operationId: deleteScoreFromCollection
      responses:
        "204":
          description: Score removed from the collection
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this collection
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Collection not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
      summary: Delete a score from the collection
      tags:
        - Collection
    parameters:
      - description: |
          Unique identifier of the collection.
          The following aliases are supported:
          - `root`: The root collection of the account
          - `sharedWithMe`: Automatically contains new resources that have been shared individually
          - `trash`: Automatically contains resources that have been deleted
        in: path
        name: collection
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
        in: query
        name: sharingKey
        schema:
          type: string
    put:
      description: |
        This operation will add a score to a collection. The default behavior will make the score available across multiple collections.
        You must have the capability `canAddScores` on the provided `collection` to perform the action.
      operationId: addScoreToCollection
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreDetails"
          description: Score details
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this collection or score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Collection or score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
            - collections.add_scores
      summary: Add a score to the collection
      tags:
        - Collection
  "/collections/{collection}/untrash":
    parameters:
      - description: |
          Unique identifier of the collection.
          The following aliases are supported:
          - `root`: The root collection of the account
          - `sharedWithMe`: Automatically contains new resources that have been shared individually
          - `trash`: Automatically contains resources that have been deleted
        in: path
        name: collection
        required: true
        schema:
          type: string
    post:
      description: |
        This method will restore the collection by removing it from the `trash` and add it back to the `root` collection.
      operationId: untrashCollection
      responses:
        "204":
          description: The score has been untrashed
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to manage this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - collections
      summary: Untrash a collection
      tags:
        - Collection
  "/groups/{group}":
    get:
      operationId: getGroupDetails
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GroupDetails"
          description: The group details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
            - edu.admin.users.readonly
            - edu.classes
            - edu.classes.readonly
      summary: Get group information
      tags:
        - Group
    parameters:
      - $ref: "#/components/parameters/group"
  "/groups/{group}/scores":
    get:
      description: |
        Get the list of scores shared with a group.
      operationId: getGroupScores
      parameters:
        - description: Filter the score forked from the score id `parent`
          in: query
          name: parent
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreDetails"
                type: array
          description: The group's scores
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: List group's scores
      tags:
        - Group
        - Score
    parameters:
      - $ref: "#/components/parameters/group"
  "/groups/{group}/users":
    get:
      operationId: listGroupUsers
      parameters:
        - description: |
            Filter the users by their source
          in: query
          name: source
          schema:
            enum:
              - googleClassroom
              - microsoftGraph
              - clever
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/UserPublic"
                type: array
          description: The list of users member of the group
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
            - edu.admin.users.readonly
            - edu.classes
            - edu.classes.readonly
      summary: List group's users
      tags:
        - Group
    parameters:
      - $ref: "#/components/parameters/group"
  /me:
    get:
      description: |
        Get details about the current authenticated User.
      operationId: getAuthenticatedUser
      parameters:
        - description: Only return the user id
          in: query
          name: onlyId
          schema:
            default: false
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserDetails"
          description: Current user details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - account.public_profile
            - account.education_profile
      summary: Get current user profile
      tags:
        - Account
  /organizations/invitations:
    get:
      operationId: listOrganizationInvitations
      parameters:
        - description: Filter users by role
          in: query
          name: role
          schema:
            enum:
              - user
              - teacher
              - admin
            type: string
        - description: This is the maximum number of objects that may be returned
          in: query
          name: limit
          schema:
            default: 50
            maximum: 1000
            minimum: 1
            type: integer
        - description: |
            An opaque string cursor to fetch the next page of data.
            The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
          in: query
          name: next
          schema:
            type: string
        - description: |
            An opaque string cursor to fetch the previous page of data.
            The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
          in: query
          name: previous
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/OrganizationInvitation"
                type: array
          description: List of invitations
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
            - edu.admin.users.readonly
      summary: List the organization invitations
      tags:
        - Organization
    post:
      description: |
        This method creates and sends invitation for teachers and admins.

        Invitations can only be used by new Flat users or users who are not part of the organization yet.

        If the email of the user is already associated to a user of your organization, the API will simply update the role of the existing user and won't send an invitation. In this case, the property `usedBy` will be directly filled with the uniquer identifier of the corresponding user.
      operationId: createOrganizationInvitation
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrganizationInvitationCreation"
        required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrganizationInvitation"
          description: New invitation created
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
      summary: Create a new invitation to join the organization
      tags:
        - Organization
      x-codegen-request-body-name: body
  "/organizations/invitations/{invitation}":
    delete:
      operationId: removeOrganizationInvitation
      responses:
        "204":
          description: The invitation has been removed
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
      summary: Remove an organization invitation
      tags:
        - Organization
    parameters:
      - description: Unique identifier of the invitation
        in: path
        name: invitation
        required: true
        schema:
          type: string
  /organizations/lti/credentials:
    get:
      operationId: listLtiCredentials
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/LtiCredentials"
                type: array
          description: The list of LTI Credentials
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not admin of an organization
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.lti
            - edu.admin.lti.readonly
      summary: List LTI 1.x credentials
      tags:
        - Organization
    post:
      description: |
        Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/).
      operationId: createLtiCredentials
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LtiCredentialsCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LtiCredentials"
          description: The LTI Credentials
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not admin of an organization
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.lti
      summary: Create a new couple of LTI 1.x credentials
      tags:
        - Organization
      x-codegen-request-body-name: body
  "/organizations/lti/credentials/{credentials}":
    delete:
      operationId: revokeLtiCredentials
      responses:
        "204":
          description: Credentials revoked
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not admin of an organization
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Credentials not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.lti
      summary: Revoke LTI 1.x credentials
      tags:
        - Organization
    parameters:
      - description: |
          Credentials unique identifier
        in: path
        name: credentials
        required: true
        schema:
          type: string
  /organizations/users:
    get:
      operationId: listOrganizationUsers
      parameters:
        - description: The order to sort the user list
          in: query
          name: sort
          schema:
            items:
              enum:
                - firstname
                - lastname
                - lastActivityDate
                - licenseExpirationDate
              type: string
            type: string
        - $ref: "#/components/parameters/sortDirection"
        - $ref: "#/components/parameters/next"
        - $ref: "#/components/parameters/previous"
        - $ref: "#/components/parameters/role"
        - $ref: "#/components/parameters/searchInputQuery"
        - $ref: "#/components/parameters/groupIds"
        - $ref: "#/components/parameters/noActiveLicense"
        - description: Filter users by license expiration date or `active` / `notActive`
          in: query
          name: licenseExpirationDate
          schema:
            items:
              type: string
            type: array
        - description: Return only user ids
          in: query
          name: onlyIds
          schema:
            type: boolean
        - description: This is the maximum number of objects that may be returned
          in: query
          name: limit
          schema:
            default: 25
            maximum: 1000
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/UserDetailsAdmin"
                type: array
          description: List of users
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
            - edu.admin.users.readonly
      summary: List the organization users
      tags:
        - Organization
    post:
      operationId: createOrganizationUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UserCreation"
        required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserDetailsAdmin"
          description: New user created
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
      summary: Create a new user account
      tags:
        - Organization
      x-codegen-request-body-name: body
  /organizations/users/count:
    get:
      operationId: countOrgaUsers
      parameters:
        - $ref: "#/components/parameters/role"
        - $ref: "#/components/parameters/searchInputQuery"
        - $ref: "#/components/parameters/groupIds"
        - $ref: "#/components/parameters/noActiveLicense"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/UserDetailsAdmin"
                type: integer
          description: Number of users
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
            - edu.admin.users.readonly
      summary: Count the organization users using the provided filters
      tags:
        - Organization
  "/organizations/users/{user}":
    delete:
      description: |
        This operation removes an account from Flat and its data, including:
        * The music scores created by this user (documents, history, comments, collaboration information)
        * Education related data (assignments and classroom information)
      operationId: removeOrganizationUser
      parameters:
        - description: |
            If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io.
            This operation will remove the education-related data from the account.
            Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal.
          in: query
          name: convertToIndividual
          schema:
            type: boolean
      responses:
        "204":
          description: User deleted
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
      summary: Remove an account from Flat
      tags:
        - Organization
    parameters:
      - description: |
          Unique identifier of the Flat account
        in: path
        name: user
        required: true
        schema:
          type: string
    put:
      operationId: updateOrganizationUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UserAdminUpdate"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserDetailsAdmin"
          description: User updated
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - edu.admin
            - edu.admin.users
      summary: Update account information
      tags:
        - Organization
      x-codegen-request-body-name: body
  /scores:
    post:
      description: |
        Use this API method to **create a new music score in the current User account**. You will need a MusicXML 3 (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document.

        This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`).

        The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups).

        If no `collection` is specified, the API will create the score in the most appropriate collection. This can be the `root` collection or a different collection based on the user's settings or API authentication method.
        If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones.
        You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`.
      operationId: createScore
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreDetails"
          description: Score created
        "400":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Bad score creation request
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Create a new score
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}":
    delete:
      description: |
        This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators.

        When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history.
        The score won't be accessible anymore after calling this method and the user's quota will directly be updated.

        When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections).
      operationId: deleteScore
      parameters:
        - description: If `true`, the score deletion will be scheduled to be done ASAP
          in: query
          name: now
          schema:
            default: false
            type: boolean
      responses:
        "204":
          description: The score has been removed
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to manage this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Delete a score
      tags:
        - Score
    get:
      description: |
        Get the details of a score identified by the `score` parameter in the URL.
        The currently authenticated user must have at least a read access to the document to use this API call.
      operationId: getScore
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreDetails"
          description: Score details
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota and this document is out of the granted quota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: Get a score's metadata
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
    put:
      description: |
        This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional.

        To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`).

        When editing the `title`, `subtitle`, `composer`, `lyricist`, `arranger` or `licenseText`, the metadatas will be instantly be updated, and a real-time action will be pushed to update the document lazily.
        This pending document modification will be automatically be saved as a new version by either a connected client or our internal versioning service.
      operationId: editScore
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreModification"
        required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreDetails"
          description: Score details
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Edit a score's metadata
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/collaborators":
    get:
      description: |
        This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document.

        Collaborators can be a single user (the object `user` will be populated) or a group (the object `group` will be populated).
      operationId: getScoreCollaborators
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ResourceCollaborator"
                type: array
          description: List of collaborators
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.readonly
            - scores
      summary: List the collaborators
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
    post:
      description: |
        Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource.
        - To add an existing Flat user to the resource, specify its unique identifier in the `user` property.
        - To invite an external user to the resource, specify its email in the `userEmail` property.
        - To add a Flat group to the resource, specify its unique identifier in the `group` property.
        - To update an existing collaborator, process the same request with different rights.
      operationId: addScoreCollaborator
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResourceCollaboratorCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResourceCollaborator"
          description: The newly added collaborator metadata
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to manage this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Add a new collaborator
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/collaborators/{collaborator}":
    delete:
      description: |
        Remove the specified collaborator from the score
      operationId: removeScoreCollaborator
      responses:
        "204":
          description: The collaborator has been removed
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to manage this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or collaborator not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Delete a collaborator
      tags:
        - Score
    get:
      description: |
        Get the information about a collaborator (User or Group).
      operationId: getScoreCollaborator
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResourceCollaborator"
          description: Collaborator information
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or collaborator not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.readonly
      summary: Get a collaborator
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group**
        in: path
        name: collaborator
        required: true
        schema:
          type: string
  "/scores/{score}/comments":
    get:
      description: This method lists the different comments added on a music score (documents and inline) sorted by their post dates.
      operationId: getScoreComments
      parameters:
        - description: Filter the comments by type
          in: query
          name: type
          schema:
            enum:
              - document
              - inline
            type: string
        - description: Sort
          in: query
          name: sort
          schema:
            enum:
              - date
            type: string
        - description: Sort direction
          in: query
          name: direction
          schema:
            enum:
              - asc
              - desc
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreComment"
                type: array
          description: The comments of the score
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.readonly
            - scores.social
            - scores
      summary: List comments
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
        in: query
        name: sharingKey
        schema:
          type: string
    post:
      description: |
        Post a document or a contextualized comment on a document.

        Please note that this method includes an anti-spam system for public scores. We don't guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a `403` HTTP error and hidden from other users when the `spam` property is `true`.
      operationId: postScoreComment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreCommentCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreComment"
          description: The new comment
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score, to post a comment, or your API call triggered our spam filter.
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.social
            - scores
      summary: Post a new comment
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/comments/{comment}":
    delete:
      operationId: deleteScoreComment
      responses:
        "204":
          description: The comment has been deleted
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score or not the original comment creator
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or comment not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.social
            - scores
      summary: Delete a comment
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of a sheet music comment
        in: path
        name: comment
        required: true
        schema:
          type: string
      - description: |
          This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
        in: query
        name: sharingKey
        schema:
          type: string
    put:
      operationId: updateScoreComment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreCommentUpdate"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreComment"
          description: The edited comment
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score or not the original comment creator
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.social
            - scores
      summary: Update an existing comment
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/comments/{comment}/resolved":
    delete:
      operationId: markScoreCommentUnresolved
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "204":
          description: The comment has been unmarked as resolved
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to unmark this comment as resolved
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or comment not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.social
            - scores
      summary: Mark the comment as unresolved
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of a sheet music comment
        in: path
        name: comment
        required: true
        schema:
          type: string
      - description: |
          This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
        in: query
        name: sharingKey
        schema:
          type: string
    put:
      operationId: markScoreCommentResolved
      responses:
        "204":
          description: The comment has been marked as resolved
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to mark this comment as resolved
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or comment not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores.social
            - scores
      summary: Mark the comment as resolved
      tags:
        - Score
  "/scores/{score}/fork":
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
    post:
      description: |
        This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`.

        When using a [Flat for Education](https://flat.io/edu) account, the inline and contextualized comments will be accessible in the child document.
      operationId: forkScore
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreFork"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreDetails"
          description: Score details
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Fork a score
      tags:
        - Score
        - Class
      x-codegen-request-body-name: body
  "/scores/{score}/revisions":
    get:
      description: |
        When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification.

        Depending the plan of the account, this list can be trunked to the few last revisions.
      operationId: getScoreRevisions
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreRevision"
                type: array
          description: List of revisions
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: List the revisions
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
    post:
      description: |
        Update a score by uploading a new revision for this one.
      operationId: createScoreRevision
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreRevisionCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreRevision"
          description: The new created revision metadata
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to modify this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Create a new revision
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/revisions/{revision}":
    get:
      description: |
        When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific
        revision metadata.
      operationId: getScoreRevision
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreRevision"
          description: Revision metadata
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: Get a score revision
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created.
        in: path
        name: revision
        required: true
        schema:
          type: string
      - description: |
          This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
        in: query
        name: sharingKey
        schema:
          type: string
  "/scores/{score}/revisions/{revision}/{format}":
    get:
      description: |
        Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML
        `mxl`/`xml`, MP3 `mp3`, WAV `wav`, MIDI `midi`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`.
      operationId: getScoreRevisionData
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
        - description: |
            An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids
            separated by commas. For example "59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87".
          in: query
          name: parts
          schema:
            type: string
        - description: |
            Only return files already generated and cached in Flat's production
            cache. If the file is not availabe, a 404 will be returned
          in: query
          name: onlyCached
          schema:
            type: boolean
        - description: |
            Returns a json with the `url` in it instead of redirecting
          in: query
          name: url
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                format: binary
                type: string
            application/vnd.recordare.musicxml:
              schema:
                format: binary
                type: string
            application/vnd.recordare.musicxml+xml:
              schema:
                format: binary
                type: string
            audio/midi:
              schema:
                format: binary
                type: string
            audio/mp3:
              schema:
                format: binary
                type: string
            audio/wav:
              schema:
                format: binary
                type: string
            image/png:
              schema:
                format: binary
                type: string
          description: Revision data
        "402":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Account overquota
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or associated file not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: Get a score revision data
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created.
        in: path
        name: revision
        required: true
        schema:
          type: string
      - description: The format of the file you will retrieve
        in: path
        name: format
        required: true
        schema:
          enum:
            - json
            - mxl
            - xml
            - mp3
            - wav
            - midi
            - thumbnail.png
            - synchronizationPoints
          type: string
  "/scores/{score}/submissions":
    get:
      description: |
        This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document.
      operationId: getScoreSubmissions
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AssignmentSubmission"
                type: array
          description: List of submissions
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: List submissions related to the score
      tags:
        - Score
        - Class
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
  "/scores/{score}/tracks":
    get:
      operationId: listScoreTracks
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
        - description: |
            An assignment id with which all the tracks returned will be related to
          in: query
          name: assignment
          schema:
            type: string
        - description: |
            If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track
          in: query
          name: listAutoTrack
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreTrack"
                type: array
          description: List of tracks
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: List the audio or video tracks linked to a score
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
    post:
      description: |
        Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score.
        This API method support medias hosted on SoundCloud, YouTube and Vimeo.
      operationId: addScoreTrack
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreTrackCreation"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreTrack"
          description: Created track
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Add a new video or audio track to the score
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/tracks/{track}":
    delete:
      operationId: deleteScoreTrack
      responses:
        "204":
          description: Track removed
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or Track not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Remove an audio or video track linked to the score
      tags:
        - Score
    get:
      operationId: getScoreTrack
      parameters:
        - description: |
            This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document.
          in: query
          name: sharingKey
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreTrack"
          description: Track details
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or Track not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: Retrieve the details of an audio or video track linked to a score
      tags:
        - Score
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
      - description: |
          Unique identifier of a score audio track
        in: path
        name: track
        required: true
        schema:
          type: string
    put:
      operationId: updateScoreTrack
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ScoreTrackUpdate"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScoreTrack"
          description: Updated track
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to access to this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score or Track not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Update an audio or video track linked to a score
      tags:
        - Score
      x-codegen-request-body-name: body
  "/scores/{score}/untrash":
    parameters:
      - description: |
          Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`).
        in: path
        name: score
        required: true
        schema:
          type: string
    post:
      description: |
        This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections.
      operationId: untrashScore
      responses:
        "204":
          description: The score has been untrashed
        "403":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Not granted to manage this score
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Score not found
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
      summary: Untrash a score
      tags:
        - Score
  "/users/{user}":
    get:
      description: |
        Get a public profile of a Flat User.
      operationId: getUser
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UserPublic"
          description: The user public details
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - account.public_profile
            - account.education_profile
      summary: Get a public user profile
      tags:
        - User
    parameters:
      - description: |
          This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user.
        in: path
        name: user
        required: true
        schema:
          type: string
  "/users/{user}/likes":
    get:
      operationId: gerUserLikes
      parameters:
        - description: Return only the identifiers of the scores
          in: query
          name: ids
          schema:
            type: boolean
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreDetails"
                type: array
          description: List of liked scores
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - account.public_profile
      summary: List liked scores
      tags:
        - User
        - Score
    parameters:
      - description: |
          Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user.
        in: path
        name: user
        required: true
        schema:
          type: string
  "/users/{user}/scores":
    get:
      description: |
        Get the list of public scores owned by a User.

        **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**.
        This method will no longer list private and shared scores, but only public scores of a Flat account.
        If you want to access to private scores, please use the [Collections API](#tag/Collection) instead.
      operationId: getUserScores
      parameters:
        - description: Filter the score forked from the score id `parent`
          in: query
          name: parent
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ScoreDetails"
                type: array
          description: The user scores
        default:
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FlatErrorResponse"
          description: Error
      security:
        - OAuth2:
            - scores
            - scores.readonly
      summary: List user's scores
      tags:
        - User
        - Score
    parameters:
      - description: |
          Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user.
        in: path
        name: user
        required: true
        schema:
          type: string
components:
  parameters:
    assignment:
      description: Unique identifier of the assignment
      in: path
      name: assignment
      required: true
      schema:
        type: string
    class:
      description: Unique identifier of the class
      in: path
      name: class
      required: true
      schema:
        type: string
    comment:
      description: Unique identifier of the comment
      in: path
      name: comment
      required: true
      schema:
        type: string
    group:
      description: |
        Unique identifier of a Flat group
      in: path
      name: group
      required: true
      schema:
        type: string
    groupIds:
      description: Filter users by group
      in: query
      name: group
      schema:
        items:
          type: string
        type: array
    limit:
      description: This is the maximum number of objects that may be returned
      in: query
      name: limit
      schema:
        default: 50
        maximum: 1000
        minimum: 1
        type: integer
    next:
      description: |
        An opaque string cursor to fetch the next page of data.
        The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
      in: query
      name: next
      schema:
        type: string
    noActiveLicense:
      description: Filter users who don't have an active license
      in: query
      name: noActiveLicense
      schema:
        type: boolean
    post:
      description: Unique identifier of the post
      in: path
      name: post
      required: true
      schema:
        type: string
    previous:
      description: |
        An opaque string cursor to fetch the previous page of data.
        The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data.
      in: query
      name: previous
      schema:
        type: string
    role:
      description: Filter users by role
      in: query
      name: role
      schema:
        items:
          enum:
            - user
            - teacher
            - admin
          type: string
        type: array
    searchInputQuery:
      description: The query to search
      in: query
      name: q
      schema:
        type: string
    sortDirection:
      description: Sort direction
      in: query
      name: direction
      schema:
        enum:
          - asc
          - desc
        type: string
    submission:
      description: Unique identifier of the submission
      in: path
      name: submission
      required: true
      schema:
        type: string
  schemas:
    Assignment:
      description: Assignment details
      example:
        attachments:
          - score: "0000000000000000"
            type: flat
          - type: link
            url: https://flat.io/developers
          - authorName: Flat
            authorUrl: https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw
            description: Discover Flat on https://flat.io
            html: <iframe width="560" height="315" src="https://www.youtube.com/embed/SNbRUiBZ4Uw" frameborder="0" allowfullscreen></iframe>
            thumbnailHeight: 1052
            thumbnailUrl: https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg
            thumbnailWidth: 1868
            title: Flat - The online collaborative music notation software
            type: video
            url: https://www.youtube.com/watch?v=SNbRUiBZ4Uw
        canvas:
          alternateLink: https://canvas.instructure.com/courses/00000/assignments/12345
          id: "12345"
        classroom: 58c4725345cd836264f0b29e
        creationDate: 2017-06-12T13:56:19.613000Z
        creator: 5832bf149995c4024bd6de7d
        description: Get started with Flat
        dueDate: 2017-07-12T13:56:19.613000Z
        googleClassroom:
          alternateLink: http://classroom.google.com/c/music-theory/a/first-assignment/detail
          id: "1235665432"
        lti:
          id: "12345"
        maxPoints: 100
        scheduledDate: 2017-06-18T13:56:19.613000Z
        state: active
        submissions:
          - assignment: 58c49068524c03ec576ca43c
            attachments:
              - score: 58c4955a226ffff257211a8d
                title: Hello - Student
                type: flat
            classroom: 58c4725345cd836264f0b29e
            creationDate: 2017-03-12T00:25:00.748000Z
            creator: 559eb5c7f0d4d5e46d03781d
            googleClassroom:
              alternateLink: http://classroom.google.com/c/music-theory/a/first-assignment/submissions/student/my-submission
              id: CgsI-00000000000
              state: turned_in
            id: 58c4955c226ffff257211a90
            submissionDate: 2017-03-12T00:25:22.748000Z
        title: My first assignment
      properties:
        attachments:
          items:
            $ref: "#/components/schemas/MediaAttachment"
          type: array
        canvas:
          description: A Canvas LMS assignment
          properties:
            alternateLink:
              description: Link to Canvas assignment
              type: string
            id:
              description: Unique identifier of the course on Canvas assignment
              type: string
          type: object
        classroom:
          description: The unique identifier of the class where this assignment was posted
          type: string
        cover:
          description: The URL of the cover to display
          type: string
        coverFile:
          description: The id of the cover to display
          type: string
        creationDate:
          description: The creation date of this assignment
          format: date-time
          type: string
        creator:
          description: |
            The User unique identifier of the creator of this assignment
          type: string
        description:
          description: Description and content of the assignment
          type: string
        dueDate:
          description: |
            The due date of this assignment, late submissions will be marked as
            paste due.
          format: date-time
          type: string
        googleClassroom:
          $ref: "#/components/schemas/GoogleClassroomCoursework"
        lti:
          description: An LTI assignment
          properties:
            id:
              description: Resource ID in the LMS
              type: string
          type: object
        maxPoints:
          description: |
            If set, the grading will be enabled for the assignement
          type: number
        mfc:
          description: A MusicFirst Classroom assignment
          properties:
            alternateLink:
              description: Link to MusicFirst Classroom task
              type: string
            id:
              description: Unique identifier of the course on MusicFirst Task
              type: string
          type: object
        microsoftGraph:
          $ref: "#/components/schemas/MicrosoftGraphAssignment"
        scheduledDate:
          description: |
            The publication (scheduled) date of the assignment.
            If this one is specified, the assignment will only be listed to the teachers of the class.
          format: date-time
          type: string
        state:
          description: State of the assignment
          enum:
            - draft
            - active
            - archived
          type: string
        submissions:
          items:
            $ref: "#/components/schemas/AssignmentSubmission"
          type: array
        title:
          description: Title of the assignment
          type: string
        type:
          $ref: "#/components/schemas/AssignmentType"
      type: object
    AssignmentCopy:
      description: Assignment copy operation
      example:
        classroom: "0000000000000000"
      properties:
        assignment:
          description: An optional destination assignment where the original assignement will be copied. Must be a draft.
          type: string
        classroom:
          description: The destination classroom where the assignment will be copied
          type: string
        scheduledDate:
          description: |
            The publication (scheduled) date of the assignment.
            If this one is specified, the assignment will only be listed to the teachers of the class.
            Alternatively the existing `scheduledDate` from the copied assignment will be used.
          format: date-time
          type: string
      type: object
    AssignmentCreation:
      description: Assignment creation details
      example:
        attachments:
          - score: "0000000000000000"
            type: flat
          - type: link
            url: https://flat.io/developers
        description: Get started with Flat
        dueDate: 2017-07-12T13:56:19.613000Z
        maxPoints: 100
        scheduledDate: 2017-06-20T13:56:19.613000Z
        title: First assignment
      properties:
        assignedStudents:
          description: Identifiers for the students that have access to the assignment
          items:
            type: string
          type: array
        assigneeMode:
          description: Possible modes of assigning assignments
          enum:
            - everyone
            - selected
          type: string
        attachments:
          items:
            $ref: "#/components/schemas/ClassAttachmentCreation"
          type: array
        cover:
          description: The URL of the cover to display
          nullable: true
          type: string
        coverFile:
          description: The id of the cover to display
          nullable: true
          type: string
        description:
          description: Description and content of the assignment
          type: string
        dueDate:
          description: |
            The due date of this assignment, late submissions will be marked as paste due. If not set, the assignment won't have a due date.
          format: date-time
          nullable: true
          type: string
        googleClassroom:
          description: Google Classroom options for this assignment
          properties:
            topicId:
              description: Identifier of the topic where the assignment is created
              nullable: true
              type: string
          type: object
        maxPoints:
          description: |
            If set, the grading will be enabled for the assignement with this value as the maximum of points
          maximum: 100
          minimum: 0
          nullable: true
          type: number
        microsoftGraph:
          description: Microsoft Graph options for this assignment
          properties:
            categories:
              description: List of categories this assignment belongs to
              items:
                type: string
              nullable: true
              type: array
          type: object
        nbPlaybackAuthorized:
          description: The number of playback authorized on the scores of the assignment.
          nullable: true
          type: number
        scheduledDate:
          description: |
            The publication (scheduled) date of the assignment.
            If this one is specified, the assignment will only be listed to the teachers of the class.
          format: date-time
          nullable: true
          type: string
        state:
          description: State of the assignment
          enum:
            - draft
            - active
          type: string
        title:
          description: Title of the assignment
          type: string
        toolset:
          description: The id of the associated toolset
          nullable: true
          type: string
        type:
          $ref: "#/components/schemas/AssignmentType"
      type: object
    AssignmentSubmission:
      description: Assignment Submission
      example:
        assignment: 58c49068524c03ec576ca43c
        attachments:
          - score: 58c4955a226ffff257211a8d
            title: Hello - Student
            type: flat
        classroom: 58c4725345cd836264f0b29e
        creationDate: 2020-08-12T00:25:00.748000Z
        creator: 559eb5c7f0d4d5e46d03781d
        draftGrade: 82
        googleClassroom:
          alternateLink: http://classroom.google.com/c/music-theory/a/first-assignment/submissions/student/my-submission
          id: CgsI-00000000000
          state: turned_in
        grade: 80
        id: 58c4955c226ffff257211a90
        returnCreator: 559eb5c7f0d4d5e46d000000
        returnDate: 2020-08-15T00:25:00.748000Z
        submissionDate: 2020-08-12T00:45:22.748000Z
      properties:
        assignment:
          description: Unique identifier of the assignment
          type: string
        attachments:
          items:
            $ref: "#/components/schemas/MediaAttachment"
          type: array
        classroom:
          description: |
            Unique identifier of the classroom where the assignment was posted
          type: string
        creationDate:
          description: The date when the submission was created
          type: string
        creator:
          description: The User identifier of the student who created the submission
          type: string
        draftGrade:
          description: Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission
          nullable: true
          type: number
        googleClassroom:
          $ref: "#/components/schemas/GoogleClassroomSubmission"
        grade:
          description: Optional grade. If unset, no grade was set.
          nullable: true
          type: number
        id:
          description: Unique identifier of the submission
          type: string
        maxPoints:
          description: Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set.
          type: number
        microsoftGraph:
          $ref: "#/components/schemas/MicrosoftGraphSubmission"
        returnCreator:
          description: |
            The User unique identifier of the teacher who returned the submission
          type: string
        returnDate:
          description: The date when the teacher returned the work
          type: string
        state:
          $ref: "#/components/schemas/AssignmentSubmissionState"
        submissionDate:
          description: The date when the student submitted his work
          type: string
      type: object
    AssignmentSubmissionComment:
      description: Feedback comment added to an assignment submission
      properties:
        comment:
          description: The comment text
          type: string
        date:
          description: The date when the comment was posted
          format: date-time
          type: string
        id:
          description: The comment unique identifier
          type: string
        modificationDate:
          description: The date of the last comment modification
          format: date-time
          type: string
        submission:
          description: The submission unique identifier
          type: string
        unread:
          description: True if the comment is unread by the current user
          type: boolean
        user:
          description: The author unique identifier
          type: string
      type: object
    AssignmentSubmissionCommentCreation:
      description: Creation of a assignment submission comment
      properties:
        comment:
          description: The comment text
          type: string
      required:
        - comment
      type: object
    AssignmentSubmissionHistory:
      description: History item of the submission
      properties:
        attachment:
          properties:
            revision:
              description: The revision identifier that changed
              type: string
            score:
              description: The score identifier that changed
              type: string
          type: object
        date:
          description: The date when the submission was changed
          format: date-time
          type: string
        draftGrade:
          description: The numerator of the grade at this time in the submission grade history
          type: number
        grade:
          description: The numerator of the grade at this time in the submission grade history
          type: number
        maxPoints:
          description: The denominator of the grade at this time in the submission grade history
          type: number
        state:
          $ref: "#/components/schemas/AssignmentSubmissionState"
        users:
          description: The user(s) unique identifier(s) who made the change
          items:
            type: string
          type: array
      type: object
    AssignmentSubmissionState:
      description: State of the submission
      enum:
        - created
        - turnedIn
        - returned
      type: string
    AssignmentSubmissionUpdate:
      description: Assignment Submission creation
      example:
        attachments:
          - score: 58c4955a226ffff257211a8d
            title: Hello - Student
            type: flat
        submit: true
      properties:
        attachments:
          items:
            $ref: "#/components/schemas/ClassAttachmentCreation"
          type: array
        comments:
          properties:
            total:
              description: The total number of comments added to the submission
              type: number
            unread:
              description: The number of unread comments for the current user
              type: number
          type: object
        draftGrade:
          description: Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission
          maximum: 100
          minimum: 0
          nullable: true
          type: number
        grade:
          description: Optional grade. If unset, no grade was set.
          maximum: 100
          minimum: 0
          nullable: true
          type: number
        return:
          description: If `true`, the submission will be marked as done
          type: boolean
        submit:
          description: If `true`, the submission will be marked as done
          type: boolean
      type: object
    AssignmentType:
      description: Type of the assignment
      enum:
        - none
        - newScore
        - scoreTemplate
        - sharedWriting
        - worksheet
        - performance
      type: string
    ClassAttachmentCreation:
      description: |
        Attachment creation for an assignment or stream post.
        This attachment must contain a `score` or an `url`, all the details of this one will be resolved and returned as `ClassAttachment` once the assignment or stream post is created.
      example:
        score: "000000000000000001"
        sharingMode: copy
        type: flat
      properties:
        googleDriveFileId:
          description: The ID of the Google Drive File
          type: string
        lockScoreTemplate:
          description: To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template.
          type: boolean
        score:
          description: |
            A unique Flat score identifier. The user creating the assignment must at least have read access to the document. If the user has admin rights, new group permissions will be automatically added for the
            teachers and students of the class.
          type: string
        sharingMode:
          $ref: "#/components/schemas/MediaScoreSharingMode"
        type:
          description: The type of the attachment posted
          enum:
            - flat
            - link
            - googleDrive
            - worksheet
          type: string
        url:
          description: The URL of the attachment.
          type: string
        worksheet:
          description: An unique worksheet identifier
          type: string
      type: object
    ClassCreation:
      description: Creation of a classroom
      example:
        name: Music Theory Course
        section: Music Theory 101
      properties:
        name:
          description: The name of the new class
          maxLength: 255
          type: string
        section:
          description: The section of the new class
          maxLength: 255
          type: string
      required:
        - name
      type: object
    ClassDetails:
      description: A classroom
      example:
        assignmentsCount: 10
        canvas:
          id: "000000000"
        creationTime: 2017-01-25T09:47:34.544000Z
        enrollmentCode: jm447ear
        googleClassroom:
          alternateLink: http://classroom.google.com/c/music-theory
          id: "00000000"
        googleDrive:
          teacherFolderAlternateLink: https://drive.google.com/drive/folders/0B-0000000000000000
          teacherFolderId: 0B-0000000000000000
        id: "100000000000000000000001"
        lti:
          contextId: "042"
          contextLabel: MUSIC
          contextTitle: Music Theory 101
        microsoftGraph:
          id: 00000000-0000-0000-0000-000000000000
        name: Music Theory 101
        organization: "100000000000000000000002"
        owner: "100000000000000000000003"
        section: Music Theory 101
        state: active
        theme: blue-8
      properties:
        assignmentsCount:
          description: The number of assignments created in the class
          type: number
        canvas:
          description: Meta information provided by Canvs LMS
          properties:
            domain:
              description: Canvas instance domain (e.g. "canvas.instructure.com")
              type: string
            id:
              description: Unique identifier of the course on Canvas
              type: string
          type: object
        clever:
          description: Clever.com section-related information
          properties:
            creationDate:
              description: The creation date of the section on clever
              format: date-time
              type: string
            id:
              description: Clever section unique identifier
              type: string
            modificationDate:
              description: The last modification date of the section on clever
              format: date-time
              type: string
            subject:
              description: Normalized subject of the course
              enum:
                - english/language arts
                - math
                - science
                - social studies
                - language
                - homeroom/advisory
                - interventions/online learning
                - technology and engineering
                - PE and health
                - arts and music
                - other
              type: string
            termEndDate:
              description: End date of the term
              format: date-time
              type: string
            termName:
              description: Name of the term when this course happens
              type: string
            termStartDate:
              description: Beginning date of the term
              format: date-time
              type: string
          type: object
        creationDate:
          description: The date when the class was create
          format: date-time
          type: string
        description:
          description: An optionnal description for this class
          type: string
        enrollmentCode:
          description: |
            [Teachers only] The enrollment code that can be used by the students to join the class
          type: string
        googleClassroom:
          description: Google Classroom course-related information
          properties:
            alternateLink:
              description: Absolute link to this course in the Classroom web UI
              type: string
            id:
              description: The course identifier on Google Classroom
              type: string
          type: object
        googleDrive:
          description: Google Drive course-related information provided by Google Classroom
          properties:
            teacherFolderAlternateLink:
              description: |
                [Teachers only] The Drive URL of the teachers' folder
              type: string
            teacherFolderId:
              description: |
                [Teachers only] The Drive directory identifier of the teachers' folder
              type: string
          type: object
        id:
          description: The unique identifier of the class
          type: string
        issues:
          description: Detected issues for this class
          properties:
            sync:
              description: Synchronization issues for the class
              items:
                description: A sync issue
                properties:
                  email:
                    description: The email address of the user concerned by this sync issue
                    type: string
                  id:
                    description: The account user identifier
                    type: string
                  reason:
                    description: The reason why the account cannot be synced
                    enum:
                      - otherOrgnanization
                      - personalSubscription
                    type: string
                type: object
              type: array
          type: object
        lti:
          description: Meta information provided by the LTI consumer
          properties:
            contextId:
              description: Unique context identifier provided
              type: string
            contextLabel:
              description: Context label
              type: string
            contextTitle:
              description: Context title
              type: string
          type: object
        mfc:
          description: Meta information provided by Canvs LMS
          properties:
            alternateLink:
              description: Link to MusicFirst Classroom class
              type: string
            id:
              description: Unique identifier of the course on MusicFirst Classroom
              type: string
          type: object
        microsoftGraph:
          properties:
            id:
              description: The course identifier on Microsoft Graph
              type: string
          type: object
        name:
          description: The name of the class
          type: string
        organization:
          description: The unique identifier of the Organization owning this class
          type: string
        owner:
          description: The unique identifier of the User owning this class
          type: string
        section:
          description: The section of the class
          type: string
        state:
          $ref: "#/components/schemas/ClassState"
        studentsGroup:
          $ref: "#/components/schemas/GroupDetails"
        teachersGroup:
          $ref: "#/components/schemas/GroupDetails"
        theme:
          description: The theme identifier using in Flat User Interface
          type: string
      type: object
    ClassRoles:
      description: User's Class Role (for Edu users only)
      enum:
        - teacher
        - student
      type: string
    ClassState:
      description: The state of a classroom
      enum:
        - active
        - inactive
        - archived
      type: string
    ClassUpdate:
      description: Update of a classroom
      example:
        name: Music Theory Course
        section: Music Theory 101
      properties:
        name:
          description: The name of the class
          maxLength: 255
          type: string
        section:
          description: The section of the class
          maxLength: 255
          type: string
      type: object
    Collection:
      description: Collection of scores
      properties:
        app:
          description: If this directory is dedicated to an app, the unique idenfier of this app
          type: string
        capabilities:
          description: Capabilities the current user has on this collection. Each capability corresponds to a fine-grained action that a user may take.
          properties:
            canAddScores:
              description: |
                Whether the current user can add scores to the collection

                If this collection has the `type` `trash`, this property will be set to `false`. Use `DELETE /v2/scores/{score}` to trash a score.
              type: boolean
            canDelete:
              description: |
                Whether the current user can delete the collection
              type: boolean
            canDeleteScores:
              description: |
                Whether the current user can delete scores from the collection

                If this collection has the `type` `trash`, this property will be set to `false`. Use `POST /v2/scores/{score}/untrash` to restore a score.
              type: boolean
            canEdit:
              description: |
                Whether the current user can modify the metadata for the collection
              type: boolean
            canShare:
              description: |
                Whether the current user can modify the sharing settings for the collection
              type: boolean
          type: object
        collaborators:
          description: The list of the collaborators of the collection
          items:
            $ref: "#/components/schemas/ResourceCollaborator"
          type: array
        collections:
          description: The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them.
          items:
            type: string
          type: array
        creationDate:
          description: The date when the collection was created
          format: date-time
          type: string
        htmlUrl:
          description: The url where the collection can be viewed in a web browser
          format: url
          type: string
        id:
          description: Unique identifier of the collection
          type: string
        privacy:
          $ref: "#/components/schemas/CollectionPrivacy"
        rights:
          $ref: "#/components/schemas/ResourceRights"
        sharingKey:
          description: The private sharing key of the collection (available when the `privacy` mode is set to `privateLink`)
          type: string
        title:
          description: The title of the collection
          type: string
        type:
          $ref: "#/components/schemas/CollectionType"
        user:
          $ref: "#/components/schemas/UserPublicSummary"
      type: object
    CollectionCreation:
      example:
        privacy: private
        title: Jazz scores
      properties:
        privacy:
          $ref: "#/components/schemas/CollectionPrivacy"
        title:
          description: The title of the collection
          maxLength: 300
          minLength: 1
          type: string
      required:
        - privacy
        - title
      type: object
    CollectionModification:
      description: Edit the collection metadata
      properties:
        privacy:
          $ref: "#/components/schemas/CollectionPrivacy"
        title:
          description: The title of the collection
          maxLength: 300
          minLength: 1
          type: string
      type: object
    CollectionPrivacy:
      description: |
        The collection main privacy mode.
        - `private`: The collection is private and can be only accessed, modified and administred by specified collaborators users.
      enum:
        - private
      type: string
    CollectionType:
      description: |
        Type of the collection.
        The type will influence the capabilitied available on the collections and how this collection is/can be populated.
      enum:
        - root
        - regular
        - sharedWithMe
        - sharedWithGroup
        - trash
      type: string
    FlatErrorResponse:
      description: An API Error response
      example:
        code: CLIENT_ERROR
        id: "123456789"
        message: Invalid request
      properties:
        code:
          description: A corresponding code for this error
          type: string
        id:
          description: An unique error identifier generated for the request
          type: string
        message:
          description: A printable message for this message
          type: string
        param:
          description: The related parameter that caused the error
          type: string
      type: object
    FlatLocales:
      default: en
      description: The user language
      enum:
        - en
        - en-GB
        - es
        - fr
        - de
        - it
        - ja
        - ko
        - nl
        - pl
        - pt
        - pt-BR
        - ro
        - ru
        - sv
        - tr
        - zh-Hans
      type: string
    GoogleClassroomCoursework:
      description: A coursework on Google Classroom
      example:
        alternateLink: http://classroom.google.com/c/music-theory/a/first-assignment/detail
        id: "1235665432"
        state: draft
      properties:
        alternateLink:
          description: Absolute link to this coursework in the Classroom web UI
          type: string
        id:
          description: Identifier of the coursework assigned by Classroom
          type: string
        state:
          description: State of the coursework
          type: string
        topicId:
          description: Identifier of the topic where the assignment is created
          nullable: true
          type: string
      type: object
    GoogleClassroomSubmission:
      description: A coursework submission on Google Classroom
      example:
        alternateLink: http://classroom.google.com/c/music-theory/a/first-assignment/submissions/student/my-submission
        id: CgsI-00000000000
        state: turned_in
      properties:
        alternateLink:
          description: Absolute link to this coursework in the Classroom web UI
          type: string
        id:
          description: Identifier of the coursework submission assigned by Classroom
          type: string
        state:
          description: State of the submission on Google Classroom
          type: string
      type: object
    Group:
      description: A group of users
      example:
        creationDate: 2015-01-19T00:22:02.387000Z
        id: "0000000000000000000000043"
        name: 5th grade
        organization: "0000000000000000000000042"
        readOnly: true
        type: classTeachers
        userCount: 24
      properties:
        creationDate:
          description: The creation date of the group
          format: date-time
          type: string
        id:
          description: The unique identifier of the group
          type: string
        name:
          description: The display name of the group
          type: string
        organization:
          description: |
            If the group is related to an organization, this field will contain
            the unique identifier of the organization
          type: string
        readOnly:
          description: |
            `True` if the group is set in read-only
          type: boolean
        type:
          description: |
            The type of the group:
            * `generic`: A group created by a Flat user
            * `classTeachers`: A group created automaticaly by Flat that contains
              the teachers of a class
            * `classStudents`: A group created automaticaly by Flat that contains
              the studnets of a class
          enum:
            - generic
            - classTeachers
            - classStudents
          type: string
        usersCount:
          description: The number of users in this group
          type: number
      type: object
    GroupDetails:
      description: The details of a group
      example:
        creationDate: 2017-07-02T15:02:40.207000Z
        id: 58c4955c226ffff257211a00
        name: 5th Grade - Teachers
        organization: "0000000000000000000000042"
        readOnly: false
        type: classTeachers
        usersCount: 2
      properties:
        creationDate:
          description: The date when the group was create
          format: date-time
          type: string
        id:
          description: The unique identifier of the group
          type: string
        name:
          description: The displayable name of the group
          type: string
        organization:
          description: The unique identifier of the Organization owning the group
          type: string
        readOnly:
          description: |
            `true` if the properties and members of this group are in in read-only
          type: boolean
        type:
          $ref: "#/components/schemas/GroupType"
        usersCount:
          description: The number of students in this group
          type: number
      type: object
    GroupType:
      description: The type of the group
      enum:
        - generic
        - classTeachers
        - classStudents
      type: string
    LicenseMode:
      description: Mode of the license
      enum:
        - credit
        - site
      type: string
    LicenseSources:
      default: order
      description: Source of the license
      enum:
        - order
        - trial
        - voucher
        - distributor
        - subscription
        - appStore
      type: string
    LmsName:
      description: LMS name
      enum:
        - canvas
        - moodle
        - schoology
        - blackboard
        - desire2learn
        - sakai
        - schoolbox
        - other
      type: string
    LtiCredentials:
      description: A couple of LTI 1.x OAuth credentials
      example:
        consumerKey: 200082F5-FAFD-4C6E-BB19-7DAB5D6264D4
        consumerSecret: 168b6181c05eae14298176a274273e4ebef0d15555fe3e80c6a98ccd57d0c3b6
        creationDate: 2017-06-06T11:03:01.955000Z
        creator: 5832bf149995c4024bd6de7d
        id: 59368be5c66caf895ee02387
        lastUsage: 2017-06-13T16:02:34.324000Z
        lms: canvas
        name: My couple of credentials for Canvas
        organization: 5832c801a4bedc05f4fb4993
      properties:
        consumerKey:
          description: OAuth 1 Consumer Key
          type: string
        consumerSecret:
          description: OAuth 1 Consumer Secret
          type: string
        creationDate:
          description: The creation date of thse credentials
          format: date-time
          type: string
        creator:
          description: Unique identifier of the user who created these credentials
          type: string
        id:
          description: The unique identifier of this couple of credentials
          type: string
        lastUsage:
          description: The last time these credentials were used
          format: date-time
          type: string
        lms:
          $ref: "#/components/schemas/LmsName"
        name:
          description: Name of the couple of credentials
          type: string
        organization:
          description: The unique identifier of the Organization associated to these credentials
          type: string
      type: object
    LtiCredentialsCreation:
      description: Creation of a couple of LTI 1.x OAuth credentials
      example:
        lms: canvas
        name: My couple of credentials for Canvas
      properties:
        lms:
          $ref: "#/components/schemas/LmsName"
        name:
          description: Name of the couple of credentials
          maxLength: 300
          type: string
      required:
        - lms
        - name
      type: object
    MediaAttachment:
      description: |
        Media attachment. The API will automatically resolve the details, oEmbed,
        and media available if possible and return them in this object
      example:
        authorName: Flat
        authorUrl: https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw
        description: Discover Flat on https://flat.io
        html: <iframe width="560" height="315" src="https://www.youtube.com/embed/SNbRUiBZ4Uw" frameborder="0" allowfullscreen></iframe>
        thumbnailHeight: 1052
        thumbnailUrl: https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg
        thumbnailWidth: 1868
        title: Flat - The online collaborative music notation software
        type: video
        url: https://www.youtube.com/watch?v=SNbRUiBZ4Uw
      properties:
        authorName:
          description: The resolved author name of the attachment
          type: string
        authorUrl:
          description: The resolved author url of the attachment
          type: string
        description:
          description: The resolved description of the attachment
          type: string
        googleDriveFileId:
          description: The ID of the Google Drive File
          type: string
        html:
          description: |
            If the attachment type is `rich` or `video`, the HTML code of the
            media to display
          type: string
        htmlHeight:
          description: If the `html` is available, the height of the widget
          type: string
        htmlWidth:
          description: If the `html` is available, the width of the widget
          type: string
        iconUrl:
          description: The URL of the icon
          type: string
        lockScoreTemplate:
          description: To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template.
          type: boolean
        mimeType:
          description: The mine type of the file
          type: string
        revision:
          description: An unique revision identifier of a score
          type: string
        score:
          description: An unique Flat score identifier
          type: string
        sharingMode:
          $ref: "#/components/schemas/MediaScoreSharingMode"
        thumbnailHeight:
          description: |
            If the `thumbnailUrl` is available, the width of the thumbnail
          type: integer
        thumbnailUrl:
          description: |
            If the attachment type is `rich`, `video`, `photo` or `link`, a
            displayable thumbnail for this attachment
          type: string
        thumbnailWidth:
          description: |
            If the `thumbnailUrl` is available, the width of the thumbnail
          type: integer
        title:
          description: The resolved title of the attachment
          type: string
        track:
          description: A unique track identifier
          type: string
        type:
          description: |
            The type of the assignment resolved:
            * `rich`, `photo`, `video` are attachment types that are automatically resolved from a `link` attachment.
            * A `flat` attachment is a score document where the unique identifier will be specified in the `score` property. Its sharing mode will be provided in the `sharingMode` property.
          enum:
            - rich
            - photo
            - video
            - link
            - flat
            - googleDrive
            - worksheet
            - performance
          type: string
        url:
          description: The url of the attachment
          type: string
        worksheet:
          description: An unique worksheet identifier
          type: string
      type: object
    MediaScoreSharingMode:
      default: read
      description: The sharing mode of the score for classes post and assignments
      enum:
        - read
        - write
        - copy
        - performance
      type: string
    MicrosoftGraphAssignment:
      description: A Microsoft Teams asignment
      example:
        alternateLink: https://teams.microsoft.com/l/entity
        categories:
          - 0a012acd-6e78-4cd0-89a9-80d296e48f82
        id: 8e460d32-d2d4-46b3-8e1a-9b7677a48fda
        state: draft
      properties:
        alternateLink:
          description: Absolute link to this assignement in the Microsoft Teams web UI
          type: string
        categories:
          description: List of categories where this assignment is published under
          items:
            description: A Microsoft Teams assignment category ID
            type: string
          type: array
        id:
          description: Identifier of the assignement assigned by Microsoft Teams
          type: string
        state:
          description: State of the assignment
          type: string
      type: object
    MicrosoftGraphSubmission:
      description: A Microsoft Teams submission
      example:
        alternateLink: https://teams.microsoft.com/l/entity
        id: 8e460d32-d2d4-46b3-8e1a-9b7677a48fda
        state: returned
      properties:
        alternateLink:
          description: Absolute link to this submission in the Microsoft Teams web UI
          type: string
        id:
          description: Identifier of the submission assigned by Microsoft Teams
          type: string
        state:
          description: State of the submission
          type: string
      type: object
    OrganizationInvitation:
      description: Details of an invitation to join an organization
      example:
        creationDate: 2017-07-02T15:05:15.576000Z
        customCode: u5raQ7pZ
        email: edu@flat.io
        id: 59590bab53b1af260610000
        invitedBy: 55b8d8f395c8db031ed00000
        organization: 55df29a6694e4a3953100000
        organizationRole: teacher
      properties:
        customCode:
          description: Enrollment code to use when joining this organization
          type: string
        email:
          description: The email address this invitation was sent to
          type: string
        id:
          description: The invitation unique identifier
          type: string
        invitedBy:
          description: The unique identifier of the User who created this invitation
          type: string
        organization:
          description: The unique identifier of the Organization owning this class
          type: string
        organizationRole:
          $ref: "#/components/schemas/OrganizationRoles"
        usedBy:
          description: The unique identifier of the User who used this invitation
          type: string
      type: object
    OrganizationInvitationCreation:
      description: The parameters to create an organization invitation
      example:
        email: edu@flat.io
        organizationRole: teacher
      properties:
        email:
          description: The email address you want to send the invitation to
          type: string
        organizationRole:
          $ref: "#/components/schemas/OrganizationRoles"
      type: object
    OrganizationRoles:
      description: User's Organization Role (for Edu users only)
      enum:
        - admin
        - billing
        - teacher
        - user
      type: string
    ResourceCollaborator:
      allOf:
        - $ref: "#/components/schemas/ResourceRights"
        - properties:
            collection:
              description: If this object is a permission of a collection, this property will contain the unique identifier of the collection
              type: string
            group:
              $ref: "#/components/schemas/Group"
            id:
              description: The unique identifier of the permission
              type: string
            invited:
              description: |
                If this property is `true`, this is still a pending invitation
              type: boolean
            score:
              description: If this object is a permission of a score, this property will contain the unique identifier of the score
              type: string
            user:
              $ref: "#/components/schemas/UserPublic"
            userEmail:
              description: |
                If the collaborator is not a user of Flat yet, this field will contain his email.
              type: string
          type: object
      description: |
        A collaborator of a score. The `userEmail` and `group` are only available if the requesting user is a collaborator of the related score (in this case these permissions will eventualy not be listed and exposed publicly).
    ResourceCollaboratorCreation:
      description: Add a collaborator to a resource.
      example:
        aclAdmin: false
        aclRead: true
        aclWrite: true
        userEmail: jdoe@flat.io
      properties:
        aclAdmin:
          default: false
          description: |
            `True` if the related user can can manage the current document, i.e. changing the document permissions and deleting the document
          type: boolean
        aclRead:
          default: true
          description: |
            `True` if the related user can read the score. (probably true if the user has a permission on the document).
          type: boolean
        aclWrite:
          default: false
          description: |
            `True` if the related user can modify the score.
          type: boolean
        group:
          description: The unique identifier of a Flat group
          type: string
        user:
          description: The unique identifier of a Flat user
          type: string
        userEmail:
          description: |
            Fill this field to invite an individual user by email.
          type: string
        userToken:
          description: |
            Token received in an invitation to join the score.
          type: string
      type: object
    ResourceRights:
      description: The rights of the current user on a score or collection
      example:
        aclAdmin: true
        aclRead: true
        aclWrite: true
        isCollaborator: true
      properties:
        aclAdmin:
          default: false
          description: |
            `True` if the current user can manage the current document (i.e. share, delete)

            If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection.
          type: boolean
        aclRead:
          default: false
          description: |
            `True` if the current user can read the current document
          type: boolean
        aclWrite:
          default: false
          description: |
            `True` if the current user can modify the current document.

            If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection.
          type: boolean
        isCollaborator:
          default: false
          description: |
            `True` if the current user is a collaborator of the current document (direct or via group).
          type: boolean
      type: object
    ScoreComment:
      description: Comment added on a sheet music
      example:
        comment: "@[000000000000000000000000:flat] Great work!"
        context:
          measureUuids:
            - e6a6a60b-8710-f819-9a49-e907b19c6f1f
            - da83d93c-e3a6-3c73-1bbe-15e5131d6437
            - 056ec5eb-9213-df56-6ae8-d9b99673dc48
          partUuid: 91982db7-2e6d-285e-7a19-76b4bd005b8b
          staffUuid: 9395d8f3-f42b-47b6-8c5d-6ba704961ec0
          startDpq: 1
          startTimePos: 2
          stopDpq: 1
          stopTimePos: 3
        date: 2017-01-26T20:29:10.622000Z
        id: "000000000000000000000010"
        mentions:
          - "000000000000000000000000"
        modificationDate: 2017-01-26T21:29:10.622000Z
        rawComment: "@flat: Great work!"
        replyTo: "000000000000000000000000"
        resolved: true
        resolvedBy: "000000000000000000000000"
        revision: "000000000000000000000011"
        score: "000000000000000000000042"
        spam: false
        type: inline
        user: "000000000000000000000001"
      properties:
        comment:
          description: |
            The comment text that can includes mentions using the following
            format: `@[id:username]`.
          type: string
        context:
          $ref: "#/components/schemas/ScoreCommentContext"
        date:
          description: The date when the comment was posted
          format: date-time
          type: string
        id:
          description: The comment unique identifier
          type: string
        mentions:
          description: The list of user identifier mentioned on the score
          items:
            type: string
          type: array
        modificationDate:
          description: The date of the last comment modification
          format: date-time
          type: string
        rawComment:
          description: |
            A raw version of the comment, that can be displayed without parsing
            the mentions.
          type: string
        replyTo:
          description: |
            When the comment is a reply to another comment, the unique identifier of the parent comment
          type: string
        resolved:
          description: |
            For inline comments, the comment can be marked as resolved and will be hidden in the future responses
          type: boolean
        resolvedBy:
          description: |
            If the user is marked as resolved, this will contain the unique identifier of the User who marked this comment as resolved
          type: string
        revision:
          description: The unique identifier of revision the comment was posted
          type: string
        score:
          description: The unique identifier of the score where the comment was posted
          type: string
        spam:
          description: |
            `true  if the message has been detected as spam and hidden from other users
          type: boolean
        type:
          description: The type of the comment
          enum:
            - document
            - inline
          type: string
        user:
          description: The author unique identifier
          type: string
      type: object
    ScoreCommentContext:
      description: |
        The context of the comment (for inline/contextualized comments). A context will include all the information related to the location of the comment (i.e. score parts, range of measure, time position).
      example:
        measureUuids:
          - e6a6a60b-8710-f819-9a49-e907b19c6f1f
          - da83d93c-e3a6-3c73-1bbe-15e5131d6437
          - 056ec5eb-9213-df56-6ae8-d9b99673dc48
        partUuid: 91982db7-2e6d-285e-7a19-76b4bd005b8b
        staffUuid: 9395d8f3-f42b-47b6-8c5d-6ba704961ec0
        startDpq: 1
        startTimePos: 2
        stopDpq: 1
        stopTimePos: 3
      properties:
        measureUuids:
          description: The list of measure UUIds
          items:
            type: string
          type: array
        partUuid:
          description: The unique identifier (UUID) of the score part
          type: string
        staffIdx:
          description: (Deprecated, use `staffUuid`) The identififer of the staff
          type: number
        staffUuid:
          description: The unique identififer (UUID) of the staff
          type: string
        startDpq:
          type: number
        startTimePos:
          type: number
        stopDpq:
          type: number
        stopTimePos:
          type: number
      required:
        - measureUuids
        - partUuid
        - startDpq
        - startTimePos
        - stopDpq
        - stopTimePos
      type: object
    ScoreCommentCreation:
      description: Creation of a comment
      example:
        comment: "@[000000000000000000000000:flat] Great work!"
        context:
          measureUuids:
            - e6a6a60b-8710-f819-9a49-e907b19c6f1f
            - da83d93c-e3a6-3c73-1bbe-15e5131d6437
            - 056ec5eb-9213-df56-6ae8-d9b99673dc48
          partUuid: 91982db7-2e6d-285e-7a19-76b4bd005b8b
          staffUuid: 9395d8f3-f42b-47b6-8c5d-6ba704961ec0
          startDpq: 1
          startTimePos: 2
          stopDpq: 1
          stopTimePos: 3
        mentions:
          - "000000000000000000000000"
        rawComment: "@flat: Great work!"
        replyTo: "000000000000000000000000"
        revision: "000000000000000000000010"
      properties:
        comment:
          description: |
            The comment text that can includes mentions using the following format: `@[id:username]`.
          type: string
        context:
          $ref: "#/components/schemas/ScoreCommentContext"
        mentions:
          description: The list of user identifiers mentioned in this comment
          items:
            type: string
          type: array
        rawComment:
          description: |
            A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set.
          type: string
        replyTo:
          description: |
            When the comment is a reply to another comment, the unique identifier of the parent comment
          type: string
        revision:
          description: |
            The unique indentifier of the revision of the score where the comment was added. If this property is unspecified or contains "last", the API will automatically take the last revision created.
          type: string
      required:
        - comment
      type: object
    ScoreCommentUpdate:
      description: Update of a comment
      example:
        comment: "@[000000000000000000000000:flat] Great work!"
        context:
          measureUuids:
            - e6a6a60b-8710-f819-9a49-e907b19c6f1f
            - da83d93c-e3a6-3c73-1bbe-15e5131d6437
            - 056ec5eb-9213-df56-6ae8-d9b99673dc48
          partUuid: 91982db7-2e6d-285e-7a19-76b4bd005b8b
          staffUuid: 9395d8f3-f42b-47b6-8c5d-6ba704961ec0
          startDpq: 1
          startTimePos: 2
          stopDpq: 1
          stopTimePos: 3
        mentions:
          - "000000000000000000000000"
        rawComment: "@flat: Great work!"
        replyTo: "000000000000000000000000"
        revision: "000000000000000000000011"
      properties:
        comment:
          description: |
            The comment text that can includes mentions using the following format: `@[id:username]`.
          maxLength: 10000
          minLength: 1
          type: string
        context:
          $ref: "#/components/schemas/ScoreCommentContext"
        rawComment:
          description: |
            A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set.
          maxLength: 10000
          minLength: 1
          type: string
        revision:
          description: |
            The unique indentifier of the revision of the score where the comment was added. If this property is unspecified or contains "last", the API will automatically take the last revision created.
          type: string
      type: object
    ScoreCommentsCounts:
      description: |
        A computed version of the total, unique, weekly and monthly number of
        comments added on the documents (this doesn't include inline comments).
      example:
        monthly: 30
        total: 42
        unique: 35
        weekly: 10
      properties:
        monthly:
          description: The monthly unique number of comments added to the score
          type: number
        total:
          description: The total number of comments added to the score
          type: number
        unique:
          description: The unique (1/user) number of comments added to the score
          type: number
        weekly:
          description: The weekly unique number of comments added to the score
          type: number
      type: object
    ScoreCreation:
      description: A new created score
      example:
        data: <score-partwise version="3.0"></score-partwise>
        googleDriveFolder: 0B-0000000000000000
        privacy: private
        title: My new score
      properties:
        collection:
          description: |
            Unique identifier of a collection where the score will be created.
            If no collection identifier is provided, the score will be stored in the `root` directory.
          type: string
        data:
          description: |
            The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file.
            Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request.
          example: <score-partwise version="3.0"></score-partwise>
          type: string
        dataEncoding:
          description: The optional encoding of the score data. This property must match the encoding used for the `data` property.
          enum:
            - base64
          type: string
        filename:
          description: If this is an imported file, its filename
          type: string
        googleDriveFolder:
          description: |
            If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory.
          type: string
        privacy:
          $ref: "#/components/schemas/ScorePrivacy"
        source:
          $ref: "#/components/schemas/ScoreSource"
        title:
          description: |
            The title of the new score. If the title is too long, the API may trim this one.

            If this title is not specified, the API will try to (in this order):
              - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files).
              - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property
              - Set a default title (e.g. "New Music Score")
          type: string
      required:
        - privacy
      type: object
    ScoreCreationType:
      description: The type of creation (an orginal, an arrangement)
      enum:
        - original
        - arrangement
        - other
      type: string
    ScoreDetails:
      allOf:
        - $ref: "#/components/schemas/ScoreSummary"
        - properties:
            arranger:
              description: Arranger of the score
              type: string
            collaborators:
              description: The list of the collaborators of the score
              items:
                $ref: "#/components/schemas/ResourceCollaborator"
              type: array
            collections:
              description: The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them.
              items:
                type: string
              type: array
            comments:
              $ref: "#/components/schemas/ScoreCommentsCounts"
            composer:
              description: Composer of the score
              type: string
            creationDate:
              description: The date when the score was created
              format: date-time
              type: string
            creationType:
              $ref: "#/components/schemas/ScoreCreationType"
            description:
              description: Description of the creation
              type: string
            durationTime:
              description: In seconds, an approximative duration of the score
              type: number
            googleDriveFileId:
              description: |
                If the user uses Google Drive and the score exists on Google Drive, this field will contain the unique identifier of the Flat score on Google Drive. You can access the document using the url: `https://drive.google.com/open?id={googleDriveFileId}`
              type: string
            instruments:
              description: |
                An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`.
              items:
                type: string
              type: array
            license:
              $ref: "#/components/schemas/ScoreLicense"
            licenseText:
              description: Additional license text written on the exported/printed score
              type: string
            likes:
              $ref: "#/components/schemas/ScoreLikesCounts"
            lyricist:
              description: Lyricist of the score
              type: string
            mainTempoQpm:
              description: The main tempo of the score (in QPM)
              type: number
            modificationDate:
              description: The date of the last revision of the score
              format: date-time
              type: string
            numberMeasures:
              description: The number of measures in the score
              type: integer
            organization:
              description: |
                If the score has been created in an organization, the identifier of this organization. This property is especially used with the score privacy `organizationPublic`.
              type: string
            parentScore:
              description: |
                If the score has been forked, the unique identifier of the parent score.
              type: string
            plays:
              $ref: "#/components/schemas/ScorePlaysCounts"
            publicationDate:
              description: The date when the score was published on Flat
              format: date-time
              type: string
            rights:
              $ref: "#/components/schemas/ResourceRights"
            samples:
              description: |
                An array of the audio samples identifiers used the different score parts.
                The format of the strings is `{instrument-group}.{sample-id}`.
              items:
                type: string
              type: array
            subtitle:
              description: Subtitle of the score
              type: string
            tags:
              description: Tags describing the score
              items:
                pattern: ^[a-zA-Z0-9]{1,30}$
                type: string
              type: array
            views:
              $ref: "#/components/schemas/ScoreViewsCounts"
          type: object
      description: The score and all its details
    ScoreFork:
      description: Options to fork the score
      properties:
        collection:
          default: root
          description: |
            Unique identifier of a collection where the score will be copied.
            If no collection identifier is provided, the score will be stored in the `root` directory.
          type: string
      type: object
    ScoreLicense:
      description: |
        License of the creation. Read more about the Creative Commons licenses on https://creativecommons.org/licenses/
      enum:
        - copyright
        - cc0
        - cc-by
        - cc-by-sa
        - cc-by-nd
        - cc-by-nc
        - cc-by-nc-sa
        - cc-by-nc-nd
      type: string
    ScoreLikesCounts:
      description: |
        A computed version of the weekly, monthly and total of number of likes
        for a score
      example:
        monthly: 30
        total: 42
        weekly: 10
      properties:
        monthly:
          description: The number of new likes during the last month
          type: number
        total:
          description: The total number of likes of the score
          type: number
        weekly:
          description: The number of new likes during the last week
          type: number
      type: object
    ScoreModification:
      description: Edit the score metadata
      example:
        privacy: private
      properties:
        arranger:
          description: The arranger of the score
          type: string
        composer:
          description: The composer of the score
          type: string
        creationType:
          $ref: "#/components/schemas/ScoreCreationType"
        description:
          description: Description of the creation
          maxLength: 2000
          type: string
        license:
          $ref: "#/components/schemas/ScoreLicense"
        licenseText:
          description: The rights info written on the score
          type: string
        lyricist:
          description: The lyricist of the score
          type: string
        privacy:
          $ref: "#/components/schemas/ScorePrivacy"
        sharingKey:
          description: When using the `privacy` mode `privateLink`, this property can be used to set a custom sharing key, otherwise a new key will be generated.
          pattern: ^[a-f0-9]{128}$
          type: string
        subtitle:
          description: The subtitle of the score
          type: string
        tags:
          description: Tags describing the score
          items:
            type: string
          type: array
        title:
          description: The title of the score
          type: string
      type: object
    ScorePlaysCounts:
      description: |
        A computed version of the total, weekly, and monthly number of plays of
        the score
      example:
        monthly: 30
        total: 42
        weekly: 10
      properties:
        monthly:
          description: The monthly number of plays of the score
          type: number
        total:
          description: The total number of plays of the score
          type: number
        weekly:
          description: The weekly number of plays of the score
          type: number
      type: object
    ScorePrivacy:
      description: |
        The score main privacy mode.

        - `public`: The score is public on the Internet. This one can be accessible at the url `https://flat.io/score/{score}` and can be modified and administred by specified collaborators users.
        - `private`: The score is private and can be only accessed, modified and administred by specified collaborators users.
        - `privateLink`: The score is private but can be accessed using a private link `htmlUrl` or the private key in the property `sharingKey`.
        - `organizationPublic`: _Available only with [Flat for Education](https://flat.io/edu)._ The score is public in the organization: users of the same organization can access to this one. The score can be modified and administred by specified collaborators users.

        The score can also be individually shared to a set of users or groups using the different collaborators API methods.

        When a file is synchronized from an external source (e.g. Google Drive) and the sharing options are changed on the source, Flat will chose the best privacy mode for the file.

        When using a [Flat for Education](https://flat.io/edu) account, some of the modes may not be available if disabled by an administrator of the organization (e.g. by default the `public` mode is not available).
      enum:
        - public
        - private
        - organizationPublic
        - privateLink
      type: string
    ScoreRevision:
      description: A score revision metadata
      example:
        autosave: true
        collaborators:
          - "000000000000000000000010"
          - "000000000000000000000020"
        creationDate: 2017-01-26T20:29:10.622000Z
        description: New revision
        user: "000000000000000000000020"
      properties:
        autosave:
          description: |
            True if this revision was automatically generated by Flat and not on
            purpose by the user.
          type: boolean
        collaborators:
          items:
            description: |
              The list of user identifier or collaborators who worked on this
              revision. This is list is built from the history of the revision
              specified during the creation of the revision.
            type: string
          type: array
        creationDate:
          description: The date when this revision was created
          format: date-time
          type: string
        description:
          description: A description associated to the revision
          type: string
        event:
          description: The last event (action id) of the revision
          type: string
        id:
          description: The unique identifier of the revision.
          type: string
        statistics:
          $ref: "#/components/schemas/ScoreRevisionStatistics"
        user:
          description: The user identifier who created the revision
          type: string
      type: object
    ScoreRevisionCreation:
      description: A new created revision
      example:
        autosave: true
        data: <score-partwise version="3.0"></score-partwise>
        description: New revision
        history:
          - args:
              measureUuid: 0be9f739-3213-f312-bb0a-00ad0c787ef7
              previousUuid: 888cb742-2110-a050-ba71-28300ba6d61f
            fnc: action.AddMeasure
            id: b278ad43-2e99-4e60-a782-ac119b294ab8
            userId: "000000000000000000000010"
      properties:
        autosave:
          description: |
            Must be set to `true` if the revision was created automatically.
          type: boolean
        data:
          description: |
            The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file.
            Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request.
          example: <score-partwise version="3.0"></score-partwise>
          type: string
        dataEncoding:
          description: The optional encoding of the score data. This property must match the encoding used for the `data` property.
          enum:
            - base64
          type: string
        description:
          description: A description associated to the revision
          type: string
      required:
        - data
      type: object
    ScoreRevisionStatistics:
      description: |
        The statistics related to the score revision (additions and deletions)
      example:
        additions: 24
        deletions: 5
      properties:
        additions:
          description: The number of additions operations in the last revision
          type: number
        deletions:
          description: The number of deletions operations in the last revision
          type: number
      type: object
    ScoreSource:
      example:
        googleDrive: 0B-0000000000000001
      properties:
        googleDrive:
          description: |
            If the score is a file on Google Drive, this field property must contain its identifier. To use this method, the Drive file must be public or the Flat Drive App must have access to the file.
          type: string
      type: object
    ScoreSummary:
      description: A summary of the score details
      example:
        htmlUrl: https://flat.io/score/000000000000000000000000
        id: "000000000000000000000000"
        privacy: private
        title: My score
        user:
          id: "000000000000000000000001"
          name: Flat Team
          picture: https://flat.io/img/logo_flat.svg
          printableName: Flat Team
          username: flat
      properties:
        htmlUrl:
          description: The url where the score can be viewed in a web browser
          format: url
          type: string
        id:
          description: The unique identifier of the score
          type: string
        privacy:
          $ref: "#/components/schemas/ScorePrivacy"
        sharingKey:
          description: The private sharing key of the score (available when the `privacy` mode is set to `privateLink`)
          type: string
        title:
          description: The title of the score
          type: string
        user:
          $ref: "#/components/schemas/UserPublicSummary"
      type: object
    ScoreTrack:
      description: An audio track for a score
      example:
        creationDate: 2017-10-22T14:58:22.753000Z
        creator: 5815d4b53269d90d2c80b71c
        default: true
        id: 59ecb20e563736b1e1f75dce
        mediaId: dQw4w9WgXcQ
        modificationDate: 2017-10-22T14:58:33.424000Z
        score: 59a29d96f35a6411d7508bdd
        state: completed
        synchronizationPoints:
          - measureUuid: 5132a788-69e6-d0c6-84ec-4bd858658d7c
            time: 0
            type: measure
          - time: 213
            type: end
        title: Rick Astley - Never Gonna Give You Up
        type: youtube
        url: https://www.youtube.com/watch?v=dQw4w9WgXcQ
      properties:
        creationDate:
          description: The creation date of the track
          format: date-time
          type: string
        creator:
          description: The unique identifier of the track creator
          type: string
        default:
          description: True if the track should be used as default audio source
          type: boolean
        id:
          description: The unique identifier of the score track
          type: string
        mediaId:
          description: |
            The unique identifier of the track when hosted on an external service.
            For example, if the url is `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `mediaId` will be `dQw4w9WgXcQ`
          type: string
        modificationDate:
          description: The modification date of the track
          format: date-time
          type: string
        score:
          description: The unique identifier of the score
          type: string
        state:
          $ref: "#/components/schemas/ScoreTrackState"
        synchronizationPoints:
          items:
            $ref: "#/components/schemas/ScoreTrackPoint"
          type: array
        title:
          description: Title of the track
          type: string
        type:
          $ref: "#/components/schemas/ScoreTrackType"
        url:
          description: The URL of the track
          type: string
      type: object
    ScoreTrackCreation:
      description: |
        Creation of a new track. This one must contain the URL of the track or the corresponding file
      example:
        default: true
        state: draft
        synchronizationPoints:
          - measureUuid: 5132a788-69e6-d0c6-84ec-4bd858658d7c
            time: 0
            type: measure
          - time: 213
            type: end
        title: Rick Astley - Never Gonna Give You Up
        url: https://www.youtube.com/watch?v=dQw4w9WgXcQ
      properties:
        default:
          description: True if the track should be used as default audio source
          type: boolean
        state:
          $ref: "#/components/schemas/ScoreTrackState"
        synchronizationPoints:
          items:
            $ref: "#/components/schemas/ScoreTrackPoint"
          type: array
        title:
          description: Title of the track
          type: string
        url:
          description: The URL of the track
          type: string
      type: object
    ScoreTrackPoint:
      description: A track synchronization point
      example:
        measureUuid: 5132a788-69e6-d0c6-84ec-4bd858658d7c
        time: 0
        type: measure
      properties:
        measureUuid:
          description: The measure unique identifier
          format: uuid
          type: string
        time:
          description: The corresponding time in seconds
          type: number
        type:
          description: The type of the synchronization point. If the type is `measure`, the measure uuid must be present in `measureUuid`
          enum:
            - measure
            - end
          type: string
      required:
        - time
        - type
      type: object
    ScoreTrackState:
      default: draft
      description: State of the track
      enum:
        - draft
        - completed
        - deleted
      type: string
    ScoreTrackType:
      description: The type of an audio track
      enum:
        - audio
        - soundcloud
        - youtube
        - vimeo
      type: string
    ScoreTrackUpdate:
      description: |
        Update an existing track.
      example:
        default: true
        state: draft
        synchronizationPoints:
          - measureUuid: 5132a788-69e6-d0c6-84ec-4bd858658d7c
            time: 0
            type: measure
          - time: 213
            type: end
        title: Rick Astley - Never Gonna Give You Up
        url: https://www.youtube.com/watch?v=dQw4w9WgXcQ
      properties:
        default:
          description: True if the track should be used as default audio source
          type: boolean
        state:
          $ref: "#/components/schemas/ScoreTrackState"
        synchronizationPoints:
          items:
            $ref: "#/components/schemas/ScoreTrackPoint"
          type: array
        title:
          description: Title of the track
          type: string
      type: object
    ScoreViewsCounts:
      description: |
        A computed version of the total, weekly, and monthly number of views of
        the score
      example:
        monthly: 30
        total: 42
        weekly: 10
      properties:
        monthly:
          description: The monthly number of views of the score
          type: number
        total:
          description: The total number of views of the score
          type: number
        weekly:
          description: The weekly number of views of the score
          type: number
      type: object
    UserAdminUpdate:
      description: User update as an organization admin
      properties:
        email:
          description: Email of the account
          format: email
          type: string
        firstname:
          description: First name of the user
          maxLength: 60
          type: string
        lastname:
          description: Last name of the user
          maxLength: 60
          type: string
        organizationRole:
          $ref: "#/components/schemas/OrganizationRoles"
        password:
          description: Password of the account
          format: password
          maxLength: 1000
          minLength: 6
          type: string
        username:
          description: Username of the account
          maxLength: 30
          minLength: 1
          pattern: ^[A-Za-z0-9\-_.]+$
          type: string
      type: object
    UserBasics:
      discriminator:
        propertyName: type
      example:
        id: "000000000000000000000001"
        isFlatTeam: true
        isPowerUser: true
        name: Flat Team
        picture: https://flat.io/img/logo_flat.svg
        printableName: Flat Team
        username: flat
      properties:
        firstname:
          description: Firstname of the user (for education users)
          type: string
        id:
          description: The user unique identifier
          type: string
        isFlatTeam:
          description: Will be 'true' if user is part of the Flat Team
          type: boolean
        isPowerUser:
          description: User license status. 'true' if user is an individual Power user
          type: boolean
        lastname:
          description: Lastname of the user (for education users)
          type: string
        name:
          description: A displayable name for the user (for consumer users)
          type: string
        picture:
          description: The URL of the picture to display
          nullable: true
          type: string
        printableName:
          description: The name that can be directly printed (name, firstname & lastname, or username)
          type: string
        type:
          description: The type of user account
          enum:
            - user
            - guest
          type: string
        username:
          description: The user name (unique for the organization)
          type: string
      type: object
    UserCreation:
      description: User creation
      properties:
        email:
          description: Email of the new account
          format: email
          type: string
        firstname:
          description: First name of the user
          maxLength: 60
          type: string
        lastname:
          description: Last name of the user
          maxLength: 60
          type: string
        locale:
          $ref: "#/components/schemas/FlatLocales"
        password:
          description: Password of the new account
          format: password
          maxLength: 1000
          minLength: 6
          type: string
        username:
          description: Username of the new account
          maxLength: 30
          minLength: 1
          pattern: ^[A-Za-z0-9\-_.]+$
          type: string
      required:
        - password
        - username
      type: object
    UserDetails:
      allOf:
        - $ref: "#/components/schemas/UserPublic"
        - properties:
            coverPictureFile:
              description: The ID of the user profile cover picture
              nullable: true
              type: string
            id:
              description: Identifier of the user
              type: string
            locale:
              $ref: "#/components/schemas/FlatLocales"
            pictureFile:
              description: The ID of the user profile picture
              nullable: true
              type: string
            privateProfile:
              description: Tell either this user profile is private or not (individual accounts only)
              type: boolean
            type:
              description: The type of account
              enum:
                - user
                - guest
              type: string
          type: object
      description: User details
    UserDetailsAdmin:
      allOf:
        - $ref: "#/components/schemas/UserPublicSummary"
        - properties:
            email:
              description: Email of the user
              format: email
              type: string
            lastActivityDate:
              description: Date of the last user activity
              format: date-time
              type: string
            license:
              description: Current active license of the user
              properties:
                active:
                  description: ID of the current license
                  type: boolean
                expirationDate:
                  description: Date when the license expires
                  format: date-time
                  type: string
                id:
                  description: ID of the current license
                  type: string
                mode:
                  $ref: "#/components/schemas/LicenseMode"
                source:
                  $ref: "#/components/schemas/LicenseSources"
              type: object
          type: object
      description: User details (view for organization teacher / admin)
    UserPublic:
      allOf:
        - $ref: "#/components/schemas/UserPublicSummary"
        - properties:
            bio:
              description: User's biography
              type: string
            coverPicture:
              description: Cover picture (backgroud) for the profile
              type: string
            followersCount:
              description: Number of followers the user have
              type: integer
            followingCount:
              description: Number of people the user follow
              type: integer
            instruments:
              description: |
                An array of the instrument identifiers.
                The format of the strings is `{instrument-group}.{instrument-id}`.
              items:
                type: string
              type: array
            likedScoresCount:
              description: Number of the scores liked by the user
              type: integer
            ownedPublicScoresCount:
              description: Number of public scores the user have
              type: integer
            profileTheme:
              description: Theme (background) for the profile
              type: string
            registrationDate:
              description: Date the user signed up
              format: date-time
              type: string
          type: object
      description: Public User details
    UserPublicSummary:
      allOf:
        - $ref: "#/components/schemas/UserBasics"
        - properties:
            classRole:
              $ref: "#/components/schemas/ClassRoles"
            htmlUrl:
              description: Link to user profile (for Indiv. users only)
              type: string
            organization:
              description: Organization ID (for Edu users only)
              type: string
            organizationRole:
              $ref: "#/components/schemas/OrganizationRoles"
          type: object
      description: Public User details summary
  securitySchemes:
    OAuth2:
      description: |
        OAuth 2.0 authentication for your app or. Please only request the most restrictive and needed scopes. Using some of the scopes may require an additional review from our team. The Flat API supports **authorization code** and **implicit** flows.
      flows:
        authorizationCode:
          authorizationUrl: https://flat.io/auth/oauth
          scopes:
            account.education_profile: |
              Provides access to the basic person's education profile and public organization information.
            account.email: |
              Provices access to the person's email.
            account.public_profile: |
              Provides access to the basic person's public profile. Education profiles may be anonymized with this scope, you can request the scope `education_profile` to access to the a basic education account profile.
            collections: Full, permissive scope to access all of a user's collections.
            collections.add_scores: Allow to add scores to a user's collections.
            collections.readonly: Allow read-only access to a user's collections.
            edu.admin: Full, permissive scope to manage all the admin of an organization.
            edu.admin.lti: Access and manage the LTI Credentials for an organization.
            edu.admin.lti.readonly: Read-only access to the LTI Credentials of an organization.
            edu.admin.users: Access and manage the users and invitations of the organization.
            edu.admin.users.readonly: Read-only access to the users and invitations of the organization.
            edu.assignments: Read-write access to the assignments and submissions.
            edu.assignments.readonly: Read-only access to the assignments and submissions.
            edu.classes: Full, permissive scope to manage the classes.
            edu.classes.readonly: Read-only access to the classes.
            scores: |
              Full, permissive scope to access all of a user's scores.
            scores.readonly: |
              Allows read-only access to all a user's scores. You won't need this scope to read public scores.
            scores.social: |
              Allow to post comments and like scores
          tokenUrl: https://api.flat.io/oauth/access_token
      type: oauth2
