Skip to main content
GET
/
integrations
/
external
/
deals
/
{id}
Consulta de oportunidade
curl --request GET \
  --url https://api.wegly.com.br/integrations/external/deals/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "code": 123,
  "title": "<string>",
  "status": 1,
  "created_by": {
    "id": "<string>",
    "name": "<string>",
    "avatar": "<string>"
  },
  "stage": {
    "id": "<string>",
    "name": "<string>",
    "pipeline": {
      "id": "<string>",
      "name": "<string>"
    }
  },
  "pipeline_stages": [
    {
      "id": "<string>",
      "name": "<string>",
      "position": 123
    }
  ],
  "responsible": {
    "id": "<string>",
    "name": "<string>",
    "avatar": "<string>"
  },
  "deal_source": {
    "id": "<string>",
    "name": "<string>",
    "logo": "<string>"
  },
  "marketing_lead_source": {
    "id": "<string>",
    "utm_search_term": "<string>",
    "lead_source": {
      "id": "<string>",
      "name": "<string>",
      "logo": "<string>"
    },
    "url_conversion": "<string>",
    "campaing_name": "<string>",
    "ad_set_name": "<string>",
    "content_name": "<string>",
    "displayed_on_name": "<string>",
    "conversion_tool_name": "<string>",
    "creative": {
      "id": "<string>",
      "value": "<string>",
      "creative_uri": "<string>"
    }
  },
  "quality_rating": 123,
  "quality_reason": "<string>",
  "won_date": "2023-11-07T05:31:56Z",
  "lost_date": "2023-11-07T05:31:56Z",
  "crm_loss_reason": {
    "id": "<string>",
    "name": "<string>"
  },
  "lost_reason_description": "<string>",
  "visibility": 0,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "archived_at": "2023-11-07T05:31:56Z",
  "last_activity_at": "2023-11-07T05:31:56Z",
  "expected_close_date": "2023-11-07T05:31:56Z",
  "temperature": 1,
  "participants": [
    {
      "id": "<string>",
      "role": {
        "id": "<string>",
        "name": "<string>"
      },
      "notes": "<string>",
      "person": {
        "id": "<string>",
        "name": "<string>",
        "contacts": [
          {
            "id": "<string>",
            "type": 0,
            "value": "<string>",
            "primary": true
          }
        ]
      }
    }
  ],
  "organization": {
    "id": "<string>",
    "name": "<string>",
    "logo": "<string>"
  },
  "lead": {
    "id": "<string>",
    "title": "<string>"
  },
  "custom_fields": [
    {
      "field_id": "<string>",
      "field_name": "<string>",
      "field_type": 123,
      "answers": [
        {
          "id": "<string>",
          "option_id": "<string>",
          "option_value": "<string>",
          "value": "<string>"
        }
      ]
    }
  ],
  "tags": [
    {
      "id": "<string>",
      "name": "<string>",
      "color": "<string>"
    }
  ],
  "stage_durations": [
    {
      "stage_id": "<string>",
      "stage_name": "<string>",
      "total_seconds": 123,
      "human_readable": "<string>"
    }
  ],
  "value": 123,
  "views_count": 123,
  "associations_count": {
    "items": 123,
    "tasks": 123,
    "qualifications": 123,
    "notes": 123,
    "files": 123,
    "activities": 123,
    "proposals": 123
  },
  "proposals": [
    {
      "id": "<string>",
      "code": 123,
      "version": 123,
      "title": "<string>",
      "status": 123,
      "is_primary": true,
      "discount_type": 123,
      "discount_value": 123,
      "subtotal": 123,
      "total": 123,
      "valid_until": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z",
      "approved_at": "2023-11-07T05:31:56Z",
      "archived_at": "2023-11-07T05:31:56Z",
      "rejected_at": "2023-11-07T05:31:56Z",
      "created_by": {
        "id": "<string>",
        "name": "<string>",
        "avatar": "<string>"
      },
      "approved_by": {
        "id": "<string>",
        "name": "<string>"
      }
    }
  ],
  "followers": [
    {
      "role": {
        "id": "<string>",
        "name": "<string>"
      },
      "user": {
        "id": "<string>",
        "name": "<string>",
        "avatar": "<string>"
      },
      "notes": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.

Path Parameters

id
string
required

UUID ou código numérico da oportunidade.

Response

Detalhes da oportunidade.

Detalhamento completo retornado no GET /integrations/external/deals/{id}.

id
string
code
integer
title
string
status
enum<integer>

1 = aberta, 2 = ganha, 3 = perdida.

Available options:
1,
2,
3
created_by
object
stage
object
pipeline_stages
object[]
responsible
object
deal_source
object

Origem direta da oportunidade (crm_lead_source).

marketing_lead_source
object

Último registro de rastreio (crm_marketing_lead_source).

quality_rating
integer | null
quality_reason
string | null
won_date
string<date-time> | null
lost_date
string<date-time> | null
crm_loss_reason
object
lost_reason_description
string | null
visibility
enum<integer>

0 = privado (responsável e supervisores), 1 = equipe/responsável, 2 = público.

Available options:
0,
1,
2
created_at
string<date-time>
updated_at
string<date-time>
archived_at
string<date-time> | null
last_activity_at
string<date-time> | null
expected_close_date
string<date-time> | null
temperature
enum<integer>

1 = frio, 2 = morno, 3 = quente.

Available options:
1,
2,
3
participants
object[]

Participantes da oportunidade com informações de contato.

organization
object
lead
object
custom_fields
object[]

Respostas de campos customizados agrupadas por campo.

tags
object[]
stage_durations
object[]

Tempo acumulado por etapa (segundos e texto legível).

value
number | null
views_count
integer
associations_count
object
proposals
object[]
followers
object[]