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

# Get all expenses for a workspace

> Retrieves a list of all expenses for the authenticated workspace. The list can optionally be filtered by the project it's assigned to.



## OpenAPI

````yaml GET /expenses
openapi: 3.1.0
info:
  title: Subly API
  description: >-
    The Subly API provides a comprehensive interface to manage your workspace's
    financial data, including expenses, revenue, transactions, and projects.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://web.subly.app/api/v1
    description: Production API Server
security:
  - apiKeyAuth: []
tags:
  - name: Projects
    description: Manage projects to organize your financial items.
  - name: Expenses
    description: >-
      Operations related to workspace expenses, such as subscriptions or
      one-time costs.
  - name: Revenue
    description: Operations related to workspace revenue items.
  - name: Transactions
    description: Operations related to individual financial transactions.
paths:
  /expenses:
    get:
      tags:
        - Expenses
      summary: List all expenses
      description: >-
        Retrieves a list of all expenses for the authenticated workspace. The
        list can optionally be filtered by the project it's assigned to.
      parameters:
        - name: project_id
          in: query
          description: The unique identifier of the project to filter expenses by.
          required: false
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: A list of expenses.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Expense'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    Expense:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the expense.
          readOnly: true
        name:
          type: string
          description: Name of the expense (e.g., 'Netflix Subscription').
        category:
          type: string
          description: Category for the expense (e.g., 'Software').
        tags:
          type: array
          items:
            type: integer
          description: An array of tag IDs for organizational purposes.
        type:
          type: string
          enum:
            - subscription
            - one-time
            - ltd
          description: The type of expense.
        is_recurring:
          type: boolean
          description: >-
            Flag indicating if the expense is recurring. Automatically true if
            type is 'subscription'.
        billing_freq:
          type: integer
          description: >-
            Numeric value for the billing frequency (e.g., 1, 3). Required if
            recurring.
        billing_range:
          type: string
          enum:
            - day
            - week
            - month
            - year
          description: The time unit for the billing frequency. Required if recurring.
        nextPaymentDate:
          type: string
          format: date-time
          description: The date of the next scheduled payment. Required if recurring.
        initialPaymentDate:
          type: string
          format: date-time
          description: The date the first payment was made.
        end_date:
          type: string
          format: date-time
          description: The date the recurring expense is set to end.
        refund_deadline:
          type: string
          format: date-time
          description: The final date a refund can be requested.
        cost:
          type: number
          format: float
          description: The monetary cost of the expense.
        currency:
          type: string
          description: The ISO 4217 currency code of the cost (e.g., 'USD', 'AUD').
        isActive:
          type: boolean
          description: Whether the expense is currently active.
        website:
          type: string
          format: uri
          description: URL of the service or product provider.
        workspace_id:
          type: string
          format: uuid
          description: Identifier of the workspace this expense belongs to.
          readOnly: true
        project_id:
          type: string
          format: uuid
          description: Identifier of the project this expense is assigned to.
        renewal_date:
          type: string
          format: date-time
          description: The date the subscription is set to renew.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A message describing the error.
  responses:
    UnauthorizedError:
      description: Authentication error. The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your private API key for authentication. This key identifies your
        workspace for all requests.

````