api-catalog
The api-catalog skill provides the correct syntax and endpoint reference for calling Nixopus API operations through the `nixopus_api()` function. Use this skill whenever making Nixopus API requests to ensure proper method, path, and body formatting, and to avoid common mistakes like omitting required fields (environment, build_pack, port), using incorrect query parameters, or passing unsupported request payloads.
git clone --depth 1 https://github.com/nixopus/nixopus /tmp/api-catalog && cp -r /tmp/api-catalog/api/skills/api-catalog ~/.claude/skills/api-catalogSKILL.md
[api-catalog]
Use `nixopus_api({ method, path, body? })` for ALL Nixopus API calls below.
Pass the HTTP method, the full path (embed path params and query strings directly in the string), and an optional body object for POST/PUT/PATCH/DELETE payloads.
CALLING FORMAT:
- `method` — one of: GET, POST, PUT, PATCH, DELETE
- `path` — full API path with path params and query strings embedded as a string
- `body` — JSON object for request body (POST/PUT/PATCH/DELETE with payloads)
EXAMPLES:
```
nixopus_api({ method: "GET", path: "/api/v1/deploy/applications?page=1&page_size=10" })
nixopus_api({ method: "GET", path: "/api/v1/deploy/application?id=APP_UUID" })
nixopus_api({ method: "GET", path: "/api/v1/deploy/application/deployments?id=APP_UUID&limit=5" })
nixopus_api({ method: "GET", path: "/api/v1/deploy/application/deployments/DEPLOY_UUID" })
nixopus_api({ method: "GET", path: "/api/v1/deploy/application/deployments/DEPLOY_UUID/logs?page=1&page_size=50" })
nixopus_api({ method: "POST", path: "/api/v1/deploy/application/restart", body: { id: "DEPLOY_UUID" } })
nixopus_api({ method: "POST", path: "/api/v1/deploy/application/redeploy", body: { id: "APP_UUID" } })
nixopus_api({ method: "GET", path: "/api/v1/machines/stats" })
nixopus_api({ method: "POST", path: "/api/v1/notification/send", body: { channel: "slack", message: "deploy done" } })
```
COMMON MISTAKES TO AVOID:
- ❌ DO NOT use `operation` or `params` fields — the tool does not accept those
- ❌ DO NOT use `application_id` as the query param for deployments — use `id`
- ❌ DO NOT use GET for mutations (restart, redeploy, rollback) — they are POST
- ❌ DO NOT put path params as body fields — embed them in the path string
- ❌ DO NOT include `deploy_on_create` in any request body — it is an unknown field and the API rejects the entire request with HTTP 400.
- ❌ DO NOT omit `environment` from `POST /api/v1/deploy/application` — it is required. Valid values: `production`, `staging`, `development`.
- ❌ DO NOT omit `build_pack` from `POST /api/v1/deploy/application` — it is required. Valid values: `dockerfile`, `nixpacks`, `static`.
- ❌ DO NOT omit `port` from `POST /api/v1/deploy/application` — it is required (1–65535).
- ❌ DO NOT use `source: "github_public"` — it is not a valid value and will be rejected.
- ✅ `source` valid values: `github` (default — requires connector), `public_git` (any public HTTPS URL), `s3`, `zip`, `template`.
- ✅ `repository` format depends on `source`:
- `source: "github"` (or omitted) → numeric GitHub connector repo ID. Call `GET /api/v1/github-connector/repositories`, use the integer `id`. NEVER pass owner/repo slug.
- `source: "public_git"` → full HTTPS git URL, e.g. `"https://github.com/nixopus/sample-app.git"`. Use this when the repo is NOT in the GitHub connector.
- ✅ For `get_application_deployments` → `GET /api/v1/deploy/application/deployments?id=APP_UUID` (NOT `?application_id=`)
- ✅ For `get_deployment_by_id` → `GET /api/v1/deploy/application/deployments/DEPLOY_UUID` (path param, NOT query)
- ✅ For `restart_deployment` → `POST /api/v1/deploy/application/restart` with `body: { id: "DEPLOY_UUID" }`
- ✅ Container ops use path param: `GET /api/v1/container/CONTAINER_ID` (NOT `?id=`)
REQUIRED FLOW FOR DEPLOYMENT:
1. Check if repo is in `GET /api/v1/github-connector/repositories`
- If YES → use `source: "github"`, `repository: <numeric_id>`
- If NO → use `source: "public_git"`, `repository: "https://github.com/org/repo.git"`
2. `POST /api/v1/deploy/application/project` with `{ name, repository, source, branch, ... }`
3. `POST /api/v1/deploy/application/project/deploy` with `{ id: <project_uuid> }`
4. Poll `GET /api/v1/deploy/application/deployments?id=<project_uuid>` until status is success/failed
## Applications
GET /api/v1/deploy/applications — List apps. Query: page?, page_size?, sort_by?, sort_direction?
GET /api/v1/deploy/application?id={app_uuid} — Get one app by UUID
GET /api/v1/deploy/application/deployments?id={app_uuid} — List deployments. ⚠ param is `id` NOT `application_id`. Query: page?, limit?
GET /api/v1/deploy/application/deployments/{deployment_id} — Get deployment by UUID (path param, NOT query string)
GET /api/v1/deploy/application/deployments/{deployment_id}/logs — Deployment logs. Query: page?, page_size?, level?, start_time?, end_time?, search_term?
GET /api/v1/deploy/application/logs/{application_id} — App-wide logs (path param)
POST /api/v1/deploy/application — Create app. Body: { repository (INTEGER numeric GitHub repo ID — NOT "owner/repo"), name?, branch?, port?, build_pack?, dockerfile_path?, base_path?, environment_variables?, domains? }
PUT /api/v1/deploy/application — Update app config. Body: { id, ...fields }
DELETE /api/v1/deploy/application — Delete app. Body: { id }
POST /api/v1/deploy/application/redeploy — Rebuild & redeploy. Body: { id (app UUID), force?, force_without_cache? }
POST /api/v1/deploy/application/restart — Restart deployment (no rebuild). Body: { id (deployment UUID) }
POST /api/v1/deploy/application/rollback — Rollback. Body: { id (app UUID) }
POST /api/v1/deploy/application/cancel-deployment — Cancel in-flight. Body: { deployment_id }
POST /api/v1/deploy/application/recover — Recover. Body: { application_id? } (omit to recover all)
PUT /api/v1/deploy/application/labels?id={app_uuid} — Update labels. Body: (labels payload)
POST /api/v1/deploy/application/domains?id={app_uuid} — Add domain. Body: { domain, service_name?, port? }
DELETE /api/v1/deploy/application/domains?id={app_uuid} — Remove domGenerate Caddyfile configurations for static sites and reverse proxies — SPA fallback routing, cache headers, compression, redirects, and error pages. Use when deploying a static site that needs custom Caddy configuration, or when the user needs SPA routing, caching, or redirect rules.
Generate docker-compose.yml for multi-service setups including databases, caches, and service dependencies. Use when the app needs a database, cache, message broker, or has multiple independently deployable services.
Size container memory and CPU limits, diagnose OOM kills and CPU throttling, and recommend resource adjustments by ecosystem. Use when containers are being OOM-killed, running slowly, or when setting initial resource limits for a deployment.
Build and deploy C/C++ applications — CMake, Meson, Ninja, and Dockerfile patterns. Use when deploying a C or C++ project, or when CMakeLists.txt or meson.build is detected.
Run database migrations safely during deployment — framework-specific commands, pre-deploy vs post-deploy timing, health gates, and rollback strategies. Use when the app has a database migration system and needs migrations run during deployment.
Build and deploy Deno applications — version detection, dependency caching, and Dockerfile patterns. Use when deploying a Deno project, or when deno.json or deno.jsonc is detected.
Sub-agent routing table — which agent handles diagnostics, machine health, infrastructure, GitHub, billing, and notifications. Load when the current task is not a direct deployment.
Full deploy pipeline — source detection, hints-driven analysis, project creation, deployment monitoring, and live URL delivery. Load when the user wants to deploy an application.