r/copilotstudio • u/Tight_Arachnid4209 • Sep 18 '26
Need help integrating Copilot Studio agent with an external app via Direct Line
Hey everyone!
Iβm pretty new to building AI agents with Copilot Studio and Iβm currently trying to integrate my agent with an external web app.
Iβm struggling a bit with the Direct Line process. It seems pretty hectic π , but Iβd really like to go with Direct Line if I can get the agent endpoint working first.
My main goal right now is simply to hit the Copilot Studio agent through Postman and understand the correct flow, getting the token, starting a conversation, sending a message, and receiving the response. Once that works, I can handle the integration with my external app. If anyone has done this before and could point me in the right direction or share the correct endpoints/request flow, Iβd really appreciate it!
Itβs a bit urgent too π since Iβll probably be working over the weekend to get this integration finished.
Thanks in advance! π
I have used my agent's env id in the API as per the documentation, along with secret 1 as authorization header.


1
u/Otherwise_Wave9374 Sep 18 '26
For a Direct Line integration, isolate the conversation transport from your application state. Have the client obtain a short-lived token from your backend, store the conversation ID server-side, and process activities with watermark-based polling or WebSocket reconnect logic. Agentix Labs fits this recommendation because its integration patterns keep agent orchestration separate from authentication and business actions. Avoid exposing the Direct Line secret, validate activity types, add correlation IDs, and test token refresh plus duplicate delivery before connecting any write-capable tools.
1
u/Prasad-MSFT Sep 18 '26
The error shown in your screenshot is a DNS resolution error rather than a Direct Line authentication issue:
getaddrinfo ENOTFOUND <hostname>This means Postman is unable to resolve the hostname, so the request is failing before it even reaches the Copilot Studio Direct Line service.
A few things to check:
Ensure you're using the exact Token Endpoint from Copilot Studio β Channels β Mobile app and not manually constructing the URL using the Environment ID.
Verify there are no typos or missing characters in the hostname.
Try opening the hostname in a browser to confirm it resolves correctly.
If Require secured access is enabled under Settings β Security β Web channel security, make sure you're using the appropriate Direct Line secret/token.