swagger: '2.0'
info:
  title: API Specifications
  version: 0.0.1
host: qa-ows-track.theorchard.io
basePath: /
schemes:
  - https
paths:
  '/product/{product_id}/tracks':
    delete:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: Comma-separated list of TUIDs for deletion
          in: query
          name: tuids
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Deletes tracks for passed in ids (request parameter).
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - in: query
          name: exclude
          type: string
          description: Track properties to exclude (eg localizations).
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  meta_language_code: EN
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23123123001
                  upc: '12321231231'
                  p_info: 2017 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                      name: Test Remixer Artist
                    - type: composer
                      track_artist_id: 4
                      name: Test Composer Artist
                    - type: orchestra
                      track_artist_id: 5
                      name: Test Orchestra
                    - type: ensemble
                      track_artist_id: 6
                      name: Test Ensemble
                    - type: conductor
                      track_artist_id: 7
                      name: Test Conductor
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
                        - type: featuring
                          track_artist_id: 2
                          name: Test Featuring Artist
                  pagination:
                    type: none
                    total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Get tracks for product.
    patch:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/ApplyToAllTracksForProduct'
      responses:
        '200':
          headers:
            Correlation-Id:
              description: >-
                UUID to correlate logs (echoes back correlation_id from request
                header).
              type: string
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Updates data for all tracks globally on the product level.
  '/products/trackids':
    post:
      parameters:
        - name: Product ids and sorting parameters
          in: body
          required: true
          schema:
            type: object
            required:
              - product_ids
            properties:
              product_ids:
                description: List of product IDs to return tracks
                type: array
                items:
                  type: integer
              order_by_fields:
                description: List of fields for the result ordering
                type: array
                items:
                  type: object
                  required:
                    - column_name
                    - order
                  properties:
                    column_name:
                      type: string
                      description: name of the sorting column
                    order:
                      type: string
                      enum:
                        - asc
                        - desc
                      description: the column sorting order
      responses:
        '200':
          description: The list of tracks for the products, saving order
          examples:
            default:
              - tracks:
                - tuid: 1
                  product_id: 1
                - tuid: 2
                  product_id: 1
  '/product/{product_id}/tracks/arrange':
    put:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/ArrangeTracksInProduct'
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Updates volume and track number of multiple tracks.
  '/product/{product_id}/tracks/import':
    post:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/ImportTracksIntoProduct'
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  meta_language_code: EN
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23123123001
                  upc: '12321231231'
                  p_info: 2017 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                      name: Test Remixer Artist
                    - type: composer
                      track_artist_id: 4
                      name: Test Composer Artist
                    - type: orchestra
                      track_artist_id: 5
                      name: Test Orchestra
                    - type: ensemble
                      track_artist_id: 6
                      name: Test Ensemble
                    - type: conductor
                      track_artist_id: 7
                      name: Test Conductor
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
                        - type: featuring
                          track_artist_id: 2
                          name: Test Featuring Artist
              pagination:
                type: none
                total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: Import existing tracks into a product.
  '/product/{product_id}/tracks/light':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  upc: '12321231231'
                  pagination:
                    type: none
                    total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Get tracks for product with a small set of fields.
  '/product/{product_id}/tracks/publishing-obligation':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 1
                  us_publishing_obligation: Composition
                  third_party_publisher: 'Y'
                  publisher_names:
                    - Pub 1
                    - Pub 2
                - tuid: 2
                  us_publishing_obligation: ControlledByYourLabel
                  third_party_publisher: 'N'
                  publisher_names: []
                - tuid: 3
                  us_publishing_obligation: null
                  third_party_publisher: null
                  publisher_names: []
              pagination:
                type: none
                total_records: 3
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Gets publishing obligation for all tracks that belong to product.
    put:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PublishingObligationTracks'
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 1
                  us_publishing_obligation: Composition
                  third_party_publisher: 'Y'
                  publisher_names:
                    - Pub 1
                    - Pub 2
                - tuid: 2
                  us_publishing_obligation: Composition
                  third_party_publisher: 'N'
                - tuid: 3
                  us_publishing_obligation: PublicDomain
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: >-
        Updates publishing obligation for specified tracks that belong to
        product.
  '/product/{product_id}/tracks/validate':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              total_tracks: 10
              valid_tracks: 8
              errors:
                - tuid: 1
                  track_name:
                    error_code: required
                    error_message: Field `track_name` is required
                - tuid: 1
                  p_info:
                    error_code: required
                    error_message: Field `p_info` is required
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: Get the number of all tracks and valid tracks.
  '/product/{product_id}/tracks/validate/publishing-obligation':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              total_tracks: 3
              valid_tracks: 2
              errors:
                - tuid: 1
                  us_publishing_obligation:
                    error_code: required
                    error_message: Field `us_publishing_obligation` is required
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: 'Get a list of errors, and the count of all tracks and valid tracks.'
  '/product/{product_id}/tracks/{role_type}':
    patch:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - in: path
          name: role_type
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PatchRoleTypeInTracks'
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Updates role data for all tracks globally on the product level.
  /track:
    post:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/CreateTrack'
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Creates a new empty track.
  '/track/product/{original_product_id}/tracks/copy/{new_product_id}':
    post:
      parameters:
        - in: path
          name: original_product_id
          required: true
          type: string
        - in: path
          name: new_product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 201 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Copy tracks data for digital product.
  '/track/{tuid}':
    delete:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: >-
        Delete Track and all data points (see Tables and Columns section) that
        is tied to the TUID owned by current vendor.
    get:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              tuid: 2232323232
              product_id: 12121221
              meta_language_code: EN
              track_name: Example Track
              track_number: 1
              volume_number: 1
              version: '1'
              isrc: US23123123001
              upc: '12321231231'
              p_info: 2017 Meow Meow
              explicit: 'Y'
              ownership_rights: original_owner
              recording_country_id: 1
              original_rights_holder_country_id: 1
              preview_start_time: 5
              offer_type: 'all'
              artists:
                - type: performer
                  track_artist_id: 1
                  name: Test Performer Artist
                - type: featuring
                  track_artist_id: 2
                  name: Test Featuring Artist
                - type: remixer
                  track_artist_id: 3
                  name: Test Remixer Artist
                - type: composer
                  track_artist_id: 4
                  name: Test Composer Artist
                - type: orchestra
                  track_artist_id: 5
                  name: Test Orchestra
                - type: ensemble
                  track_artist_id: 6
                  name: Test Ensemble
                - type: conductor
                  track_artist_id: 7
                  name: Test Conductor
              writers:
                - track_writer_id: 1
                  type: writer
                  name: Test Writer
                - track_writer_id: 2
                  type: writer
                  name: Another Test Writer
              language:
                language_code: "ENG"
                iso_639_1_code: "EN"
                iso_code_639_3_code: "ENG"
                language: "English"
                apple_compatible: true
              localizations:
                - language_id: 1
                  track_name: Track name
                  version: '1'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
              is_owner: 'y'
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: 'Returns track data in JSON, current vendor must have access rights.'
    patch:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PatchTrackByTuid'
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Applies specified changes to track.
    put:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PutTrackByTuid'
      responses:
        '200':
          examples:
            default:
              tuid: 2232323232
              product_id: 12121221
              meta_language_code: EN
              track_name: Example Track
              track_number: 1
              volume_number: 1
              version: '1'
              isrc: US23123123001
              upc: '12321231231'
              p_info: 2017 Meow Meow
              explicit: 'Y'
              ownership_rights: original_owner
              recording_country_id: 1
              original_rights_holder_country_id: 1
              preview_start_time: 5
              artists:
                - type: performer
                  track_artist_id: 1
                  name: Test Performer Artist
                - type: featuring
                  track_artist_id: 2
                  name: Test Featuring Artist
                - type: remixer
                  track_artist_id: 3
                  name: Test Remixer Artist
                - type: composer
                  track_artist_id: 4
                  name: Test Composer Artist
                - type: orchestra
                  track_artist_id: 5
                  name: Test Orchestra
                - type: ensemble
                  track_artist_id: 6
                  name: Test Ensemble
                - type: conductor
                  track_artist_id: 7
                  name: Test Conductor
              writers:
                - track_writer_id: 1
                  type: writer
                  name: Test Writer
                - track_writer_id: 2
                  type: writer
                  name: Another Test Writer
              language:
                language_code: "ENG"
                iso_639_1_code: "EN"
                iso_code_639_3_code: "ENG"
                language: "English"
                apple_compatible: true
              localizations:
                - language_id: 1
                  track_name: Track name
                  version: '1'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Expects to receive the Full Track JSON object.
  '/tracks':
    get:
      parameters:
        - description: Comma-separated list of TUIDs
          in: query
          name: tuids
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: 200 OK
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  meta_language_code: EN
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23123123001
                  upc: '12321231231'
                  p_info: 2017 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
                - tuid: 32323232
                  product_id: 31328731
                  meta_language_code: EN
                  track_name: Example Track 2
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23083123001
                  upc: '12321231232'
                  p_info: 2014 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
                  pagination:
                    type: none
                    total_records: 2
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Get tracks for passed in tuids (request parameter).
  '/tracks-bulk':
    get:
      parameters:
        - description: Comma-separated list of product_ids (maximum up to 200)
          in: query
          name: product_ids
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  upc: '12321231231'
                  volume_number: 1
                  track_number: 1
                  track_name: Example Track 1
                - tuid: 32323232
                  product_id: 31328731
                  upc: '12321231232'
                  volume_number: 1
                  track_number: 1
                  track_name: Example Track 2
              pagination:
                type: none
                total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Get tracks for provided product_ids (maximum up to 200 product_ids).
  '/track-wide-dataloader':
    post:
      parameters:
        - name: body
          description: Track Wide Dataloader Body
          in: body
          required: true
          schema:
            type: object
            required:
              - tuids
            properties:
              tuids:
                type: array
                items:
                  type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          description: 200 OK
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  meta_language_code: EN
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23123123001
                  upc: '12321231231'
                  p_info: 2017 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                - tuid: 32323232
                  product_id: 31328731
                  meta_language_code: EN
                  track_name: Example Track 2
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23083123001
                  upc: '12321231232'
                  p_info: 2014 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  pagination:
                    type: none
                    total_records: 2
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: Get tracks for passed in tuids.
  '/track/{tuid}/localization/{language_id}':
    delete:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - in: path
          name: language_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Delete track localization.
    put:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - in: path
          name: language_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PutLanguageIdOnTrack'
      responses:
        '200':
          examples:
            default:
              tuid: 123123123
              language_id: 1
              track_name: Track name
              version: '1'
              artists:
                - name: track_artist
                  type: performer
                  track_artist_id: 1
                - name: track_artist_2
                  type: performer
                  track_artist_id: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Add or update track localization.
  '/performer/roles':
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - performer_role_id: 1
                  performer_role: 'Brass - Alphorn'
                - performer_role_id: 2
                  performer_role: 'String - Harp'
                - performer_role_id: 3
                  performer_role: 'Wind Instruments - Electronic'
              pagination:
                type: none
                total_records: 3
          description: Orchard performer roles. Has ~100 items
        '500':
          description: Internal error.
      description: Get performer roles
  '/public/performer/roles':
    get:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - performer_role_id: 1
                  performer_role: 'Brass - Alphorn'
                - performer_role_id: 2
                  performer_role: 'String - Harp'
                - performer_role_id: 3
                  performer_role: 'Wind Instruments - Electronic'
              pagination:
                type: none
                total_records: 3
          description: Orchard performer roles. Has ~100 items. Does not require grass session token.
        '500':
          description: Internal error.
      description: Get performer roles
  '/track/{tuid}/performers':
    get:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              tuid: 1
              performers:
              - performer_role_id: 1
                performer_id: 1
                type: 'primary'
                birth_name: 'performer'
              - performer_role_id: 2
                performer_id: 2
                type: 'featured'
                birth_name: 'performer 2'
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
    put:
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PutPerformersInTrack'
      responses:
        '200':
          examples:
            default:
              tuid: 1
              performers:
              - performer_role_id: 1
                performer_id: 1
                type: 'primary'
                birth_name: 'performer'
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
  '/product/{product_id}/tracks/performers':
    get:
      description: Get performer data for tracks in given product.
      parameters:
        - description: Product Id
          in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 1
                  performers:
                  - performer_role_id: 1
                    performer_id: 1
                    type: 'primary'
                    birth_name: 'performer'
                  - performer_role_id: 2
                    performer_id: 2
                    type: 'featured'
                    birth_name: 'performer 2'
                - tuid: 2
                  performers:
                  - performer_role_id: 3
                    performer_id: 3
                    type: 'primary'
                    birth_name: 'performer 3'
              pagination:
                type: none
                total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
  '/product/{product_id}/tracks/performers/{performer_type}':
    patch:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - in: path
          name: performer_type
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PatchPerformersInAllProductTracks'
      responses:
        '200':
          examples:
            default:
            - tuid: 1
              performers:
              - performer_role_id: 1
                performer_id: 1
                type: 'primary'
                birth_name: 'performer'
            - tuid: 2
              performers:
              - performer_role_id: 1
                performer_id: 2
                type: 'primary'
                birth_name: 'performer'
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
  '/product/{product_id}/tracks/validate/performers':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              total_tracks: 5
              valid_tracks: 4
              errors:
                - tuid: 1
                  performers:
                    error_code: required
                    error_message: Track must have one `primary` performer
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: Get the number of all tracks and valid tracks for performers.
  '/product/{product_id}/tracks/grats':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 1
                  grats:
                    - date: "2015-05-28 00:00:00"
                      store_id: 1
                      created_by: "oa:2521"
                      created_at: "222225433"
                      active: "Y"
                    - date: "2015-05-28 00:00:01"
                      store_id: 2
                      created_by: "oa:2522"
                      created_at: "222225433"
                      active: "Y"
                - tuid: 2
                  grats:
                    - date: "2015-05-28 00:00:00"
                      store_id: 1
                      created_by: "oa:2521"
                      created_at: "222225433"
                      active: "Y"
                    - date: "2015-05-28 00:00:01"
                      store_id: 2
                      created_by: "alw:2522"
                      created_at: "222225433"
                      active: "N"
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: Get a list of all the instant grats existing for a product.
    patch:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/InstantGratRequestBody'
      responses:
        '200':
          description: A list of instant grats.
          schema:
            $ref: '#/definitions/InstantGratResponseBody'
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Update a selected list of existing instant grats for a product.
    post:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/InstantGratRequestBody'
      responses:
        '200':
          description: A list of instant grats.
          schema:
            $ref: '#/definitions/InstantGratResponseBody'
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Create a list of instant grats for a product.
    delete:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 200 Deleted
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: Delete all the instant grats of product.

  '/product/{product_id}/tracks/grats/{track_id}/store/{store_id}':
    delete:
      parameters:
        - in: path
          name: product_id
          required: true
          type: string
        - in: path
          name: track_id
          required: true
          type: string
        - in: path
          name: store_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 200 Deleted
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Product not found
        '500':
          description: 500 Internal server error
      description: Delete instant grat of track in store.

  '/track/{tuid}/spatial':
    get:
      parameters:
        - in: path
          name: tuid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              track_id: 1
              isrc: US1234567890
              created_at: '2024-01-01T00:00:00'
              updated_at: '2024-01-01T00:00:00'
          description: 200 OK
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track spatial not found
        '500':
          description: 500 Internal server error
      description: Get spatial data for a track.
    post:
      parameters:
        - in: path
          name: tuid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/TrackSpatialPost'
      responses:
        '200':
          examples:
            default:
              track_id: 1
              isrc: US1234567890
              created_at: '2024-01-01T00:00:00'
              updated_at: '2024-01-01T00:00:00'
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '409':
          description: 409 Track spatial already exists
        '500':
          description: 500 Internal server error
      description: Create spatial data for a track.
    put:
      parameters:
        - in: path
          name: tuid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/TrackSpatialUpdate'
      responses:
        '200':
          examples:
            default:
              track_id: 1
              isrc: US1234567890
              created_at: '2024-01-01T00:00:00'
              updated_at: '2024-01-01T00:00:00'
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: >-
        Upsert spatial data for a track. Inserts a new row when none exists
        for the track, otherwise updates the existing row. When isrc is
        omitted a new ISRC is claimed automatically.
    delete:
      parameters:
        - in: path
          name: tuid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: 200 OK
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track spatial not found
        '500':
          description: 500 Internal server error
      description: Delete spatial data for a track.

  '/products/{product_id}/tracks/spatial':
    get:
      parameters:
        - in: path
          name: product_id
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              1: US1234567890
              2: US0987654321
          description: 200 OK
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: Get spatial ISRC mapping for all tracks in a product.

  '/track/{tuid}/samples':
    post:
      description: Create a new sample for this track.
      parameters:
        - in: path
          name: tuid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/TrackSample'
      responses:
        '200':
          description: Created sample object.
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error

  '/track/samples/{sampleid}':
    get:
      description: Get a track sample by id.
      parameters:
        - in: path
          name: sampleid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: Track sample object.
          schema:
            $ref: '#/definitions/TrackSampleResponse'
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track sample not found
        '500':
          description: 500 Internal server error

    put:
      description: Get a track sample by id.
      parameters:
        - in: path
          name: sampleid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/TrackSample'
      responses:
        '200':
          description: Track sample object.
          schema:
            $ref: '#/definitions/TrackSampleResponse'
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track sample not found
        '500':
          description: 500 Internal server error

    delete:
      description: Delete a track sample.
      parameters:
        - in: path
          name: sampleid
          required: true
          type: integer
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: Track sample object deleted.
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track sample not found
        '500':
          description: 500 Internal server error

  '/track-artist/{track_artist_id}/track':
    get:
      parameters:
        - in: path
          name: track_artist_id
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - name: Orchard-User-Id
          in: header
          description: Orchard User Id
          type: string
          required: true
      responses:
        '200':
          examples:
            default:
              tuid: 2232323232
              product_id: 12121221
              meta_language_code: EN
              track_name: Example Track
              track_number: 1
              volume_number: 1
              version: '1'
              isrc: US23123123001
              upc: '12321231231'
              p_info: 2017 Meow Meow
              explicit: 'Y'
              ownership_rights: original_owner
              recording_country_id: 1
              original_rights_holder_country_id: 1
              preview_start_time: 5
              offer_type: 'all'
              artists:
                - type: performer
                  track_artist_id: 1
                  name: Test Performer Artist
                - type: featuring
                  track_artist_id: 2
                  name: Test Featuring Artist
                - type: remixer
                  track_artist_id: 3
                  name: Test Remixer Artist
                - type: composer
                  track_artist_id: 4
                  name: Test Composer Artist
                - type: orchestra
                  track_artist_id: 5
                  name: Test Orchestra
                - type: ensemble
                  track_artist_id: 6
                  name: Test Ensemble
                - type: conductor
                  track_artist_id: 7
                  name: Test Conductor
              writers:
                - track_writer_id: 1
                  type: writer
                  name: Test Writer
                - track_writer_id: 2
                  type: writer
                  name: Another Test Writer
              language:
                language_code: "ENG"
                iso_639_1_code: "EN"
                iso_code_639_3_code: "ENG"
                language: "English"
                apple_compatible: true
              localizations:
                - language_id: 1
                  track_name: Track name
                  version: '1'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '404':
          description: 404 Track not found
        '500':
          description: 500 Internal server error
      description: 'Returns track data in JSON by track_artist_id'
  '/vendor/{vendor_id}/tracks/{track_type}/{isrc}':
    get:
      parameters:
        - in: path
          name: vendor_id
          required: true
          type: integer
        - in: path
          name: track_type
          required: true
          type: string
        - in: path
          name: isrc
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  meta_language_code: EN
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23123123001
                  upc: '12321231231'
                  p_info: 2017 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
                - tuid: 32323232
                  product_id: 31328731
                  meta_language_code: EN
                  track_name: Example Track 2
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23083123001
                  upc: '12321231232'
                  p_info: 2014 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
              pagination:
                type: none
                total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: 'Returns track data in JSON, current vendor must have access rights.'
  '/subaccount/{subaccount_id}/tracks/{track_type}/{isrc}':
    get:
      parameters:
        - in: path
          name: subaccount_id
          required: true
          type: integer
        - in: path
          name: track_type
          required: true
          type: string
        - in: path
          name: isrc
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          examples:
            default:
              items:
                - tuid: 2232323232
                  product_id: 12121221
                  meta_language_code: EN
                  track_name: Example Track
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23123123001
                  upc: '12321231231'
                  p_info: 2017 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
                - tuid: 32323232
                  product_id: 31328731
                  meta_language_code: EN
                  track_name: Example Track 2
                  track_number: 1
                  volume_number: 1
                  version: '1'
                  isrc: US23083123001
                  upc: '12321231232'
                  p_info: 2014 Meow Meow
                  explicit: 'Y'
                  ownership_rights: original_owner
                  recording_country_id: 1
                  original_rights_holder_country_id: 1
                  preview_start_time: 5
                  offer_type: 'all'
                  artists:
                    - type: performer
                      track_artist_id: 1
                      name: Test Performer Artist
                    - type: featuring
                      track_artist_id: 2
                      name: Test Featuring Artist
                    - type: remixer
                      track_artist_id: 3
                  writers:
                    - track_writer_id: 1
                      type: writer
                      name: Test Writer
                    - track_writer_id: 2
                      type: writer
                      name: Another Test Writer
                  language:
                    language_code: "ENG"
                    iso_639_1_code: "EN"
                    iso_code_639_3_code: "ENG"
                    language: "English"
                    apple_compatible: true
                  localizations:
                    - language_id: 1
                      track_name: Track name
                      version: '1'
                      artists:
                        - type: performer
                          track_artist_id: 1
                          name: Test Performer Artist
              pagination:
                type: none
                total_records: 2
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: 'Returns track data in JSON, current vendor must have access rights.'
  '/isrc/{isrc}/matches':
    get:
      description: Return a paginated listI  of all tracks using the given ISRC.
      parameters:
        - in: path
          name: isrc
          required: true
          type: string
          description: The ISRC to match against
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: Returns a paginated list of tracks using the same given ISRC.
          schema:
            $ref: '#/definitions/IsrcMatchResponse'
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
  '/audio-attributes/{tuid}':
    get:
      description: Returns a paginated list of all audio attributes associated with this tuid.
      parameters:
        - in: path
          name: tuid
          required: true
          type: string
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: Returns a paginated list of all audio attributes associated with this tuid.
          schema:
            type: object
            properties:
              pagination:
                type: object
                properties:
                  type:
                    type: string
                    default: none
                  total_records:
                    type: integer
                example:
                  type: none
                  total_records: 1
              items:
                type: array
                items:
                  description: List of associated audio attributes
                  type: object
                  properties:
                    track_audio_attribute_id:
                      description: Track Audio Attribute id (will be 0 for suggested audio attributes).
                      type: integer
                    audio_attribute_id:
                      description: Audio Attribute id.
                      type: integer
                    description:
                      description: Audio Attribute description.
                      type: string
                example:
                  - {track_audio_attribute_id: 1,
                    audio_attribute_id: 3,
                    description: 'suspected-non exclusive'}
                  - {track_audio_attribute_id: 2,
                    audio_attribute_id: 4,
                    description: 'public domain'}
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
  '/audio-attributes':
    get:
      description: Return a paginated list of all available audio attributes.
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - oa
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
      responses:
        '200':
          description: Returns a paginated list of all available audio attributes.
          schema:
            type: object
            properties:
              pagination:
                type: object
                properties:
                  type:
                    type: string
                    default: none
                  total_records:
                    type: integer
                example:
                  type: none
                  total_records: 11
              items:
                type: array
                items:
                  type: object
                  description: List of audio attributes
                  properties:
                    id:
                      description: Audio Attribute id.
                      type: integer
                    description:
                      description: Audio Attribute description.
                      type: string
                example:
                  - {id: 1, description: 'N/A'}
                  - {id: 2, description: 'Soundalike'}
                  - {id: 3, description: 'Classical - Contemporary'}
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
  '/upsert-audio-attributes':
    post:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            properties:
              items:
                type: array
                items:
                  type: object
                  properties:
                    tuid:
                      description: Track Unique id.
                      type: integer
                    track_attributes:
                      description: Audio Attribute ids.
                      type: array
                      items:
                        type: integer
                    change_source:
                      description: The URL from which the changes were made
                      type: string
                  required:
                    - tuid
                    - track_attributes
                example:
                  - {tuid: 182,
                    track_attributes: [1, 2, 3]}
                  - {tuid: 183,
                    track_attributes: [4, 5]}
                  - {tuid: 184,
                    track_attributes: [6],
                    change_source: "/test/t/?184"}
            type: object
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: Updates and / or creates audio attributes of a track.
  '/upsert-rights-attributes':
    post:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            properties:
              items:
                type: array
                items:
                  type: object
                  properties:
                    tuid:
                      description: Track Unique id.
                      type: integer
                    track_attributes:
                      description: Audio Attribute ids.
                      type: array
                      items:
                        type: integer
                    change_source:
                      description: The URL from which the changes were made
                      type: string
                  required:
                    - tuid
                    - track_attributes
                example:
                  - {tuid: 182,
                    track_attributes: [1, 2, 3]}
                  - {tuid: 183,
                    track_attributes: [4, 5]}
                  - {tuid: 184,
                    track_attributes: [6],
                    change_source: "/test/t/?123"}
            type: object
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: Updates and / or creates rights attributes of a track.
  '/upsert-audio-attributes-edits':
    post:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            properties:
              items:
                type: array
                items:
                  type: object
                  properties:
                    tuid:
                      description: Track Unique id.
                      type: integer
                    track_attributes:
                      description: Audio Attribute ids.
                      type: array
                      items:
                        type: integer
                  required:
                    - tuid
                    - track_attributes
                example:
                  - {tuid: 182,
                    track_attributes: [1, 2, 3]}
                  - {tuid: 183,
                    track_attributes: [4, 5]}
            type: object
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: Updates and / or creates audio attributes of a track.
  '/upsert-rights-attributes-edits':
    post:
      parameters:
        - description: UUID
          in: header
          name: Correlation-Id
          required: false
          type: string
        - description: Grass account type.
          enum:
            - vendor
            - subaccount
          in: header
          name: Grass-Account-Type
          required: false
          type: string
        - description: Grass account id.
          in: header
          name: Grass-Account-Id
          pattern: ^\d+$
          required: false
          type: string
        - in: body
          name: body
          required: true
          schema:
            properties:
              items:
                type: array
                items:
                  type: object
                  properties:
                    tuid:
                      description: Track Unique id.
                      type: integer
                    track_attributes:
                      description: Rights Attribute ids.
                      type: array
                      items:
                        type: integer
                  required:
                    - tuid
                    - track_attributes
                example:
                  - {tuid: 182,
                    track_attributes: [1, 2, 3]}
                  - {tuid: 183,
                    track_attributes: [4, 5]}
            type: object
      responses:
        '200':
          description: 200 OK
        '400':
          description: 400 Bad Request
        '403':
          description: 403 User is forbidden
        '500':
          description: 500 Internal server error
      description: Updates and / or creates rights attributes of a track.
  /vendor/tracks/validate/dataloader:
    post:
      summary: Run ISRC/OSR validations on products from a vendor
      description: |
        Validates ISRC/OSR mismatches on tracks associated with the provided product IDs.
      parameters:
        - name: body
          description: Track validation request body
          in: body
          required: true
          schema:
              type: object
              properties:
                product_ids:
                  type: array
                  items:
                    type: integer
              required:
                - product_ids
              example:
                product_ids: [1111111, 2222222]
      responses:
        '200':
          description: Validation results for provided products
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_products:
                    type: integer
                    example: 1
                  products_with_track_issues:
                    type: integer
                    example: 1
                  products:
                    type: array
                    items:
                      type: object
                      properties:
                        product_id:
                          type: integer
                          example: 1
                        track_tuid:
                          type: integer
                          example: 1
                        track_isrc:
                          type: string
                          example: 1234567890
                        warning_type:
                          type: string
                          example: Cross Track ISRC Mismatch
                        match_tuid:
                          type: integer
                          example: 2
                        match_isrc:
                          type: string
                          example: 9087654321
                        match_product_id:
                          type: integer
                          example: 2
                        match_upc:
                          type: string
                          example: 123123123123
                        match_vendor_id:
                          type: integer
                          example: 12345
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: ERROR_CODE_INVALID_INPUT
                  message:
                    type: string
                    example: One or more product_ids are invalid or missing.

