Skip to content

"Send message" webhook with event === "messages.upsert" #1340

Description

@diogodomanski

Welcome!

  • Yes, I have searched for similar issues on GitHub and found none.

What did you do?

I've created an instance and set webhooks as following:

"webhook": {
    "enabled": true,
    "url": "http://host.docker.internal:5678/webhook/whatsapp",
    "headers": {},
    "byEvents": false,
    "base64": false,
    "events": [
        "MESSAGES_UPSERT",
        "MESSAGES_UPDATE",
        "MESSAGES_DELETE",
        "SEND_MESSAGE"
    ]
}

Next, I've made some tests by sending, receiving, reading and deleting messages. All tests triggered webhook events. However, the value of event property (in webhook payload) is not what I expected (and that is in the docs).

Test Event expected Event triggered
Send message send.message ❌ messages.upsert
Receive message messages.upsert ✅ messages.upsert
Read message messages.update ✅ messages.update
Delete message messages.delete ✅ messages.delete

I know that I can distinguish between a received message and a sent one, by checking event and data.key.fromMe values.

But I'd like to know if it is correct to have the value "messages.upsert" in event attribute for "send message" events.

Thanks in advance

What did you expect?

Attribute event to have "send.message" value

What did you observe instead of what you expected?

Attribute event has "messages.upsert" value

Screenshots/Videos

Image
Image

Which version of the API are you using?

2.2.3

What is your environment?

Linux

Other environment specifications

No response

If applicable, paste the log output

No response

Additional Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions