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

# Update an opportunity

> Operacion: Update an opportunity.



## OpenAPI

````yaml /generated/specs/sales.json patch /api/v1/opportunities/{id}
openapi: 3.0.0
info:
  title: Raul API - Ventas
  description: >-
    Cotizaciones, pipeline, outreach comercial, equipos cotizables y ventas de
    equipamiento.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/opportunities/{id}:
    patch:
      tags:
        - Opportunities
      summary: Update an opportunity
      description: 'Operacion: Update an opportunity.'
      operationId: OpportunitiesController_update
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOpportunityDto'
      responses:
        '200':
          description: Opportunity updated successfully
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateOpportunityDto:
      type: object
      properties:
        contact_id:
          type: string
          description: Related contact UUID
        client_id:
          type: string
          description: Related client UUID
        owner_user_id:
          type: string
          description: Owner user UUID
        source_detail:
          type: string
          description: Detalle del origen (página, feria, quién refirió)
        object_source:
          type: string
          description: Cómo entró el registro (HubSpot hs_object_source)
          enum:
            - form
            - inbox
            - mcp
            - import
            - unknown
        deal_type:
          type: string
          description: Tipo de negocio
          enum:
            - gps
            - unificador
        next_action:
          type: string
          description: Suggested next action
        next_action_due_at:
          type: string
          description: Next action due date
        priority:
          type: object
          description: Prioridad del negocio (1–4); null la deja sin definir
          minimum: 1
          maximum: 4
          nullable: true
        title:
          type: string
          description: Opportunity title
        prospect_name:
          type: string
          description: Prospect snapshot name
        prospect_email:
          type: string
          description: Prospect snapshot email
        prospect_phone:
          type: string
          description: Prospect snapshot phone
        prospect_company:
          type: string
          description: Prospect snapshot company
        prospect_company_rut:
          type: string
          description: Prospect snapshot company RUT
        prospect_company_email:
          type: string
          description: Prospect snapshot company email
        prospect_company_phone:
          type: string
          description: Prospect snapshot company phone
        prospect_company_address:
          type: string
          description: Prospect snapshot company address
        prospect_company_website:
          type: string
          description: Prospect snapshot company website
        prospect_company_size:
          type: string
          description: Prospect snapshot company size
        prospect_company_headquarters:
          type: string
          description: Prospect snapshot company headquarters
        stage_id:
          type: string
          description: Opportunity stage UUID
        pipeline_id:
          type: string
          description: >-
            Pipeline de la oportunidad: su id o su tipo semántico (inbound,
            outbound…); resolvePipelineId prueba primero el id y luego el tipo
          maxLength: 128
        scheduled_resume_at:
          type: string
          description: Scheduled resume date for waiting opportunities
        manual_monthly_uf:
          type: object
          description: Manual monthly business amount in UF
          minimum: 0
        summary:
          type: string
          description: Commercial summary
        private_notes:
          type: string
          description: Private commercial notes
        additional_client_ids:
          description: Additional client UUIDs for the opportunity
          type: array
          items:
            type: string
        additional_contact_ids:
          description: Additional contact UUIDs for the opportunity
          type: array
          items:
            type: string
        source_channel:
          type: string
          description: >-
            Source channel; solo editable si el actual es null o desconocido
            (origen bloqueado)
          enum:
            - web-cotizador
            - web-demo
            - web-contacto
            - whatsapp
            - email
            - llamada
            - linkedin
            - feria
            - partner
            - referido
            - outbound
            - desconocido
        lost_reason_detail:
          type: object
          description: 'Detalle del motivo de pérdida (ej: qué competidor)'
        won_reason:
          type: object
          description: Won reason
        lost_reason:
          type: object
          description: Lost reason
  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.