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

# Create a deal (opportunity)



## OpenAPI

````yaml /generated/specs/sales.json post /api/v1/crm/objects/deals
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/crm/objects/deals:
    post:
      tags:
        - CRM Objects
      summary: Create a deal (opportunity)
      operationId: CrmOpportunityFacadeController_create
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOpportunityDto'
      responses:
        '201':
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    CreateOpportunityDto:
      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_channel:
          type: string
          description: Source channel (primer toque)
          enum:
            - web-cotizador
            - web-demo
            - web-contacto
            - whatsapp
            - email
            - llamada
            - linkedin
            - feria
            - partner
            - referido
            - outbound
            - desconocido
        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
        source_thread_id:
          type: string
          description: Source email thread id
        source_mailbox_email:
          type: string
          description: Mailbox email used as source
        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
      required:
        - title
  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.