Mainframe Path Start learning free
AppliedTroubleHTTP 4xx/5xx

Mainframe API errors — 400, 401, 403, 500, 503 and timeouts

A workflow for REST APIs served through z/OS Connect: read the status code, find the layer that failed, then fix the right thing.

What happened

A consumer — a mobile app, web front end or partner — calls a REST API that is served by z/OS Connect in front of CICS, IMS, Db2 or MQ. The call returns an HTTP error or never returns at all.

What the consumer typically reports (illustrative)
POST /accounts/v1/transfers
HTTP/1.1 403 Forbidden
Content-Type: application/json
{ "errorMessage": "..." }

client log: request timed out after 30000 ms

What it means

The status code tells you which layer to suspect. A request may pass an API gateway, TLS (AT-TLS or Liberty), z/OS Connect itself, then the back-end system and the program.

StatusUsual meaningSuspect first
400Request did not match the API definitionConsumer JSON vs the OpenAPI spec and field mapping
401No valid credentialsToken, certificate or password; expiry; audience
403Identified, but not allowedAPI roles in z/OS Connect, or the mapped SAF user ID
500Something failed behind the APIBack-end abend, SQL error, mapping failure
503Service not availableAPI or service stopped, back-end connection down, region unavailable
TimeoutNo answer in timeSlow back end, lock waits, mismatched timeouts

Typical causes

Symptoms

Where to look

How to diagnose

  1. Collect the exact URL, method, status code, timestamp and correlation ID.
  2. Use the table above to pick the layer to check first.
  3. For 4xx, reproduce with the same payload and compare it field by field with the API spec.
  4. For 403, find the user ID the request ran under and check both the API role and back-end access.
  5. For 500 and 503, match the timestamp to back-end logs and to the z/OS Connect logs.
  6. For timeouts, compare the consumer, gateway, z/OS Connect and back-end timeout values, then check whether the transaction finished.

How to fix

How to prevent

Production considerations

Interview question

Consumers report intermittent timeouts on an API that calls a CICS program. How do you investigate?

Stuck on something else?
Ask the community or search the full course.

Ask a question