Hello Prateek,
You're hitting a known challenge when trying to send proactive messages from a skill bot back to Copilot Studio. While similar to Microsoft Teams messaging, Copilot Studio introduces stricter auth/identity handling — especially for skill bots. Here’s a concise guide to answer your questions and get it working.
✅ What’s Going Wrong
You're getting 401/403
errors because:
The auth token you're using is either invalid or has the wrong audience (aud
) for Copilot Studio.
You're treating Copilot like Teams — but Copilot does not accept the same token audience as Teams (like api.botframework.com
).
Proactive messages require a specific token issued for the Copilot channel, not just a generic Bot Framework or Azure AD token.
✅ Solutions and Steps
- Use the Bot Framework Skill Protocol for Proactive Messages
Proactive messages must be sent using the Bot Framework protocol using the correct OAuth token, matching Copilot’s expected audience.
- Use the Right OAuth Token (Audience + Scope)
When sending proactive messages to Copilot, you must:
Acquire a token for the Microsoft App ID of your bot.
Use the **Bot-to-Bot token flow** (`https://api.botframework.com/.default` scope).
Set **audience (aud)** to `https://api.botframework.com`.
Token acquisition example: Use the client credentials flow with your bot's App ID and Secret:
bash
Copy
POST https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded
client_id=YOUR_BOT_APP_ID
&client_secret=YOUR_BOT_SECRET
&grant_type=client_credentials
&scope=https://api.botframework.com/.default
- Use the Right Headers for the Outbound POST
Your proactive POST should include:
http
Copy
Authorization: Bearer <token_from_above>
Content-Type: application/json
And post to:
plaintext
Copy
{service_url}/v3/conversations/{conversation_id}/activities
Use the serviceUrl
and conversation.id
from the initial Copilot request.
- Register the Bot App Correctly
Ensure:
The bot is registered in Azure Bot Channels Registration (not just a regular AAD app).
It has the Microsoft App ID and Secret configured.
- Channel settings allow Copilot/Skill access (you may need to explicitly allow trusted service URLs).You're hitting a known challenge when trying to send proactive messages from a skill bot back to Copilot Studio. While similar to Microsoft Teams messaging, Copilot Studio introduces stricter auth/identity handling — especially for skill bots. Here’s a concise guide to answer your questions and get it working. ✅ What’s Going Wrong You're getting
401/403
errors because:- The auth token you're using is either invalid or has the wrong audience (
aud
) for Copilot Studio. - You're treating Copilot like Teams — but Copilot does not accept the same token audience as Teams (like
api.botframework.com
). - Proactive messages require a specific token issued for the Copilot channel, not just a generic Bot Framework or Azure AD token.
- Use the Bot Framework Skill Protocol for Proactive Messages
- Proactive messages must be sent using the Bot Framework protocol using the correct OAuth token, matching Copilot’s expected audience.
- Use the Right OAuth Token (Audience + Scope)
- When sending proactive messages to Copilot, you must:
- Acquire a token for the Microsoft App ID of your bot.
- Use the Bot-to-Bot token flow (
https://api.botframework.com/.default
scope). - Set audience (aud) to
https://api.botframework.com
.
Use the client credentials flow with your bot's App ID and Secret:bash Copy POST https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token
- The auth token you're using is either invalid or has the wrong audience (
Content-Type: application/x-www-form-urlencoded
client_id=YOUR_BOT_APP_ID &client_secret=YOUR_BOT_SECRET &grant_type=client_credentials &scope=https://api.botframework.com/.default
3. **Use the Right Headers for the Outbound POST**
Your proactive POST should include:
```yaml
http
Copy
Authorization: Bearer <token_from_above>
Content-Type: application/json
And post to:
plaintext
Copy
{service_url}/v3/conversations/{conversation_id}/activities
Use the serviceUrl
and conversation.id
from the initial Copilot request.
- Register the Bot App Correctly
Ensure:
- The bot is registered in Azure Bot Channels Registration (not just a regular AAD app).
- It has the Microsoft App ID and Secret configured.
- Channel settings allow Copilot/Skill access (you may need to explicitly allow trusted service URLs).
Thanks,
Ayush
*************************************************************************
If the response is helpful, please click "**Accept Answer**" and upvote it. You can share your feedback via [Microsoft Teams Developer Feedback]([https://aka.ms/CopilotDevCommunityResponsesFeedback](https://aka.ms/CopilotDevCommunityResponsesFeedback"https://aka.ms/copilotdevcommunityresponsesfeedback")) link. Click [here](https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR0MlFOZ25nZChVViMrDjqJ9UN0dNSTA4WVo2S05JQ1M4TVlYMjROSjhURSQlQCN0PWcu"https://forms.office.com/pages/responsepage.aspx?id=v4j5cvggr0grqy180bhbr0mlfoz25nzchvvimrdjqj9un0dnsta4wvo2s05jq1m4tvlymjrosjhursqlqcn0pwcu") to escalate.