Status and errors

Client and server states your app needs to handle. Load a template into the create form, then adjust the response before creating an endpoint.

404application/jsonGET

Missing resource

Test the empty or missing-state your app shows when a record cannot be found.

Use it when a route needs an empty or missing-state screen.

Use template
View payload and cURL

Headers

none

Body

{
  "error": "not_found",
  "message": "The thing you asked for was not found."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"not_found\",\"message\":\"The thing you asked for was not found.\"}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 404
}'
429application/jsonGET, POST

Rate limited

Check retry messaging when an API tells the client to slow down.

The header is safe and helps clients test retry messaging.

Use template
View payload and cURL

Headers

{
  "Retry-After": "60"
}

Body

{
  "error": "rate_limited",
  "message": "Too many requests. Try again in a minute."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"rate_limited\",\"message\":\"Too many requests. Try again in a minute.\"}",
  "content_type": "application/json",
  "headers": {
    "Retry-After": "60"
  },
  "methods": [
    "GET",
    "POST"
  ],
  "status": 429
}'
503application/jsonGET

Temporarily unavailable

Show the state your app uses when a dependency is not ready.

Use template
View payload and cURL

Headers

none

Body

{
  "error": "temporary_unavailable",
  "message": "This service is not ready. Please retry shortly."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"temporary_unavailable\",\"message\":\"This service is not ready. Please retry shortly.\"}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 503
}'
202application/jsonPOST

Accepted job

Confirm your UI handles queued work before it completes.

Use it to test UI that switches from submit to pending.

Use template
View payload and cURL

Headers

{
  "X-Request-Id": "req_test_123"
}

Body

{
  "job_id": "job_123",
  "status": "queued",
  "message": "The request was accepted and will be processed soon."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\n  \"job_id\": \"job_123\",\n  \"status\": \"queued\",\n  \"message\": \"The request was accepted and will be processed soon.\"\n}",
  "content_type": "application/json",
  "headers": {
    "X-Request-Id": "req_test_123"
  },
  "methods": [
    "POST"
  ],
  "status": 202
}'
410application/jsonGET

Gone

Test the message shown after a resource has been removed.

Use template
View payload and cURL

Headers

none

Body

{
  "error": "gone",
  "message": "This resource is no longer available."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"gone\",\"message\":\"This resource is no longer available.\"}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 410
}'
503application/jsonGET, POST

Maintenance retry

Check maintenance banners and retry timing in one response.

Use template
View payload and cURL

Headers

{
  "Retry-After": "120"
}

Body

{
  "error": "maintenance",
  "message": "Service is temporarily unavailable. Try again in two minutes."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"maintenance\",\"message\":\"Service is temporarily unavailable. Try again in two minutes.\"}",
  "content_type": "application/json",
  "headers": {
    "Retry-After": "120"
  },
  "methods": [
    "GET",
    "POST"
  ],
  "status": 503
}'

Other recipe shelves