Library

Browse by testing need

Recipes are grouped around common API testing moments: frontend states, auth flows, validation errors, integrations, demos, and QA checks.

Good places to start

Load a recipe, change anything you need, then create an endpoint through the normal Stubpoint flow.

422application/jsonPOST

Validation problem

Test form and API validation states with a problem-details body.

Keeps the content type within Stubpoint's allowed JSON type while using the RFC 7807 shape.

Use template
View payload and cURL

Headers

none

Body

{
  "type": "https://stubpoint.dev/problems/validation",
  "title": "Validation failed",
  "status": 422,
  "detail": "One or more fields need attention.",
  "errors": {
    "email": [
      "Enter a valid email address."
    ],
    "quantity": [
      "Quantity must be at least 1."
    ]
  }
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\n  \"type\": \"https://stubpoint.dev/problems/validation\",\n  \"title\": \"Validation failed\",\n  \"status\": 422,\n  \"detail\": \"One or more fields need attention.\",\n  \"errors\": {\n    \"email\": [\"Enter a valid email address.\"],\n    \"quantity\": [\"Quantity must be at least 1.\"]\n  }\n}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "POST"
  ],
  "status": 422
}'
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
}'
200application/jsonGET

Page with next link

Test list screens that need a next cursor.

Use template
View payload and cURL

Headers

none

Body

{
  "items": [
    {
      "id": "evt_001",
      "label": "Created"
    },
    {
      "id": "evt_002",
      "label": "Processed"
    }
  ],
  "page": {
    "limit": 2,
    "next_cursor": "evt_002"
  }
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\n  \"items\": [\n    {\"id\": \"evt_001\", \"label\": \"Created\"},\n    {\"id\": \"evt_002\", \"label\": \"Processed\"}\n  ],\n  \"page\": {\"limit\": 2, \"next_cursor\": \"evt_002\"}\n}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 200
}'
200application/jsonPOST

Payment failed event

Test payment or notification flows that react to failed events.

Use template
View payload and cURL

Headers

{
  "X-Webhook-Source": "stubpoint"
}

Body

{
  "id": "evt_payment_failed",
  "type": "payment.failed",
  "created_at": "2026-05-21T12:00:00Z",
  "data": {
    "invoice_id": "inv_123",
    "customer_id": "cus_456",
    "reason": "card_declined"
  }
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\n  \"id\": \"evt_payment_failed\",\n  \"type\": \"payment.failed\",\n  \"created_at\": \"2026-05-21T12:00:00Z\",\n  \"data\": {\n    \"invoice_id\": \"inv_123\",\n    \"customer_id\": \"cus_456\",\n    \"reason\": \"card_declined\"\n  }\n}",
  "content_type": "application/json",
  "headers": {
    "X-Webhook-Source": "stubpoint"
  },
  "methods": [
    "POST"
  ],
  "status": 200
}'
200application/jsonGET

Empty dashboard

An empty-state response for first-run UI checks.

Use template
View payload and cURL

Headers

none

Body

{
  "items": [],
  "message": "Nothing here yet. Create your first item when you are ready."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"items\":[],\"message\":\"Nothing here yet. Create your first item when you are ready.\"}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 200
}'
200text/csvGET

CSV export

Test download and parser handling with CSV rows.

Use template
View payload and cURL

Headers

none

Body

id,email,status
1,ava@example.test,active
2,ren@example.test,pending

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "id,email,status\n1,ava@example.test,active\n2,ren@example.test,pending\n",
  "content_type": "text/csv",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 200
}'
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
}'
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
}'