Skip to content
Back to skills

Rest Api Design

ASecurity

REST API design — resource modelling, HTTP methods and status codes, problem+json errors, cursor pagination, filtering and sorting, idempotency keys, conditional requests (ETag), OpenAPI schema-first, security of endpoints. Use to design or review HTTP APIs (REST, OpenAPI, HTTP API, status codes, pagination, idempotency).

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentsgoapisecurity

Works with

  • cursor
  • cli
  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add vectora-os/kit --skill rest-api-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rest Api Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rest Api Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectora-os-rest-api-design/badge)](https://www.skillsdirectory.com/skills/vectora-os-rest-api-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rest-api-design
description: REST API design — resource modelling, HTTP methods and status codes, problem+json errors, cursor pagination, filtering and sorting, idempotency keys, conditional requests (ETag), OpenAPI schema-first, security of endpoints. Use to design or review HTTP APIs (REST, OpenAPI, HTTP API, status codes, pagination, idempotency).
metadata:
  category: api
---

# REST API design

## Purpose

Design HTTP APIs that are predictable, evolvable and safe to retry.

**Use when:** designing or reviewing HTTP endpoints.

**Not for:** RPC-style internal calls better served by gRPC.

## Inputs

- Use cases, consumers, data model.

## Outputs

- OpenAPI spec with examples and error catalogue.

## Read first

- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "rest api design"` for prior decisions, patterns and anti-patterns.
- [API design standard](../../../standards/api-design.md)

## Steps

1. **Resources.** Model nouns and relationships; avoid verbs in paths.
   Done when every use case maps to a resource operation.
2. **Semantics.** Correct methods and status codes; POST with `Idempotency-Key` for creates that may retry.
   Done when retries are safe.
3. **Collections.** Cursor pagination, filter and sort grammar, limits.
   Done when no unbounded list.
4. **Errors.** problem+json with stable `type` codes.
   Done when each error has a code and example.

## Best practices

- Schema-first; generate server stubs and clients.
- Consistent naming per the standard.
- Return 404 for resources outside the caller's scope.

## Common mistakes

- 200 with an error body.
- Offset pagination on large mutable sets.
- Leaking internal ids or stack traces.

## Example

`POST /v1/invoices` with `Idempotency-Key`, `GET /v1/invoices?cursor=…&status=paid&limit=50`, errors `invoice.already_paid` as problem+json.

## Reusable prompt

```text
Apply the REST API design skill (.agents/skills/rest-api-design/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Design the endpoints schema-first with methods, status codes, pagination, idempotency and an error catalogue.
Return: OpenAPI spec with examples and error catalogue..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.