I would like to know if it is possible to intervene the outgoing and incoming messages of a chat through webhook. Does this mean that if I send an outgoing message I can send it to a webhook of mine? And when a message arrives in the chat, can you also intervene?
Question
APIs in zendesk chat
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

You'd be able to do this by interacting via the conversations api. I'd suggest taking a look at the corresponding docs to get an understanding on what is capable.
Conversations api reference docs