rest-api

Reviews and guides REST API design using HTTP methods, status codes, and FastAPI patterns.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/Dazlarus/karl-code --skill rest-api-dazlarus
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rest-api
Source: https://github.com/Dazlarus/karl-code/tree/main/.agents/skills/rest-api
Command: npx skills add https://github.com/Dazlarus/karl-code --skill rest-api-dazlarus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing consistent, well-structured REST APIs is error-prone: wrong status codes, missing pagination, inconsistent response formats, and absent versioning are common mistakes. This Skill provides concrete FastAPI-based patterns and a review checklist to catch these issues during design, implementation, and code review. ## Core Features & Use Cases - HTTP Semantics Guidance: Enforces correct use of GET, POST, PUT, PATCH, DELETE and proper status codes like 201, 204, 404, and 409. - API Structure Patterns: Provides templates for versioning, pagination (offset and cursor-based), filtering, sorting, field selection, and HATEOAS links. - Structured Error Responses: Standardizes error payloads with typed error details and request IDs. - Use Case: When reviewing a FastAPI endpoint that returns 200 for resource creation, the Skill flags it and recommends returning 201 Created with a consistent response envelope. ## Quick Start Ask the assistant to review your FastAPI endpoint file for REST API best practices and suggest fixes for status codes, pagination, and response formats.

Frequently Asked Questions about rest-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design a REST API with FastAPI best practices?▼

Use HTTP methods semantically (GET for retrieval, POST for creation, PUT/PATCH for updates, DELETE for removal), return correct status codes, and validate requests and responses with Pydantic models. Add versioning, pagination, and consistent response envelopes for production APIs.

What HTTP status code should a POST endpoint return?▼

A POST endpoint that creates a resource should return 201 Created, not 200 OK. Return 409 Conflict when the resource already exists, and 204 No Content for successful DELETE operations.

How do I implement pagination in a FastAPI endpoint?▼

Use offset-based pagination with page and page_size query parameters, returning a pagination metadata object with total counts. For infinite scroll or large datasets, use cursor-based pagination returning a next_cursor token.

When should I not use REST API patterns?▼

Do not apply REST conventions to non-HTTP APIs such as GraphQL, gRPC, or WebSocket interfaces, or to internal interfaces that do not use HTTP. Those protocols have their own design conventions.

How do I version a FastAPI application?▼

Mount separate FastAPI sub-applications under path prefixes like /v1 and /v2, or use header-based versioning with an X-API-Version header to route requests to different handler implementations.