Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk3 min

Should a Salesforce Async REST Endpoint Return 202 or 200?

For Salesforce REST work that is still running, 202 Accepted communicates that processing is incomplete. Track the job or batch to its final status and inspect its results.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Salesforce REST endpoint has accepted work that is still running, return 202 Accepted, not 200 OK. A 202 tells the client the request was accepted for processing but is not complete; it does not promise the job will ultimately succeed. Provide a way to check progress and retrieve the final outcome.

What 202 and 200 mean

Salesforce’s Connect REST status-code documentation describes 202 as: “A request was accepted for processing, but processing isn’t complete.” That is the right signal when an endpoint has queued or accepted asynchronous work and has not finished it.

As an Amazon Associate I earn from qualifying purchases.

A 200 response communicates a successful request. Its meaning depends on the method and endpoint contract, but it should not be used to imply that an operation has finished successfully when it has only been accepted and is still running. Acceptance and completion are different events, and the response should make that distinction clear.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the status code for the event that occurred

Code When it fits What the client should understand
200 OK A request succeeded and the endpoint’s contract calls for a successful response, such as documented GET, HEAD, or some PATCH requests. The request succeeded; interpret any returned information according to the method and endpoint.
201 Created The request successfully created a resource. A resource was created; use the endpoint’s response and contract to identify it.
202 Accepted The request was accepted for processing, but processing is incomplete. The work is not yet a completed success. Check its status and eventual outcome.
204 No Content The operation succeeded and the response has no content, as with some DELETE requests. The operation succeeded, but there is no response body to consume.

These are not interchangeable “success” labels. Salesforce’s REST API guidance documents 200, 201, and 204 for distinct completed-request cases; its Connect REST documentation defines 202 for accepted work that is still in progress. Follow the contract for the specific operation and the current reference for the API version and org you target.

Give clients a way to follow asynchronous work

A 202 response alone does not reveal whether the job is progressing, will fail, or has finished. For a custom asynchronous endpoint, return enough information for the client to inspect the operation and obtain its eventual result. That generally means identifying the job or operation and defining where and how the client can check its status and retrieve outcomes. The exact response shape is part of your endpoint contract; Salesforce’s status-code definition does not prescribe a custom endpoint’s payload.

Clients should treat 202 as an interim state. They should use the documented status mechanism rather than interpreting the initial response as proof of completed processing.

Follow Salesforce bulk jobs through their lifecycle

Bulk API 2.0 is an asynchronous workflow: the client submits work and returns later to check the job and collect results. A job can move through states including Open, UploadComplete, JobComplete, and Failed. Job creation or upload acceptance is not the final outcome. Read the job state, then retrieve the applicable results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Bulk API batch workflows require the same distinction. An add-batch response acknowledges receipt of the batch; it does not establish that every record succeeded. Check the batch status and retrieve its results. Even a completed batch may contain failed records, so inspect record-level outcomes rather than treating completion as universal success.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When Salesforce recommends Bulk API 2.0

Salesforce describes operations involving more than 2,000 records as a good candidate for Bulk API 2.0. For jobs below 2,000 records, Salesforce recommends bulkified synchronous REST—such as Composite—or SOAP. This is Salesforce’s guidance for choosing an approach, not a universal cutoff or a guarantee that a particular workload should use one API; consider the operation and its requirements.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.