Skip to main content
PATCH
/
integrations
/
external
/
chats
/
{id}
/
scheduled-messages
/
{scheduledMessageId}
Atualizar mensagem agendada
curl --request PATCH \
  --url https://api.wegly.com.br/integrations/external/chats/{id}/scheduled-messages/{scheduledMessageId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "scheduled_at": "2023-11-07T05:31:56Z",
  "cancel_on_inbound": true,
  "type": "text",
  "body": "<string>",
  "template": {
    "name": "<string>",
    "language": "<string>"
  },
  "template_fields": [
    {
      "component": "HEADER",
      "type": "TEXT",
      "index": 123,
      "button_index": 123,
      "card_index": 123,
      "value": "<string>"
    }
  ],
  "replace_files": true,
  "reference_wamid": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "chat_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "is_scheduled": true,
  "status": "PENDING",
  "message_kind": "OPEN_MESSAGE",
  "cancel_reason": "USER_REQUEST",
  "cancel_reason_description": "<string>",
  "failure_reason": "<string>",
  "cancel_on_inbound": true,
  "scheduled_at": "2023-11-07T05:31:56Z",
  "processed_at": "2023-11-07T05:31:56Z",
  "sent_at": "2023-11-07T05:31:56Z",
  "canceled_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sender_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "canceled_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "payload": {
    "type": "text",
    "body": "<string>",
    "template": {
      "name": "<string>",
      "language": "<string>"
    },
    "template_fields": [
      {
        "component": "HEADER",
        "type": "TEXT",
        "index": 123,
        "button_index": 123,
        "card_index": 123,
        "value": "<string>"
      }
    ],
    "reference_wamid": "<string>"
  },
  "attachments": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "file_name": "<string>",
      "mime_type": "<string>",
      "file_size": 123
    }
  ],
  "sent_message_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}

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.

scheduledMessageId
string<uuid>
required

UUID da mensagem agendada.

Body

scheduled_at
string<date-time>
cancel_on_inbound
boolean
type
enum<string>
Available options:
text,
template
body
string
template
object
template_fields
object[]
replace_files
boolean
reference_wamid
string

Response

Mensagem agendada atualizada.

id
string<uuid>
chat_id
string<uuid>
company_id
string<uuid>
is_scheduled
enum<boolean>
Available options:
true
status
enum<string>
Available options:
PENDING,
PROCESSING,
SENT,
CANCELED,
FAILED
message_kind
enum<string>
Available options:
OPEN_MESSAGE,
TEMPLATE
cancel_reason
enum<string>
Available options:
USER_REQUEST,
CHAT_INTERACTION,
TEMPLATE_INVALID_OR_UNAVAILABLE
cancel_reason_description
string | null
failure_reason
string | null
cancel_on_inbound
boolean
scheduled_at
string<date-time>
processed_at
string<date-time> | null
sent_at
string<date-time> | null
canceled_at
string<date-time> | null
created_at
string<date-time>
updated_at
string<date-time>
created_by_user_id
string<uuid>
sender_agent_id
string<uuid> | null
canceled_by_user_id
string<uuid> | null
payload
object
attachments
object[]
sent_message_ids
string<uuid>[]