Connect your own AI agent to the chat
With "My own agent", DeskCrew opens the chat, carries the conversation and captures the email, while your AI agent does the talking: it receives every visitor message together with the visitor's journey and answers through the DeskCrew API. Any agent that can receive a webhook and make an HTTPS request works: an agent platform's incoming webhook, an automation tool, or your own code. Pro plan and above.
What you need from your agent
One thing: the address it receives webhooks on (an https URL). Many platforms also give you a key that must be sent with each request, and tell you which header it goes in; keep both to hand.
Connect it (two minutes)
- Dashboard, Proactive chat, Connect your agent.
- Paste the webhook address. If your agent gave you a key, pick the header it expects (Authorization is the default; X-Api-Key, X-Auth-Token or a custom name are there too) and paste the key. Under Authorization a bare key is sent as "Bearer <key>", so paste it with or without the word Bearer.
- Press Connect agent. DeskCrew creates the endpoint, subscribed to the three events, and an API key limited to replying, and shows one block to give your agent: the webhook secret, the API key, the reply URL pattern, the setup page URL and the event names. Both secrets are shown once; use Copy all and paste the block into your agent now.
- Press Send test event. The line under the button shows what your agent answered: "answered 2xx" means it is reachable; "HTTP 401" with a message means the key or the header is wrong; a timeout means it took longer than 4 seconds to acknowledge.
- Connecting selects My own agent under Who answers chats; press Save changes to store it.
Give your agent its instructions
Your agent needs to know what arrives and how to reply. Point it at the setup page https://deskcrew.io/docs/agent-handoff (a raw Markdown version is at https://deskcrew.io/docs/agent-handoff/index.md for the agent to fetch directly). In short:
- Three events, delivered at once and signed with the webhook secret: visitor.engaged (a rule opened the chat), chat.message (the visitor wrote), visitor.identified (the visitor gave an email).
- Every event carries the same data: the workspace, the ticket, the visitor (returning or not, visit count, country, device, language, local time), the customer if known, the current page with seconds on it, the whole visit (pages with time and scroll, clicks, landing page, referrer, UTM), the last five earlier visits, the conversation so far, and a ready-made reply call.
- To reply, the agent POSTs the reply URL with its API key and
{"body":"...","mode":"send","askEmail":false}. Set askEmail to true on the message that earns the email. - Answer visitor.engaged within 5 seconds to get the first word; otherwise your fallback opener shows first.
Several websites
Each website is its own workspace: repeat Connect your agent in each. One agent can serve all of them from one address; every event names its workspace, so the agent keeps one secret and one key per workspace.
Caps and safety
Replies are capped at 30 per conversation per 5 minutes and 200 per key per day by default. Every message the agent sends is stored on the ticket and visible in your dashboard, and the agent only ever receives data from your own workspace. Remove an agent any time from the Connected agents list.
Grok Bot specifics
Grok Bot gives you an incoming webhook URL and a key for the Authorization header. Paste the URL as the webhook address, keep Authorization, paste the key, Connect, then give Grok Bot the block DeskCrew shows and the setup page link.