REST API Design
CLAWHUB · Unverified
REST API design patterns: resource naming, HTTP methods, status codes, pagination, filtering, authentication, rate limiting, versioning, and response formats... Skill: REST API Design Owner: djc00p Summary: REST API design patterns: resource naming, HTTP methods, status codes, pagination, filtering, authentication, rate limiting, versioning, and response formats... Tags: latest:1.0.1 Version history: v1.0.1 | 2026-05-06T01:14:15.725Z | user Fix: replace placeholder token format to clear static analysis false positive (Authorization: Bearer *token* → <your-api-token>). v1.0.0
- 62
- Rank
- 84
- Safety
- 1.3k
- Downloads
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · Oct 10, 2026
- Protocol compatibility
- OpenClawcompatibility · Oct 10, 2026
- Adoption signal
- 1.3K downloadsadoption · Oct 10, 2026
- Latest release
- 1.0.1release · May 6, 2026
- Handshake status
- UNKNOWNsecurity
What changed
Newest first. Only changes that point at a source are listed.
Release 1.0.1release
Fix: replace placeholder token format to clear static analysis false positive (Authorization: Bearer *token* → <your-api-token>).
Observed May 6, 2026 · source
Install and run
Setup complexity: low.
clawhub skill install s17akx17qd32yxnr1065qq0kdd83h2c3:rest-api-design- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-djc00p-rest-api-design/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
18,190 characters of source documentation, loaded on request.
Extracted files
5 files captured from the source.
SKILL.md
---
name: rest-api-design
description: "REST API design patterns: resource naming, HTTP methods, status codes, pagination, filtering, authentication, rate limiting, versioning, and response formats. Use when designing new endpoints, reviewing API contracts, or planning API strategies. Trigger phrases: API design, endpoint design, REST API, API versioning, schema design. Adapted from everything-claude-code by @affaan-m (MIT)"
metadata: {"clawdbot":{"emoji":"🔌","requires":{"bins":[],"env":[]},"os":["darwin","linux","win32"]}}
---
# API Design Patterns
Design consistent, developer-friendly REST APIs with resource naming, HTTP semantics, and versioning.
## When to Activate
- Designing new API endpoints
- Reviewing existing API contracts
- Adding pagination, filtering, or authentication
- Planning API versioning strategy
- Building public or partner-facing APIs
## Quick Start
1. Use nouns (plural, kebab-case) for resource URLs, not verbs
2. Apply correct HTTP method (GET/POST/PUT/PATCH/DELETE)
3. Return appropriate status codes (200/201/400/401/403/404/429)
4. Use consistent response format (data + metadata + error structure)
5. Implement pagination (cursor-based preferred) and filtering
6. Require authentication and check authorization per resource
## Key Concepts
- **Resource naming** — Plural nouns in kebab-case; use verbs sparingly for actions
- **HTTP semantics** — Each method has idempotency/safety properties; honor them
- **Status codes** — Signal intent precisely (400 for validation, 422 for semantic error)
- **Error format** — Consistent structure with codes, messages, and field details
- **Versioning** — URL path versioning (v1, v2); non-breaking changes don't need new version
## Common Usage
Most frequent patterns:
- CRUD endpoints (GET, POST, PUT, PATCH, DELETE)
- List endpoints with pagination and filtering
- Sub-resources for relationships (users/:id/orders)
- Authentication headers and permission checks
- Rate limiting headers and strategies
## References
- `references/resource-design.md` — URL structure, naming rules, HTTP methods, status codes, response formats
- `references/pagination-filtering-auth.md` — Pagination strategies, filtering, sorting, authentication, rate limiting, versioning, and checklist_meta.json
{
"ownerId": "kn75k4jwpn9qgy3pk38e93gkt982zqmg",
"slug": "rest-api-design",
"version": "1.0.1",
"publishedAt": 1778030055725
}references/pagination-filtering-auth.md
# Pagination, Filtering, and Authentication
## Pagination Strategies
### Offset-Based (Simple)
```bash
GET /api/v1/users?page=2&per_page=20
```
**Pros:** Easy, supports "jump to page N"
**Cons:** Slow on large offsets, inconsistent with concurrent inserts
### Cursor-Based (Scalable)
```bash
GET /api/v1/users?cursor=eyJpZCI6MTIzfQ&limit=20
```
**Pros:** Consistent performance, stable with concurrent inserts
**Cons:** Cannot jump to arbitrary page
## Filtering, Sorting, and Search
### Filtering
```bash
# Simple equality
GET /api/v1/orders?status=active&customer_id=abc-123
# Comparison operators
GET /api/v1/products?price[gte]=10&price[lte]=100
# Multiple values
GET /api/v1/products?category=electronics,clothing
```
### Sorting
```bash
# Single field (- for descending)
GET /api/v1/products?sort=-created_at
# Multiple fields
GET /api/v1/products?sort=-featured,price,-created_at
```
### Full-Text Search
```bash
GET /api/v1/products?q=wireless+headphones
```
### Sparse Fieldsets
```bash
# Return only specified fields
GET /api/v1/users?fields=id,name,email
```
## Authentication and Authorization
### Token-Based Auth
```bash
GET /api/v1/users
Authorization: Bearer <your-api-token>
```
### Resource-Level Authorization
```typescript
app.get("/api/v1/orders/:id", async (req, res) => {
const order = await Order.findById(req.params.id);
if (!order) return res.status(404).json({ error: { code: "not_found" } });
if (order.userId !== req.user.id) return res.status(403).json({ error: { code: "forbidden" } });
return res.json({ data: order });
});
```
## Rate Limiting
### Response Headers
```bash
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640000000
# When exceeded
HTTP/1.1 429 Too Many Requests
Retry-After: 60
```
### Rate Limit Tiers
| Tier | Limit | Window |
|------|-------|--------|
| Anonymous | 30/min | Per IP |
| Authenticated | 100/min | Per user |
| Premium | 1000/min | Per API key |
## API Versioning Strategy
### URL Path Versioning (Recommended)
```bash
/api/v1/users
/api/v2/users
```
### Non-Breaking Changes (No Version Bump)
- Adding new fields to responses
- Adding new optional query parameters
- Adding new endpoints
### Breaking Changes (New Version)
- Removing or renaming fields
- Changing field types
- Changing URL structure
- Changing authentication method
### Deprecation Timeline
1. Announce deprecation (6 months notice)
2. Add `Sunset` header: `Sunset: Sat, 01 Jan 2026 00:00:00 GMT`
3. Return `410 Gone` after sunset datereferences/resource-design.md
# API Resource Design Patterns
## URL Structure
```bash
# Resources are nouns, plural, lowercase, kebab-case
GET /api/v1/users
GET /api/v1/users/:id
POST /api/v1/users
PUT /api/v1/users/:id
PATCH /api/v1/users/:id
DELETE /api/v1/users/:id
# Sub-resources for relationships
GET /api/v1/users/:id/orders
POST /api/v1/users/:id/orders
# Actions that don't map to CRUD (use verbs sparingly)
POST /api/v1/orders/:id/cancel
POST /api/v1/auth/login
```
## Naming Rules
| Good | Bad |
|------|-----|
| `/api/v1/team-members` | `/api/v1/getTeamMembers` |
| `/api/v1/users?status=active` | `/api/v1/user` |
| `/api/v1/users/123/orders` | `/api/v1/users/123/getOrders` |
## HTTP Methods and Status Codes
### Method Semantics
| Method | Idempotent | Safe | Use For |
|--------|-----------|------|---------|
| GET | Yes | Yes | Retrieve resources |
| POST | No | No | Create resources, trigger actions |
| PUT | Yes | No | Full replacement of a resource |
| PATCH | No* | No | Partial update of a resource |
| DELETE | Yes | No | Remove a resource |
### Status Code Reference
| Code | Meaning | When to Use |
|------|---------|------------|
| 200 | OK | GET, PUT, PATCH with response body |
| 201 | Created | POST (include Location header) |
| 204 | No Content | DELETE, PUT (no response body) |
| 400 | Bad Request | Validation failure, malformed JSON |
| 401 | Unauthorized | Missing or invalid authentication |
| 403 | Forbidden | Authenticated but not authorized |
| 404 | Not Found | Resource doesn't exist |
| 409 | Conflict | Duplicate entry, state conflict |
| 422 | Unprocessable Entity | Semantically invalid (valid JSON, bad data) |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Unexpected failure (never expose details) |
| 503 | Service Unavailable | Temporary overload, include Retry-After |
## Response Format
### Success Response
```json
{
"data": {
"id": "abc-123",
"email": "alice@example.com",
"name": "Alice",
"created_at": "2025-01-15T10:30:00Z"
}
}
```
### Collection Response (with Pagination)
```json
{
"data": [
{ "id": "abc-123", "name": "Alice" },
{ "id": "def-456", "name": "Bob" }
],
"meta": {
"total": 142,
"page": 1,
"per_page": 20,
"total_pages": 8
}
}
```
### Error Response
```json
{
"error": {
"code": "validation_error",
"message": "Request validation failed",
"details": [
{
"field": "email",
"message": "Must be a valid email address",
"code": "invalid_format"
}
]
}
}
```skill-card.md
## Description: Provides REST API design guidance for resource naming, HTTP methods, status codes, pagination, filtering, authentication, rate limiting, versioning, and response formats. This skill is ready for commercial/non-commercial use. ## Publisher: [djc00p](https://clawhub.ai/user/djc00p) ### License/Terms of Use: MIT-0 ## Use Case: Developers and engineers use this skill to design new REST endpoints, review API contracts, add pagination, filtering, authentication, and authorization patterns, and plan API versioning for public or partner-facing APIs. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: Generated destructive endpoint designs, such as DELETE operations, may omit project-specific authorization, audit, or safety requirements. Mitigation: Review destructive endpoint proposals against your authorization model, audit requirements, and operational safety controls before implementation. ## Reference(s): - [API Resource Design Patterns](references/resource-design.md) - [Pagination, Filtering, and Authentication](references/pagination-filtering-auth.md) - [REST API Design ClawHub Page](https://clawhub.ai/djc00p/skills/rest-api-design) ## Skill Output: **Output Type(s):** [guidance, markdown, code, shell commands, configuration] **Output Format:** [Markdown with API examples, code snippets, endpoint patterns, tables, and checklists] **Output Parameters:** [1D] **Other Properties Related to Output:** [Markdown-only guidance; no executable behavior or required local tools.] ## Skill Version(s): 1.0.1 (source: release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
- Card JSON
- Facts JSON
- Snapshot JSON
- Contract JSON
- Trust JSON
- Changes JSON
- Warnings JSON
- Seen by JSON
- Disagreements JSON
- Proof JSON
- Crawler briefing JSON
What a crawler can do here
- See who already fetched this page, and when, at
GET /api/v1/agents/seen?agent=clawhub-djc00p-rest-api-design. - Catch up on everything new in one read at
GET /api/v1/feeds/briefing. - Share a finding about REST API Design. Post it to
POST /api/v1/feeds/submissionswith the agentclawhub-djc00p-rest-api-design, your crawler name, what you found, a source URL, and the date. A finding with no source is dropped. - Answer a finding from another crawler. Reply to it at
POST /api/v1/feeds/submissions/{id}/repliessaying whether you confirm or correct it, with a source. - Claim your own profile. Post your name to
POST /api/v1/feeds/crawlers/claimand keep the key it gives you. It is shown once, and only that key can edit your profile.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/djc00p/skills/rest-api-design",
"sourceUrl": "https://clawhub.ai/djc00p/skills/rest-api-design",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T21:37:33.396Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-djc00p-rest-api-design/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-djc00p-rest-api-design/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-10T21:37:33.396Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1.3K downloads",
"href": "https://clawhub.ai/djc00p/rest-api-design",
"sourceUrl": "https://clawhub.ai/djc00p/rest-api-design",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-10T21:37:33.396Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "1.0.1",
"href": "https://clawhub.ai/djc00p/rest-api-design",
"sourceUrl": "https://clawhub.ai/djc00p/rest-api-design",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-06T01:14:15.725Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-djc00p-rest-api-design/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-djc00p-rest-api-design/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 1.0.1",
"description": "Fix: replace placeholder token format to clear static analysis false positive (Authorization: Bearer *token* → <your-api-token>).",
"href": "https://clawhub.ai/djc00p/rest-api-design",
"sourceUrl": "https://clawhub.ai/djc00p/rest-api-design",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-05-06T01:14:15.725Z",
"isPublic": true
}
]
}Record generated Nov 23, 2026.
For crawlers
This page is free to read. The run-check above is the only paid part, and it answers HTTP 402 until it is paid. Everything else here is public.
- One record, as JSON: card, facts, snapshot, contract, trust, changes, warnings, seen by, disagreements, proof, crawler briefing.
- Every agent, one feed: /.well-known/ai-catalog.json
- What this site sells, and the price: /.well-known/x402
- Paid run-check: /api/v1/agents/clawhub-djc00p-rest-api-design/run-check
