Skip to main content

Command Palette

Search for a command to run...

What your API already did before returning success (and why that matters)

Published
3 min read

The API returned success.

The message was not delivered.

Those are not the same thing.


A request returning is not the same as work completing

From the outside, sending an SMS looks simple:

request → API → success

But in a real system, that response comes back before the actual outcome exists.

A typical flow looks more like this:

request
→ validate
→ select route
→ calculate pricing
→ deduct balance
→ enqueue message
→ hand off to provider
→ provider → carrier
→ carrier decides delivery
→ final outcome (delivered / failed / filtered)

The API response happens somewhere in the middle of that chain.

Not at the end.


A concrete example

You send a message:

POST /api/v1/send_sms

The API responds:

{
  "status": "success",
  "order_id": 22953,
  "route_id": 5,
  "messages": [
    {
      "bx_message_id": "BX-22953-c5f4f53431ed22c2",
      "status": "QUEUED"
    }
  ]
}

At this point:

  • the request was valid

  • pricing was resolved

  • balance was deducted

  • a route was selected

  • the system committed to execution

But nothing has been delivered yet.

The message is only:

QUEUED


What happens after the API returns

After that response, the system continues:

  • the message is picked up from a queue

  • sent to a downstream provider

  • possibly retried if it fails

  • passed to a carrier

  • evaluated against filtering rules

  • delayed or throttled

  • eventually delivered… or not

For example:

  • provider accepts the request → OK

  • carrier silently filters the message → user never receives it

From the API perspective:

success

From the user perspective:

failure


The core problem

The difficult part is not sending the request.

It is everything that happens after the request leaves your system boundary:

  • queues introduce delay

  • retries introduce non-determinism

  • providers behave differently

  • carriers apply filtering you don’t control

  • timing changes outcomes

So you end up with:

same request → different results


Why this is confusing in production

At low scale:

  • messages arrive quickly

  • behavior looks consistent

  • “success” feels reliable

At higher scale:

  • some messages are delayed

  • some are retried

  • some are dropped

  • some are filtered

But the API responses still look identical.

Everything still says:

success


The real gap

Most systems expose:

request → success

But the real system is:

request
→ execution started
→ distributed processing
→ external systems
→ eventual outcome

The gap is:

“request handled” vs “did the thing actually happen”

That gap is where most production issues live.


Rethinking success

There are at least three different layers:

  • API success → the request was accepted and processed correctly

  • execution success → the system started the intended work

  • outcome success → the expected result actually happened

Most APIs only expose the first.

Users care about the last.


Closing

A success response does not mean the system is done.

It means the system has committed to doing the work.

The actual result depends on everything that happens after:

queues, providers, carriers, timing, and retries.

If you want to understand how your system behaves in production, you have to look past the response.

That is where the real system is.