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

# Upsert a dashboard subscription goal slot (admin only)

> Writes a goal for the (tenant, year, periodType, periodIndex) tuple. Pass null on netSubsGoal or mrrGoal to clear that field.



## OpenAPI

````yaml /generated/specs/finance.json patch /api/v1/analytics/subscription-growth/goals
openapi: 3.0.0
info:
  title: Raul API - Finanzas
  description: >-
    Facturas, boletas, ejecuciones de billing, cuentas por pagar y medios de
    pago.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/analytics/subscription-growth/goals:
    patch:
      tags:
        - Analytics - Dashboard
      summary: Upsert a dashboard subscription goal slot (admin only)
      description: >-
        Writes a goal for the (tenant, year, periodType, periodIndex) tuple.
        Pass null on netSubsGoal or mrrGoal to clear that field.
      operationId: BusinessDashboardController_upsertDashboardGoal
      parameters:
        - name: Idempotency-Key
          in: header
          description: >-
            UUID v4 estable por intento lógico. Durante el rollout compatible el
            header es opcional.
          required: false
          schema:
            type: string
            format: uuid
            pattern: >-
              ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertDashboardGoalDto'
      responses:
        '200':
          headers:
            Idempotency-Replayed:
              description: Presente con valor true cuando la respuesta fue reproducida.
              schema:
                type: string
                enum:
                  - 'true'
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardGoalItemDto'
        '400':
          description: Idempotency-Key presente pero no es UUID v4
        '403':
          description: Non-admin or missing tenant
        '409':
          description: >-
            La clave fue usada con otro cuerpo o su resultado venció y sigue
            dentro de la retención de 7 días
        '429':
          description: El scope autenticado alcanzó el máximo de keys idempotentes vigentes
      security:
        - bearerAuth: []
components:
  schemas:
    UpsertDashboardGoalDto:
      type: object
      properties:
        year:
          type: number
          description: Año del slot
          example: 2026
        periodType:
          type: string
          description: Tipo de período
          enum:
            - month
            - quarter
            - year
        periodIndex:
          type: number
          description: Índice de período (1..12 month, 1..4 quarter, 1 year)
          example: 3
        netSubsGoal:
          type: number
          description: >-
            Objetivo neto de suscripciones (entero 0..2_147_483_647). null =
            limpiar, omitido = no toca.
          nullable: true
        mrrGoal:
          type: number
          description: >-
            Objetivo de MRR (Decimal(18,2) — 0 ≤ value ≤ 90_071_992_547_409.91,
            ≤ 2 decimales). admin only. null = limpiar, omitido = no toca.
          nullable: true
      required:
        - year
        - periodType
        - periodIndex
    DashboardGoalItemDto:
      type: object
      properties:
        year:
          type: number
        periodType:
          type: string
          enum:
            - month
            - quarter
            - year
        periodIndex:
          type: number
          description: 1..12 month, 1..4 quarter, 1 year
        netSubsGoal:
          type: number
          nullable: true
        mrrGoal:
          type: number
          nullable: true
          description: Sólo presente en respuestas para admin. OMITIDO para no-admin.
      required:
        - year
        - periodType
        - periodIndex
        - netSubsGoal
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Token de sesión Better Auth para rutas de backoffice; las rutas de
        portal usan su token propio.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.