AP

A guide for creating consistent and documented RESTful APIs.

Install

mkdir -p .claude/skills/api-design-microsoft && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17891" && unzip -o skill.zip -d .claude/skills/api-design-microsoft && rm skill.zip

Installs to .claude/skills/api-design-microsoft

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
120 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Define naming conventions for RESTful API resources
  • Specify appropriate HTTP methods for API actions
  • Document API endpoints with required details

How it works

The skill provides guidelines for RESTful API design, covering naming, HTTP methods, error handling, status codes, and documentation requirements, based on internal engineering practices.

Inputs & outputs

You give it
request to design or document an API
You get back
API design adhering to RESTful conventions and documentation requirements

When to use api-design

  • Design new API endpoints
  • Document existing REST APIs
  • Standardize API error handling

About this skill

API Design

Overview

Standards and patterns for designing consistent, well-documented RESTful APIs. Covers naming, HTTP methods, error handling, status codes, and documentation requirements.

Key Concepts

Naming Conventions

  • Plural nouns for resources: /users, /orders, /products
  • Kebab-case for multi-word: /user-profiles
  • Nest related resources: /users/{id}/orders
  • Query params for filtering: /users?role=admin&active=true

HTTP Methods

MethodPurposeIdempotentResponse
GETReadYes200 + body
POSTCreateNo201 + body + Location
PUTReplaceYes200 + body
PATCHPartial updateNo200 + body
DELETERemoveYes204 (no body)

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Human-readable description",
    "details": [
      {"field": "email", "message": "Invalid email format"}
    ]
  }
}

Status Codes

  • 200: Success — 201: Created — 204: No content
  • 400: Bad request — 401: Unauthorized — 403: Forbidden
  • 404: Not found — 409: Conflict — 422: Unprocessable
  • 429: Rate limited — 500: Internal error

Decision Framework

ScenarioMethodPathStatus
List itemsGET/items200
Get one itemGET/items/{id}200 / 404
Create itemPOST/items201
Full updatePUT/items/{id}200 / 404
Partial updatePATCH/items/{id}200 / 404
Delete itemDELETE/items/{id}204 / 404
SearchGET/items?q=term200
Bulk actionPOST/items/batch200 / 207

Documentation Requirements

Every endpoint must document:

  1. HTTP method and path
  2. Description
  3. Request parameters (path, query, body) with types
  4. Response schema with examples
  5. Error codes and descriptions
  6. Authentication requirements

Common Pitfalls

  • Using verbs in URLs — Use nouns: /users not /getUsers
  • Inconsistent error format — Use the same error schema everywhere
  • Missing pagination — Any list endpoint that can grow needs pagination
  • No versioning strategy — Decide early: URL (/v1/) or header-based

When not to use it

  • When the API does not use HTTP methods
  • When the goal is not to standardize API design

Limitations

  • Specific to RESTful API design
  • Focuses on HTTP methods and status codes
  • Requires adherence to specified naming conventions

How it compares

This skill offers a structured framework for designing consistent and well-documented RESTful APIs, which helps avoid common pitfalls and ensures standardization across different API implementations.

Compared to similar skills

api-design side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
api-design (this skill)01moNo flagsIntermediate
api-designer03moNo flagsAdvanced
mcp-builder1363moReviewAdvanced
api-design-principles722moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by microsoft

View all by microsoft

Search skills

Search the agent skills registry