Documentation

Quick start

Create a temporary public response endpoint by sending JSON to POST /api/endpoints. Stubpoint returns a generated URL under /mock/{slug}. Call that URL from your app, test suite, webhook client, frontend prototype, or API client.

For current endpoint restrictions, see the FAQ.

Create an endpoint

curl -i https://stubpoint.dev/api/endpoints \
  -H 'Content-Type: application/json' \
  -d '{
    "status": 200,
    "content_type": "application/json",
    "body": "{\"ok\":true}",
    "headers": {"X-Test": "yes"},
    "methods": ["GET", "POST"],
    "delay_ms": 250
  }'

Request fields

status

HTTP status code from 200 to 599.

Default: 200

content_type

Response content type.

Default: application/json

Use one of the allowed response content types shown in the create form.

body

Response body returned as sent.

If body is omitted from an API request, Stubpoint uses the default JSON body. If body is sent as an empty string, the endpoint returns an empty body.

Stubpoint does not parse, validate, or reformat the body based on the selected content type. This makes it useful for malformed payloads, client error handling, and mismatched content types.

headers

Optional response headers as a JSON object.

Reserved or unsafe headers may be rejected or ignored to protect the service and keep responses valid.

methods

Allowed HTTP methods for the generated endpoint.

Default: GET

Supported methods: GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS.

delay_ms

Optional best-effort simulated latency before the configured response is written.

Default: 0

Valid values: integer milliseconds from 0 through 10000. The timer is capped at 10 seconds and is not a guaranteed exact sleep duration.

Delay applies to every configured mock response after the endpoint and method are accepted, regardless of content type, body format, status code, or allowed method.

Response

A successful request returns 201 Created with the slug, mock URL, status, content type, allowed methods, and delay when nonzero.

{
  "slug": "quiet-signal-lake-p4x2",
  "url": "https://stubpoint.dev/mock/quiet-signal-lake-p4x2",
  "status": 200,
  "content_type": "application/json",
  "methods": ["GET", "POST"],
  "delay_ms": 250
}

Call the mock endpoint

Call /mock/{slug} with an allowed method to get the configured status, content type, safe headers, optional response delay, and body.

curl -i https://stubpoint.dev/mock/quiet-signal-lake-p4x2

If the endpoint was created with multiple allowed methods, each allowed method returns the same configured response.

Missing endpoints return 404.

Disallowed methods return 405.

Static endpoints

Use built-in endpoints when you only need a quick response and do not need to create a stored endpoint.

/status/{code}

Returns the requested status code from 200 through 599.

/json

Returns a simple JSON response.

/xml

Returns a simple XML response.

/text

Returns a simple plain text response.

/headers

Returns a response useful for checking headers.

Static endpoints may change as Stubpoint improves.

Recipes

The testing recipe library can prefill the create form with practical bodies for validation errors, pagination, auth responses, webhooks, frontend states, data formats, and edge cases.

Errors

201

Endpoint created.

422

Validation error. This can happen when a field is unsupported, reserved, too large, malformed, or outside the allowed range.

404

Endpoint is missing.

405

Method is not allowed for that endpoint.

429

Traffic was rate-limited to prevent abuse.

500 or 503

Temporary service or storage failure.