Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Hello Anthony Whitford,
Even though Salesforce correctly returns HTTP 201 Created for a successful record creation, Copilot Studio’s orchestration engine currently treats any HTTP status code ≠ 200 as an error, even when the connector marks 201 as a success condition.
This is not something you can fix with agent instructions, because the error is raised before the LLM receives the response. Instructions cannot override connector-level error handling.
This is a known product limitation affecting:
- Salesforce “Create Record”
- Custom API plugins returning 201
- Power Automate connector actions wrapped inside an agent tool
- Some REST operations that correctly follow HTTP spec
Salesforce is behaving correctly: its REST API explicitly returns 201 Created for successful POST /sobjects/<object> calls, including a response body with id, success: true, and no errors. The problem lies in Copilot Studio, whose Salesforce connector expects 200 OK and treats other success codes (201, 202, 204) as connectorRequestFailure, failing the tool call before the LLM can process the response and offering no override mechanism.
Working solutions include:
**Power Automate Flow (recommended):** Wrap the Salesforce create call in a flow triggered by the agent. Power Automate correctly handles 201 as success and returns a clean success payload to Copilot Studio.
**SOQL-based Upsert:** May return 200 OK, but requires an external ID and changes logic.
**Custom API Plugin:** Full control over response mapping, but adds OAuth, security, and maintenance overhead.
Non-working approaches (for clarity): instructions to treat 201 as success, grounding/action tweaks, connector config changes, or editing the built-in connector schema.
Recommendation: For production, use Power Automate to normalize non-200 success codes—this aligns with Microsoft’s guidance.