> ## 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 or reuse opportunity from a pending email thread

> Operacion: Create or reuse opportunity from pending email.



## OpenAPI

````yaml /generated/specs/sales.json post /api/v1/opportunities/from-pending-email
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/from-pending-email:
    post:
      tags:
        - Opportunities
      summary: Create or reuse opportunity from a pending email thread
      description: 'Operacion: Create or reuse opportunity from pending email.'
      operationId: OpportunitiesController_createFromPendingEmail
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOpportunityFromPendingEmailDto'
      responses:
        '201':
          description: Opportunity created or reused
      security:
        - bearerAuth: []
components:
  schemas:
    CreateOpportunityFromPendingEmailDto:
      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
        source_thread_id:
          type: string
          description: Persisted source thread id
        source_mailbox_email:
          type: string
          description: Mailbox email associated to the thread
        title:
          type: string
          description: Opportunity title
        summary:
          type: string
          description: Commercial summary
      required:
        - source_thread_id
        - 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.