Iii iii-http-endpoints
install
source · Clone the upstream repo
git clone https://github.com/iii-hq/iii
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/iii-hq/iii "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/iii-http-endpoints" ~/.claude/skills/iii-hq-iii-iii-http-endpoints && rm -rf "$T"
manifest:
skills/iii-http-endpoints/SKILL.mdsource content
HTTP Endpoints
Comparable to: Express, Fastify, Flask
Key Concepts
Use the concepts below when they fit the task. Not every HTTP endpoint needs all of them.
- Each route is a registered function bound to a path and method via an HTTP trigger
- The handler receives an ApiRequest object containing
,body
,path_params
, andheadersmethod - Handlers return
to shape the HTTP response{ status_code, body, headers } - iii-http serves all registered routes on port 3111
- Path parameters use colon syntax (e.g.
) and arrive in/users/:idpath_params - Middleware can run before handlers via
in the trigger config — seemiddleware_function_ids
for detailsiii-http-middleware
Architecture
HTTP request → iii-http (port 3111) → registerTrigger route match (method + path) → registerFunction handler (receives ApiRequest) → { status_code, body, headers } response
iii Primitives and HTTP Trigger Config Used
| Primitive | Purpose |
|---|---|
| Define the handler for a route |
| Bind a route path and method to a function |
| Route configuration on the trigger |
| Optional middleware chain before the handler |
Reference Implementation
See ../references/http-endpoints.js for the full working example — a REST API with parameterized routes handling GET and POST requests.
Also available in Python: ../references/http-endpoints.py
Also available in Rust: ../references/http-endpoints.rs
Common Patterns
Code using this pattern commonly includes, when relevant:
— worker initializationregisterWorker(url, { workerName })
— define the route handlerregisterFunction(id, handler)
— bind path and methodregisterTrigger({ type: 'http', config: { api_path, http_method } })
— parsed request body for POST/PUTreq.body
— extracted path parametersreq.path_params
— response shapereturn { status_code: 200, body: { data }, headers: { 'Content-Type': 'application/json' } }
— structured logging per handlerconst logger = new Logger()
Adapting This Pattern
Use the adaptations below when they apply to the task.
- Add more routes by registering additional functions and HTTP triggers with distinct paths or methods
- Use
for resource identifiers (e.g.path_params
)/orders/:orderId - Return appropriate status codes (201 for creation, 404 for not found, 400 for bad input)
- For authenticated routes, use middleware (
) or inspectmiddleware_function_ids
for tokens or API keysreq.headers - Chain work behind an endpoint by enqueuing to a queue after returning a 202 Accepted
- For reusable auth, logging, or rate-limiting before handlers, prefer
iii-http-middleware
Pattern Boundaries
- If the task is about calling external HTTP APIs from iii functions, prefer
.iii-http-invoked-functions - If async processing is needed behind the endpoint, prefer
for the background work.iii-queue-processing - If the task is specifically about middleware chains (auth, logging, rate-limiting), prefer
.iii-http-middleware - Stay with
when iii owns the route and handles the inbound request directly.iii-http-endpoints
When to Use
- Use this skill when the task is primarily about
in the iii engine.iii-http-endpoints - Triggers when the request directly asks for this pattern or an equivalent implementation.
Boundaries
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.