> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.royalti.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get File Upload Info

> Retrieves information about uploaded files with various filtering and pagination options.

<Note>
  This endpoint requires authentication. Include your Bearer token in the Authorization header.
</Note>

## Description

**Query Parameters:**

* `q`: Search term to filter files by various fields
* `type`: Filter files by type (royalty, invoice, receipt, report)
* `column`: The column to sort by (createdAt, updatedAt, name, size, type)
* `order`: The order of sorting (asc, desc)
* `attributes`: Comma-separated list of attributes to include in the response
* `page`: The page number for pagination (must be >= 1, default: 1)
* `size`: The number of records per page (must be >= 0, default: 10)

**Validation Rules:**

* `page` must be at least 1 (returns BadRequest error if \< 1)
* `size` must be non-negative (returns BadRequest error if \< 0)
* Invalid `column` values will be ignored and default to 'createdAt'
* Invalid `order` values will default to 'desc'

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/file/', {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${token}`,
    },
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
    'https://api.royalti.io/file/',
    headers={
      'Authorization': f'Bearer {token}'
    },
  )

  data = response.json()
  print(data)
  ```

  ```bash cURL theme={null}
  curl -X GET https://api.royalti.io/file/ \
    -H "Authorization: Bearer YOUR_TOKEN" \

  ```
</CodeGroup>


## OpenAPI

````yaml get /file/
openapi: 3.0.0
info:
  title: Royalti.io API
  description: "# Royalti API\r\n\r\nThis is the Royalti music royalty management platform API server.\r\n\r\n## Overview\r\n\r\nThe Royalti API provides comprehensive music royalty management services including:\r\n- Music publishing and writer management\r\n- Royalty processing and analytics\r\n- DDEX integration for music industry standards\r\n- File processing and pattern recognition\r\n- Payment processing and distribution\r\n\r\n## Authentication\r\n\r\nThe API uses JWT-based authentication with multiple protection levels:\r\n- Public endpoints for basic operations\r\n- Protected endpoints requiring valid JWT tokens\r\n- Admin endpoints for administrative functions\r\n\r\n## Features\r\n\r\n- Multi-dimensional royalty analytics\r\n- CWR (Collective Works Registration) support\r\n- DDEX integration for music metadata\r\n- Advanced file processing with pattern recognition\r\n- Real-time data processing with queue system"
  version: 2.6.0
  contact:
    name: Royalti.io Support
    email: support@royalti.io
    url: https://royalti.io
  license:
    name: Proprietary
    url: https://royalti.io/terms
servers:
  - url: https://api.royalti.io
    description: Production server
  - url: https://api-dev.royalti.io
    description: Development server
  - url: http://localhost:8084
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounting
    description: Accounting and financial transaction operations
  - name: DDEX
    description: DDEX operations (ERN/MEAD, messages, delivery, providers)
  - name: Label
    description: Label management operations
  - name: Internal Webhooks
    description: Internal system webhooks for royalty processing and downloads
  - name: Payment Webhooks
    description: Payment processor webhook endpoints
  - name: Billing Webhooks
    description: Stripe billing and subscription webhooks
  - name: Infrastructure Webhooks
    description: Cloudflare domain and SSL webhooks
  - name: Distribution Webhooks
    description: Digital distribution platform webhooks (FUGA)
paths:
  /file/:
    get:
      tags:
        - File
      summary: Get File Upload Info
      description: >-
        Retrieves information about uploaded files with various filtering and
        pagination options.


        **Query Parameters:**

        - `q`: Search term to filter files by various fields

        - `type`: Filter files by type (royalty, invoice, receipt, report)

        - `column`: The column to sort by (createdAt, updatedAt, name, size,
        type)

        - `order`: The order of sorting (asc, desc)

        - `attributes`: Comma-separated list of attributes to include in the
        response

        - `page`: The page number for pagination (must be >= 1, default: 1)

        - `size`: The number of records per page (must be >= 0, default: 10)


        **Validation Rules:**

        - `page` must be at least 1 (returns BadRequest error if < 1)

        - `size` must be non-negative (returns BadRequest error if < 0)

        - Invalid `column` values will be ignored and default to 'createdAt'

        - Invalid `order` values will default to 'desc'
      parameters:
        - name: q
          in: query
          required: false
          description: Search term to filter files by various fields
          schema:
            type: string
        - name: type
          in: query
          required: false
          description: Filter files by type
          schema:
            type: string
            enum:
              - royalty
              - invoice
              - receipt
              - report
        - name: column
          in: query
          required: false
          description: The column to sort by
          schema:
            type: string
            enum:
              - createdAt
              - updatedAt
              - name
              - size
              - type
            default: updatedAt
        - name: order
          in: query
          required: false
          description: The order of sorting
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: attributes
          in: query
          required: false
          description: Comma-separated list of attributes to include
          schema:
            type: string
        - name: page
          in: query
          required: false
          description: The page number for pagination
          schema:
            type: integer
            default: 1
            minimum: 1
        - name: size
          in: query
          required: false
          description: The number of records per page
          schema:
            type: integer
            minimum: 0
            default: 10
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                  message:
                    type: string
                  files:
                    type: array
                    items:
                      $ref: '#/components/schemas/FileMetadata'
                  total:
                    type: integer
                  page:
                    type: integer
                  size:
                    type: integer
                  totalPages:
                    type: integer
              example:
                success: true
                message: Files retrieved successfully
                files:
                  - id: file-uuid-123
                    name: export.csv
                    originalname: export.csv
                    type: royalty
                    size: 1024000
                    mimetype: text/csv
                    uploadType: royalty
                    status: processed
                    royaltySource: testsource
                    accountingPeriod: '2017-05-01'
                    salePeriod: '2017-01-01'
                    createdAt: '2024-12-12T10:30:00.000Z'
                    updatedAt: '2024-12-12T10:35:00.000Z'
                    downloadUrl: >-
                      https://storage.googleapis.com/royalti-uploads/processed/export.csv
                total: 50
                page: 1
                size: 10
                totalPages: 5
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    FileMetadata:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the file
        name:
          type: string
          description: Name of the file in storage
        originalname:
          type: string
          description: Original name of the uploaded file
        type:
          type: string
          enum:
            - royalty
            - invoice
            - receipt
            - report
          description: Type of the file
        size:
          type: integer
          description: Size of the file in bytes
        mimetype:
          type: string
          description: MIME type of the file
        uploadType:
          type: string
          description: Type of upload
        status:
          type: string
          description: Current status of the file
        royaltySource:
          type: string
          description: Source of the royalty data
        accountingPeriod:
          type: string
          format: date
          description: Accounting period for the file
        salePeriod:
          type: string
          format: date
          description: Sales period for the file
        createdAt:
          type: string
          format: date-time
          description: When the file was uploaded
        updatedAt:
          type: string
          format: date-time
          description: When the file was last updated
        downloadUrl:
          type: string
          format: uri
          description: URL to download the file
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              message:
                type: string
                example: Unauthorized
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              message:
                type: string
                example: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````