definitions:
  ApplyToAllTracksForProduct:
    properties:
      version:
        description: Track version.
        maxLength: 255
        type: string
      meta_language_code:
        description: Track language.
        type: string
      explicit:
        description: Explicit Lyrics
        enum:
          - 'Y'
          - 'N'
          - C
        type: string
      p_info:
        description: P-line information.
        maxLength: 255
        pattern: '^$|^(19|20)[0-9]{2}(\,\s(19|20)[0-9]{2})*\s\S.*$'
        type: string
      ownership_rights:
        description: Ownership rights
        enum:
          - original_owner
          - acquired_rights
          - exclusive_licensee
          - non_exclusive_licensee
          - no_rights
        type: string
      recording_country_id:
        description: Country of Recording
        minimum: 1
        type: integer
      original_rights_holder_country_id:
        description: Nationality of First Producer
        minimum: 1
        type: integer
      localizations:
        description: Localizations to update
        items:
          properties:
            language_id:
              description: Language id.
              minimum: 1
              type: integer
            version:
              description: Track version.
              maxLength: 255
              type: string
          required:
            - language_id
            - version
          type: object
        type: array
    type: object
  ArrangeTracksInProduct:
    properties:
      items:
        items:
          properties:
            tuid:
              description: Track unique identifier.
              type: integer
            track_number:
              description: Track number.
              minimum: 1
              type: integer
            volume_number:
              description: Volume number.
              minimum: 1
              type: integer
          required:
            - tuid
            - track_number
            - volume_number
          type: object
        type: array
    type: object
  ImportTracksIntoProduct:
    properties:
      items:
        properties:
          tuids:
            description: List of tuids to import.
            type: array
            items:
              type: integer
        required:
          - tuids
        type: object
    type: object
  PublishingObligationTracks:
    items:
      additionalProperties: false
      properties:
        publisher_names:
          description: List of publisher names
          items:
            type: string
          type: array
        third_party_publisher:
          description: Third party publisher
          enum:
            - 'Y'
            - 'N'
          type: string
        tuid:
          description: Track unique identifier.
          type: integer
        us_publishing_obligation:
          description: US Publishing Obligation
          enum:
            - Composition
            - ControlledByYourLabel
            - PublicDomain
          type: string
      required:
        - tuid
        - us_publishing_obligation
      type: object
    type: array
  PatchRoleTypeInTracks:
    properties:
      localizations:
        description: Localizations to apply
        items:
          properties:
            language_id:
              description: Language id.
              minimum: 1
              type: integer
            names:
              description: List of localized names.
              items:
                type: string
              type: array
          required:
            - language_id
            - names
          type: object
        type: array
      names:
        description: List of role names.
        items:
          type: string
        type: array
    required:
      - names
    type: object
  CreateTrack:
    properties:
      product_id:
        description: Product identifier.
        type: integer
      track_name:
        description: Track title.
        maxLength: 200
        type: string
      volume_number:
        description: Volume number.
        minimum: 1
        type: integer
      track_type:
        description: Track type.
        type: string
    required:
      - product_id
      - track_name
    type: object
  PatchTrackByTuid:
    properties:
      track_name:
        description: Track title.
        maxLength: 200
        type: string
      version:
        description: Track version.
        maxLength: 255
        type: string
      meta_language_code:
        description: Track language.
        type: string
      isrc:
        description: ISRC
        maxLength: 12
        type: string
      p_info:
        description: P-line information.
        maxLength: 255
        pattern: '^$|^(19|20)[0-9]{2}(\,\s(19|20)[0-9]{2})*\s\S.*$'
        type: string
      explicit:
        description: Explicit Lyrics
        enum:
          - 'Y'
          - 'N'
          - C
        type: string
      preview_start_time:
        description: Track preview start point
        type: integer
      ownership_rights:
        description: Ownership rights
        enum:
          - original_owner
          - acquired_rights
          - exclusive_licensee
          - non_exclusive_licensee
          - no_rights
        type: string
      recording_country_id:
        description: Country of Recording
        minimum: 1
        type: integer
      original_rights_holder_country_id:
        description: Nationality of First Producer
        minimum: 1
        type: integer
      offer_type:
        description: Track Offer Type, can only be updated by OA users
        enum:
          - all
          - album_download_only
          - track_download_only
          - track_download_stream
          - album_track_download
          - album_download_stream
          - stream_only
          - none
        type: string
      artists:
        description: Artist names.
        items:
          properties:
            name:
              description: Artist name.
              type: string
            type:
              description: Artist type.
              type: string
          required:
            - name
            - type
          type: object
        type: array
      writers:
        description: Writer names.
        items:
          properties:
            name:
              description: Writer name.
              type: string
            type:
              description: Writer type.
              pattern: ^writer$
              type: string
          required:
            - name
            - type
          type: object
        type: array
    type: object
  PutTrackByTuid:
    properties:
      track_name:
        description: Track title.
        maxLength: 200
        type: string
      version:
        description: Track version.
        maxLength: 255
        type: string
      meta_language_code:
        description: Track language.
        type: string
      isrc:
        description: ISRC
        maxLength: 12
        type: string
      p_info:
        description: P-line information.
        maxLength: 255
        pattern: '^$|^(19|20)[0-9]{2}(\,\s(19|20)[0-9]{2})*\s\S.*$'
        type: string
      explicit:
        description: Explicit Lyrics
        enum:
          - 'Y'
          - 'N'
          - C
        type: string
      preview_start_time:
        description: Track preview start point
        type: integer
      ownership_rights:
        description: Ownership rights
        enum:
          - original_owner
          - acquired_rights
          - exclusive_licensee
          - non_exclusive_licensee
          - no_rights
        type: string
      recording_country_id:
        description: Country of Recording
        minimum: 1
        type: integer
      original_rights_holder_country_id:
        description: Nationality of First Producer
        minimum: 1
        type: integer
      artists:
        description: Artist names.
        items:
          properties:
            name:
              description: Artist name.
              type: string
            type:
              description: Artist type.
              type: string
          required:
            - type
            - name
          type: object
        type: array
      writers:
        description: Writer names.
        items:
          properties:
            name:
              description: Writer name.
              type: string
            type:
              description: Writer type.
              pattern: ^writer$
              type: string
          required:
            - name
          type: object
        type: array
    required:
      - track_name
      - version
      - meta_language_code
      - p_info
      - explicit
      - preview_start_time
      - ownership_rights
      - recording_country_id
      - original_rights_holder_country_id
      - artists
      - writers
    type: object
  PutLanguageIdOnTrack:
    properties:
      track_name:
        description: Localized track name.
        maxLength: 200
        type: string
      version:
        description: Localized track version.
        type: string
      artists:
        description: Localizes artist names.
        items:
          properties:
            name:
              description: Localized artist name.
              type: string
            track_artist_id:
              description: Track artist id.
              type: integer
            type:
              description: Artist type.
              type: string
          required:
            - type
            - track_artist_id
            - name
          type: object
        type: array
    required:
      - track_name
      - version
    type: object
  PutPerformersInTrack:
    properties:
      performers:
        description: Performer roles.
        items:
          properties:
            birth_name:
              description: Performer birth name.
              type: string
            performer_role_id:
              description: Performer role id.
              type: integer
            type:
              description: Performer type.
              type: string
          required:
            - type
            - performer_role_id
            - birth_name
          type: object
        type: array
  PatchPerformersInAllProductTracks:
    properties:
      performers:
        description: Update performer roles by performer type for all tracks in product.
        items:
          properties:
            birth_name:
              description: Performer birth name.
              type: string
            performer_role_id:
              description: Performer role id.
              type: integer
            type:
              description: Performer type.
              type: string
          required:
            - performer_role_id
            - birth_name
          type: object
        type: array

  InstantGratResponseBody:
    properties:
      items:
        description: Available Instant Grats for list of tracks.
        items:
          properties:
            tuid:
              description: Unique track id.
              type: integer
            grats:
              description: List of instant grats by track.
              items:
                properties:
                  date:
                    description: Date of instant gratification of track in the store.
                    type: string
                    format: datetime
                    example: "2015-05-29 00:00:00"
                  store_id:
                    description: Store where instant gratification will be released.
                    type: integer
                    example: 1
                  created_by:
                    description: Id of user created the grat.
                    type: string
                    pattern: ^(oa|alw)\:\d+$
                  created_at:
                    description: Timestamp when grat was created.
                    type: string
                    format: timestamp
              type: array
          type: object
        type: array

  InstantGratRequestBody:
    properties:
      items:
        description: Create/Update Instant Grats for list of tracks.
        items:
          properties:
            tuid:
              description: Unique track id.
              type: integer
            date:
              description: Date of instant gratification of track in the store.
              type: string
              format: datetime
              example: "2015-05-29 00:00:01"
            store_id:
              description: Store where instant gratification will be released.
              type: integer
          required:
            - tuid
            - date
            - store_id
          type: object
        type: array

  TrackSpatialPost:
    type: object
    properties:
      isrc:
        description: ISRC of the spatial track.
        maxLength: 16
        type: string

  TrackSpatialUpdate:
    type: object
    properties:
      isrc:
        description: >-
          ISRC of the spatial track. Optional — when omitted, a new ISRC is
          claimed automatically on insert.
        maxLength: 16
        type: string

  TrackSample:
    type: object
    properties:
      sample_type:
        description: Sample type.
        enum:
          - 'original_recording'
          - 're_recording'
        type: string
      isrc:
        description: ISRC of sample track.
        maxLength: 12
        type: string
      p_line:
        description: P-line information of sample track.
        maxLength: 255
        pattern: '^$|^(19|20)[0-9]{2}(\,\s(19|20)[0-9]{2})*\s\S.*$'
        type: string
      track_length:
        description: Track sample length in millisec.
        type: integer
      notes:
        description: Additional notes for this sample.
        type: string
      artists:
        description: Artist details for all types.
        items:
          properties:
            artist_name:
              description: Artist name.
              type: string
            artist_type:
              description: Artist type.
              enum:
                - 'artist'
                - 'songwriter'
                - 'producer'
          required:
            - name
            - type
          type: object
        type: array
    required:
      - sample_type
      - artists

  TrackSampleResponse:
    type: object
    allOf:
      - $ref: '#/definitions/TrackSample'
      - properties:
          sample_id:
            description: Track sample identifier.
            type: integer
          unique_track_id:
            description: Track identifier.
            type: integer
          updated_date:
            description: Last update timestamp.
            type: string
            format: timestamp
  IsrcMatchResponse:
    type: object
    properties:
      pagination:
        type: object
        properties:
          type:
            type: string
            default: none
          total_records:
            type: integer
        example:
          type: none
          total_records: 19
      items:
        description: List of tracks
        items:
          properties:
            tuid:
              description: Track id.
              type: integer
          example:
            - tuid: 33855
            - tuid: 6165
            - tuid: 22015
            - tuid: 46064
            - tuid: 45493
            - tuid: 22425
            - tuid: 25863
            - tuid: 27684
            - tuid: 39827
            - tuid: 48874
          type: object
        type: array

securityDefinitions: {}
