> ## 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.

# Update a revenue item

> Updates the details of an existing revenue item.



## OpenAPI

````yaml PUT /revenue/{id}
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:
  /revenue/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: The unique identifier of the revenue item.
        schema:
          type: string
          format: uuid
    put:
      tags:
        - Revenue
      summary: Update a revenue item
      description: Updates the details of an existing revenue item.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRevenueItem'
      responses:
        '200':
          description: Revenue item updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RevenueItem'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    UpdateRevenueItem:
      type: object
      properties:
        name:
          type: string
        amount:
          type: number
          format: float
        is_recurring:
          type: boolean
        billing_freq:
          type: integer
        billing_range:
          type: string
          enum:
            - day
            - week
            - month
            - year
        category:
          type: string
        tags:
          type: array
          items:
            type: integer
        nextPaymentDate:
          type: string
          format: date-time
        end_date:
          type: string
          format: date-time
        currency:
          type: string
        isActive:
          type: boolean
        website:
          type: string
          format: uri
        project_id:
          type: string
          format: uuid
    RevenueItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the revenue item.
          readOnly: true
        name:
          type: string
          description: Name of the revenue source.
        amount:
          type: number
          format: float
          description: The monetary amount of the revenue.
        is_recurring:
          type: boolean
          description: Flag indicating if the revenue is recurring.
        billing_freq:
          type: integer
          description: Numeric value for billing frequency. Required if recurring.
        billing_range:
          type: string
          enum:
            - day
            - week
            - month
            - year
          description: Time unit for billing frequency. Required if recurring.
        category:
          type: string
          description: Category for the revenue item.
        tags:
          type: array
          items:
            type: integer
          description: Array of tag IDs for organization.
        nextPaymentDate:
          type: string
          format: date-time
          description: Date of the next expected payment. Required if recurring.
        end_date:
          type: string
          format: date-time
          description: Date the recurring revenue stream ends.
        currency:
          type: string
          description: ISO 4217 currency code for the amount.
        isActive:
          type: boolean
          description: Whether the revenue item is currently active.
        website:
          type: string
          format: uri
          description: Associated URL, e.g., a client's website.
        workspace_id:
          type: string
          format: uuid
          description: Identifier of the workspace this revenue belongs to.
          readOnly: true
        project_id:
          type: string
          format: uuid
          description: Identifier of the project this revenue is assigned to.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A message describing the error.
  responses:
    BadRequestError:
      description: >-
        The request is invalid. This can be due to a missing required field or
        malformed data in the request body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedError:
      description: Authentication error. The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: The requested resource could not be found.
      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.

````