Auth responses

Token, permission, and session cases for auth flows. Load a template into the create form, then adjust the response before creating an endpoint.

401application/jsonGET, POST

Token error

Test the sign-in prompt for expired or invalid tokens.

Use template
View payload and cURL

Headers

{
  "WWW-Authenticate": "Bearer realm=\"stubpoint\""
}

Body

{
  "error": "invalid_token",
  "message": "Sign in again to continue."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"invalid_token\",\"message\":\"Sign in again to continue.\"}",
  "content_type": "application/json",
  "headers": {
    "WWW-Authenticate": "Bearer realm=\"stubpoint\""
  },
  "methods": [
    "GET",
    "POST"
  ],
  "status": 401
}'
403application/jsonGET

Forbidden

Check the state shown when a user lacks permission.

Use template
View payload and cURL

Headers

none

Body

{
  "error": "forbidden",
  "message": "You do not have access to this resource."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"forbidden\",\"message\":\"You do not have access to this resource.\"}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "GET"
  ],
  "status": 403
}'
401application/jsonGET, POST

Missing API key

Test API clients that forgot to send a key.

Use template
View payload and cURL

Headers

{
  "WWW-Authenticate": "ApiKey realm=\"stubpoint\""
}

Body

{
  "error": "missing_api_key",
  "message": "Send an API key with this request."
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\"error\":\"missing_api_key\",\"message\":\"Send an API key with this request.\"}",
  "content_type": "application/json",
  "headers": {
    "WWW-Authenticate": "ApiKey realm=\"stubpoint\""
  },
  "methods": [
    "GET",
    "POST"
  ],
  "status": 401
}'
403application/jsonPOST

Extra verification required

Check flows that need another verification step before continuing.

Use template
View payload and cURL

Headers

none

Body

{
  "error": "verification_required",
  "message": "Complete the next verification step before continuing.",
  "next_step": "code_challenge"
}

Create with cURL

curl -i 'https://stubpoint.dev/api/endpoints' -H 'Content-Type: application/json' -d '{
  "body": "{\n  \"error\": \"verification_required\",\n  \"message\": \"Complete the next verification step before continuing.\",\n  \"next_step\": \"code_challenge\"\n}",
  "content_type": "application/json",
  "headers": null,
  "methods": [
    "POST"
  ],
  "status": 403
}'

Other recipe shelves