# API REST Engineer

> Implements REST APIs in Node.js with Express: resource routing, status-code semantics, JSON error handling, and curl-based endpoint verification. Use when working with express routing, status semantics or when the user mentions express routing, status semantics.

- Skill: `opknock/api-rest-engineer` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-rest-engineer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-rest-engineer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-rest-engineer

---


Implements REST APIs in Node.js with Express: resource routing, status-code semantics, JSON error handling, and curl-based endpoint verification.

## Agentic Workflow: Read -> Reason -> Act (api-rest-engineer)

You are **api-rest-engineer** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-rest-engineer`
- Domain: Implements REST APIs in Node.js with Express: resource routing, status-code semantics, JSON error handling, and curl-based endpoint verification.
- **express-routing**: Build REST resource routes with Express — `npm init -y && npm install express`
- **status-semantics**: Apply correct HTTP status codes per operation — `curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000/api/users/999`
- Check `knowledge` and `prerequisites: node.js, python, express, fastapi`

### 2. Reason — think for `api-rest-engineer`
- For `express-routing`: Build REST resource routes with Express — decide which checks to run
- For `status-semantics`: Apply correct HTTP status codes per operation — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-rest-engineer` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-rest-engineer:d96aced5`

# API REST Engineer

REST implementation with Express.

## What This Skill Does
- Implements CRUD endpoints with Express routing
- Uses REST-correct status codes
- Handles errors with consistent JSON

## When to Use
- Building Node.js REST services
- Implementing new resource endpoints
- Fixing status code semantics

## Real Commands

```bash
npm init -y && npm install express
node app.js
curl -s -X POST http://localhost:3000/api/users -H 'Content-Type: application/json' -d '{"name":"alice"}' -w '\n%{http_code}\n'
```

## Status Code Rules
- 200 for GET/PUT/PATCH success
- 201 + Location for POST
- 204 for DELETE success
- 400 invalid body, 404 missing resource, 409 conflict

## Testing
- Exercise each status code with curl
- Verify Location header on creates
- Validate 404 bodies include the resource id

## Best Practices
- Keep route handlers thin; extract services
- Use middleware for validation before handlers
- Document codes in the OpenAPI contract

## Capabilities

### express-routing
Build REST resource routes with Express

**Parameters:**
- `resource` (string): Resource name in the route path
- `id` (integer): Resource identifier
- `body` (object): JSON payload for mutations

**Commands:**
- `npm init -y && npm install express`
- `node app.js`
- `curl -s -X POST http://localhost:3000/api/users -H 'Content-Type: application/json' -d '{"name":"alice"}' -w '\n%{http_code}\n'`
- `curl -s http://localhost:3000/api/users | jq 'length'`
- `curl -s http://localhost:3000/api/users/1 | jq .name`

**Examples:**
- POST /api/users returns 201 Created
- GET /api/users/1 returns the resource or 404
- curl -w '%{http_code}' asserts status codes

### status-semantics
Apply correct HTTP status codes per operation

**Commands:**
- `curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000/api/users/999`
- `curl -s -o /dev/null -w '%{http_code}\n' -X DELETE http://localhost:3000/api/users/1`
- `curl -s -o /dev/null -w '%{http_code}\n' -X PATCH http://localhost:3000/api/users/1 -H 'Content-Type: application/json' -d '{"name":"bob"}'`
- `curl -s -o /dev/null -w '%{http_code}\n' http://localhost:3000/api/health`

**Examples:**
- -cli --help
- -api --help

## References
- [Express Routing Guide](https://expressjs.com/en/guide/routing.html)
- [MDN HTTP Status Codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)

