Salesforce API: Empty Responses Mean Success, Not Failure
The video explains that an empty 204 response from a Salesforce PATCH or DELETE is what success looks like, while failures return a JSON array with an error code. It also shows why a 200 on a Composite call does not prove every subrequest worked.
Someone updates a Salesforce record with PATCH, gets an empty response back, and assumes it failed. This short video explains why that assumption is wrong. PATCH returns 204 No Content on success, and the emptiness is the success. The video, part of a series on Claude plugins, then covers how to tell a real failure apart and what to check when several writes travel together.
Silent success, loud failure
A clean update comes back as 204 with nothing at all in the body. A real failure looks different. If you get a field name wrong, the response carries an actual body: a JSON array with an error code inside it. The video sums it up as success staying silent and failure always talking back, and never as a plain object. Those two shapes never match, so the response itself tells you which one you got.
Instance URL, Describe, then query
Every call needs the org's own instance URL, which is the My Domain plus the versioned data path. There is no shared endpoint across orgs. Before touching any field, the video calls Describe on the object to confirm field names, picklist values and which fields are actually updateable.
The worked example then queries the open Opportunities closing this quarter, with the Account name and owner, and pulls the Id of the top match. That is the record about to change. Patching that Id's StageName to Closed Won returns 204, empty, which is exactly what a successful update looks like.
The Composite caveat
The next scenario chains several updates in one Composite call. Here the outer response returning 200 does not mean every subrequest succeeded. Each subrequest carries its own HTTP status code, and only checking those tells you which wrote and which did not.
A single failed subrequest also does not undo the others, unless allOrNone was set to true. Otherwise the batch is partial and the writes that succeeded stay.
Trust the status code, not the silence
The takeaway is to read the status code rather than the amount of content in the body. A 204 with no body is what success looks like. And when one call carries several writes, check each write's own code, not only the one wrapping it.
Key takeaways
- PATCH and DELETE return 204 No Content on success; the empty body is the success.
- A failure carries a body: a JSON array containing an error code.
- Each org has its own instance URL, which is the My Domain plus the versioned data path.
- Use Describe first to confirm field names, picklist values and updateable fields.
- A 200 on a Composite call does not mean every subrequest worked.
- Each subrequest has its own HTTP status code that must be checked.
- Without allOrNone set to true, a failed subrequest does not undo the others.
Try it yourself
Give Claude this prompt: "Find all open Opportunities closing this quarter, with Account name and owner, then update the top one to Closed Won." Watch three things. Does it set the org's real instance URL before making any call? Does it Describe the Opportunity object to confirm StageName is updateable and Closed Won is a valid picklist value before writing? And does it check the actual status code afterward rather than treating an empty response as a failure?
Chapters
Full transcript(auto-generated, with timestamps)
An empty response from Salesforce means my update failed. Right?
[0:00]Someone updates a Salesforce record with patch, gets an empty response back, and assumes it failed. It didn't. Patch returns 204 no content on success. So, how do you tell a real failure apart? Patch a Salesforce record and a clean
Silent success, loud failure
[0:13]Update comes back as 204 with nothing at all in the body. That emptiness is the success. Get a field name wrong instead and the response carries a real body this time, a JSON array with an error code inside it. Success stays silent. Failure always talks back and never as a plain object. Every call needs the org's own instance
Instance URL, Describe, then query
[0:32]URL. It's my domain plus the version data path. There's no shared endpoint across orgs. Before touching a field, describe the object field names, picklist values, and which fields are actually updatable. Query the open opportunities closing this quarter with account name and owner and pull the ID of the top match. That's the record about to change. Patch that ID's stage name to closed one and the response comes back 204 empty and exactly what a successful update looks like. Chain
204, then the Composite caveat
[0:58]Several updates in one composite call instead and the outer response returning 200 doesn't mean every sub request succeeded. Each one carries its own HTTP status code and only checking those tells you which wrote and which didn't. A single failed sub request doesn't undo the others, either. Unless all or none was set to true. Otherwise, the batch is partial rights stay. An empty response from Salesforce isn't a failure. 204 with no body is what success looks like. Trust the status code, not the silence. And when a call carries several rights at once, check
Carry-out
[1:29]Each one's own code, not just the one wrapping it. Your turn. Here's the prompt. Read it with me. Find all open opportunities closing this quarter with account name and owner, then update the top one to closed one. Watch three things. Does it set the org's real instance URL before making any call? Does it describe the opportunity object to confirm stage name
Your turn
[1:48]Is updatable and closed one is a valid picklist value before writing? And does it check the actual status code afterward instead of treating an empty response as a failure. Liam Infobear Cloud Salesforce API Liam Infobear
More from Claude
2:44Sentry API: The ID in the URL Isn't the ID Claude Sends
2:07Redshift API: 200 Means Accepted, Not "Your Query Worked"
1:58Snowflake's API Won't Hand You Rows — It Hands You a Handle
2:39PagerDuty API: The Routing Key, Not the Token
2:45The 402-Line Prompt: How Splitting Agents Makes Them 5x Faster
2:25