Skip to content
Development
Command

/test-endpoint

Test an API endpoint with various request scenarios and validate responses.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/test-endpoint

Context preview

What this command does when you run it.

Test an API endpoint with various request scenarios and validate responses.

Command definition

test-endpoint.md

Test an API endpoint with various request scenarios and validate responses.

Steps

1. Parse the endpoint specification:

  • URL, HTTP method, headers, authentication.
  • Request body (JSON, form data, multipart).
  • Expected response status and body schema.

2. Generate test scenarios:

  • **Happy path**: Valid request with expected response.
  • **Validation**: Missing required fields, invalid types, out-of-range values.
  • **Auth**: Missing token, expired token, insufficient permissions.
  • **Edge cases**: Empty body, very large payload, special characters.
  • **Idempotency**: Repeated identical requests produce consistent results.

3. Execute each test:

  • Send the request using `curl` or `fetch`.
  • Capture response status, headers, body, and timing.
  • Validate against expected results.

4. Check response quality:

  • Correct content type header.
  • Consistent error format across failure cases.
  • Proper HTTP status codes (not 200 for errors).
  • No sensitive data in error responses.

5. Generate a test summary with pass/fail for each scenario.

Format

API Test: <METHOD> <endpoint>

| Scenario | Status | Expected | Actual | Time | Result |
|----------|--------|----------|--------|------|--------|
| Valid request | 200 | 200 | 200 | 45ms | PASS |
| Missing auth | 401 | 401 | 401 | 12ms | PASS |
| Invalid body | 400 | 400 | 500 | 23ms | FAIL |

Pass: <N>/<total>
Issues: <list of failures>

Rules

  • Test authentication and authorization for every endpoint.
  • Verify error responses do not leak stack traces or internal details.
  • Check that CORS headers are set correctly for browser-accessible APIs.
  • Test with realistic payloads, not minimal test data.
  • Verify rate limiting works as documented.
Read more
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin