Skip to main content
PATCH
/
integrations
/
external
/
chats
/
{id}
/
responsible
Atualizar responsavel do chat
curl --request PATCH \
  --url https://api.wegly.com.br/integrations/external/chats/{id}/responsible \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "update_chat": true,
  "update_leads": true,
  "update_deals": true
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "wa_contact_id": "<string>",
  "remote_profile_name": "<string>",
  "contact_name": "<string>",
  "contact_number": "<string>",
  "status": "OPEN",
  "chat_type": "INDIVIDUAL",
  "unread_count": 123,
  "priority": 0,
  "archived_at": "2023-11-07T05:31:56Z",
  "last_customer_msg_at": "2023-11-07T05:31:56Z",
  "session_expires_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "last_message": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "type": "text",
    "origin": "INBOUND",
    "from_me": true,
    "sent_via": "CONTACT",
    "status": "sent",
    "body_text": "<string>",
    "reactions": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "emoji": "<string>",
        "actor": "CONTACT",
        "reactor_wa_id": "<string>",
        "reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "created_at": "2023-11-07T05:31:56Z"
      }
    ],
    "meta_timestamp": "2023-11-07T05:31:56Z",
    "created_at": "2023-11-07T05:31:56Z",
    "is_history": true,
    "history_phase": 123,
    "history_chunk_order": 123,
    "history_progress": 123,
    "is_media_placeholder": true,
    "agent": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "user": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "avatar": "<string>"
      }
    },
    "user": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "avatar": "<string>"
    },
    "media": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "mime_type": "<string>",
      "file_name": "<string>",
      "is_downloaded": true,
      "url": "<string>"
    },
    "call": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "COMPLETED",
      "direction": "INBOUND",
      "started_at": "2023-11-07T05:31:56Z",
      "ended_at": "2023-11-07T05:31:56Z",
      "duration_ms": 123,
      "recording_processed": true,
      "recording_available": true,
      "has_recording": true
    },
    "quoted_message": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "type": "text",
      "origin": "INBOUND",
      "from_me": true,
      "sent_via": "CONTACT",
      "status": "sent",
      "body_text": "<string>",
      "reactions": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "emoji": "<string>",
          "actor": "CONTACT",
          "reactor_wa_id": "<string>",
          "reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "created_at": "2023-11-07T05:31:56Z"
        }
      ],
      "meta_timestamp": "2023-11-07T05:31:56Z",
      "created_at": "2023-11-07T05:31:56Z",
      "is_history": true,
      "history_phase": 123,
      "history_chunk_order": 123,
      "history_progress": 123,
      "is_media_placeholder": true,
      "agent": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "user": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>",
          "avatar": "<string>"
        }
      },
      "user": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "avatar": "<string>"
      },
      "media": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "mime_type": "<string>",
        "file_name": "<string>",
        "is_downloaded": true,
        "url": "<string>"
      },
      "page": 2
    },
    "crm_marketing_lead_source": [
      {}
    ]
  },
  "assigned_agent": {
    "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "user": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "avatar": "<string>"
    }
  },
  "participants": [
    {
      "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "user": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "avatar": "<string>"
      }
    }
  ],
  "phone_number": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "display_number": "<string>",
    "raw_number": "<string>",
    "phone_number_id": "<string>"
  },
  "crm_person": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "birth_date": "2023-12-25",
    "gender": 123,
    "notes": "<string>",
    "contacts": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": 123,
        "value": "<string>",
        "primary": true
      }
    ],
    "documents": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "type": 123,
        "label": "<string>",
        "value": "<string>"
      }
    ],
    "address": {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": 123,
      "type": 123,
      "name": "<string>",
      "street": "<string>",
      "number": "<string>",
      "complement": "<string>",
      "district": "<string>",
      "city": "<string>",
      "state": "<string>",
      "postal_code": "<string>"
    }
  },
  "assignable_agents": [
    {
      "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": "<string>",
      "user": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "avatar": "<string>"
      }
    }
  ],
  "crm_marketing_lead_source": [
    {}
  ]
}

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<uuid>
required

UUID do chat.

Body

application/json
user_id
string<uuid>
required
update_chat
boolean
update_leads
boolean
update_deals
boolean

Response

Chat atualizado com novo responsável.

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

id
string<uuid>
wa_contact_id
string
remote_profile_name
string | null
contact_name
string
contact_number
string
status
enum<string>
Available options:
OPEN,
CLOSED,
SNOOZED
chat_type
enum<string>
Available options:
INDIVIDUAL,
GROUP
unread_count
integer
priority
enum<integer>

0=LOW, 1=NORMAL, 2=HIGH, 3=URGENT.

Available options:
0,
1,
2,
3
archived_at
string<date-time> | null
last_customer_msg_at
string<date-time> | null
session_expires_at
string<date-time> | null
created_at
string<date-time>
updated_at
string<date-time>
last_message
object
assigned_agent
object
participants
object[]
phone_number
object
crm_person
object
assignable_agents
object[] | null
crm_marketing_lead_source
object[] | null