rest-api

Guidance for building REST APIs, web interfaces that let programs exchange data over HTTP using URLs, requests, and responses.

In plain words
What is it for?
Designing and implementing create, read, update, and delete operations, plus versioning, pagination, filtering, and OpenAPI documentation.
Why use it?
It helps keep routes, status codes, authentication, errors, and documentation consistent as an API grows.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/plazmodium/odin-workflow/rest-api
Any agent
npx skills add Plazmodium/odin-workflow --skill rest-api
Clone the repo
git clone --depth 1 https://github.com/Plazmodium/odin-workflow

Made for: Claude Code, Codex.

Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,479 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00030 $0.02479
Opus 5 $0.00015 $0.01239
Sonnet 5 $0.00006 $0.00496
Haiku 4.5 $0.00003 $0.00248

Measured yesterday against content hash 824a2ca4e6c7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rest-api scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/skills/api/rest-api/SKILL.md · 470 lines

How it starts

The opening of the file, as written. The whole thing — 470 lines — stays where its author put it; the contents beside it link to each section on GitHub.

REST API Design

Instructions

  1. Assess the API need: CRUD operations, complex queries, or real-time data.
  2. Follow REST conventions:
    • Use nouns for resources, not verbs
    • Proper HTTP methods and status codes
    • Consistent naming conventions
    • HATEOAS where appropriate
  3. Provide complete examples: Include routes, handlers, and response schemas.
  4. Guide on best practices: Versioning, pagination, filtering, error handling.

HTTP Methods

Method Purpose Idempotent Safe
GET Retrieve resource(s) Yes Yes
POST Create resource No No
PUT Replace resource Yes No
PATCH Partial update No No
DELETE Remove resource Yes No

Resource Naming

# Good - Nouns, plural
GET    /users
GET    /users/:id
POST   /users
PUT    /users/:id
PATCH  /users/:id
DELETE /users/:id

# Nested resources
GET    /users/:userId/posts
GET    /users/:userId/posts/:postId
POST   /users/:userId/posts

# Bad - Verbs, actions in URL
GET    /getUsers
POST   /createUser
GET    /getUserById/:id

Status Codes

Success (2xx)

// 200 OK - Successful GET, PUT, PATCH
res.status(200).json({ data: user });

// 201 Created - Successful POST
res.status(201).json({ data: newUser });

// 204 No Content - Successful DELETE
res.status(204).send();

Client Errors (4xx)

// 400 Bad Request - Invalid input
res.status(400).json({
  error: {
    code: 'VALIDATION_ERROR',
    message: 'Invalid request body',
    details: [
      { field: 'email', message: 'Must be a valid email' }
    ]
  }
});

// 401 Unauthorized - Not authenticated
res.status(401).json({
  error: {
    code: 'UNAUTHORIZED',
    message: 'Authentication required'
  }
});

// 403 Forbidden - Authenticated but not authorized
res.status(403).json({
  error: {
    code: 'FORBIDDEN',
    message: 'You do not have permission to access this resource'
  }
});

// 404 Not Found
res.status(404).json({
  error: {
    code: 'NOT_FOUND',
    message: 'User not found'
  }
});

// 409 Conflict - Resource already exists
res.status(409).json({
  error: {
    code: 'CONFLICT',
    message: 'Email already registered'
  }
});

// 422 Unprocessable Entity - Semantic errors
res.status(422).json({
  error: {
    code: 'UNPROCESSABLE_ENTITY',
    message: 'Cannot delete user with active subscriptions'
  }
});

// 429 Too Many Requests - Rate limiting
res.status(429).json({
  error: {
    code: 'RATE_LIMITED',
    message: 'Too many requests',
    retryAfter: 60
  }
});

Read the full file on GitHub · 470 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 470 lines · 30 tokens per session scan A 824a2ca4e6c7

Subscribe to this mod's changes

rest-api is a skill published in the GitHub repository Plazmodium/odin-workflow (0 stars, last pushed 3mo ago), licensed MIT. It adds 30 tokens to every session and 2,479 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other skills, from other repositories

fieldflow-cli

Use FieldFlow to inspect and reduce noisy JSON CLI output before it reaches model context. Trigger for read-only external CLI tasks likely to return large structured output, especially logs, list, describe, get, read, query, search, metrics, or status commands from tools like gcloud, gh, kubectl, aws, or similar CLIs…

guillaumegay13/fieldflow · 117 tokens

tray-cupons

API completa de cupons de desconto da Tray (recurso discountcoupons). Cobre criar, editar, listar, consultar e excluir cupons (CRUD) e gerenciar os relacionamentos do cupom com clientes, produtos, categorias, marcas, fretes e cupom-presente, além da geração de cupom de troca a partir de um pedido. Total de 21…

tray-tecnologia/tray-api-ai-plugin · 156 tokens

tray-frete

API de cotação e listagem de frete da Tray (recurso shippings, somente leitura). Cobre dois endpoints GET: /shippings/cotation/ calcula valor e prazo de entrega para um ou mais produtos rumo a um CEP, consultando os gateways de frete configurados na loja (Frete-X API, Correios, transportadoras); e /shippings/ lista as…

tray-tecnologia/tray-api-ai-plugin · 176 tokens

tray-status-pedido

API de Status de Pedido da Tray (recurso /orders/statuses). Cobre o CRUD completo do CATÁLOGO de status de pedido da loja: listar, consultar por ID, criar, atualizar e excluir tipos de status, definindo nome, descrição, cores hexadecimais (backgroundcolor/fontcolor) e o tipo de fluxo (type: open/closed/cancelled).…

tray-tecnologia/tray-api-ai-plugin · 155 tokens

tray-multicd

API de Multi-CD (Centros de Distribuição) da Tray. Cobre o CRUD de centros de distribuição (/multicd/distribution-centers: listar, consultar, criar, atualizar e excluir CDs) e a gestão de estoque distribuído por CD (/multicd/stock/detailed/product/:id, /multicd/stock/detailed/variant/:id e PUT…

tray-tecnologia/tray-api-ai-plugin · 204 tokens

tray-pagamentos

API de informações de pagamento da Tray (recurso payments). Cobre listar, consultar, criar, atualizar e excluir registros de pagamento (CRUD em /payments), além de consultar as opções de pagamento ativas da loja (/payments/options) e as configurações globais de pagamento (/payments/settings). Total de 7 endpoints.…

tray-tecnologia/tray-api-ai-plugin · 176 tokens