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

# Renombra y/o mueve una categoría bajo otro padre (CAT-003/004)



## OpenAPI

````yaml /openapi/v1.json patch /v1/categories/{id}
openapi: 3.0.0
info:
  title: Finzaria API
  description: >-
    API REST de Finzaria — finanzas personales para México, dev-first y
    agent-first. Autentícate con tu API key bxm_ (o un token OAuth).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.finzaria.com/v1
    description: Producción
security: []
tags: []
paths:
  /v1/categories/{id}:
    patch:
      tags:
        - categories
      summary: Renombra y/o mueve una categoría bajo otro padre (CAT-003/004)
      operationId: CategoriesController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCategoryDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryDto'
      security:
        - bearer: []
components:
  schemas:
    UpdateCategoryDto:
      type: object
      properties:
        name:
          type: string
        parentId:
          type: string
          nullable: true
          description: >-
            Mueve la categoría bajo otro padre; null la vuelve raíz. Rechaza
            ciclos.
        emoji:
          type: string
          description: Emoji identificador (un solo emoji). CAT-010.
          example: 🛒
    CategoryDto:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        parentId:
          type: string
          nullable: true
        kind:
          type: string
          enum:
            - income
            - expense
        emoji:
          type: string
          nullable: true
          description: Emoji identificador (CAT-010)
        transactionCount:
          type: number
          description: Transacciones vivas asociadas
        archivedAt:
          type: string
          nullable: true
          description: >-
            Si tiene valor, la categoría está archivada: fuera de selectores,
            historial intacto.
      required:
        - id
        - name
        - parentId
        - kind
        - emoji
        - transactionCount
        - archivedAt
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT (Supabase Auth)
      type: http

````