Skip to content

fix: correct API path for listing application deployments#120

Merged
StuMason merged 1 commit intoStuMason:mainfrom
op-fasc:fix/list-deployments-by-app-url
Feb 14, 2026
Merged

fix: correct API path for listing application deployments#120
StuMason merged 1 commit intoStuMason:mainfrom
op-fasc:fix/list-deployments-by-app-url

Conversation

@op-fasc
Copy link
Contributor

@op-fasc op-fasc commented Feb 14, 2026

Summary

  • Fixed listApplicationDeployments using wrong API path /applications/{uuid}/deployments (returns 404)
  • Changed to correct path /deployments/applications/{uuid} per the Coolify OpenAPI spec (operationId: list-deployments-by-app-uuid, line 4166 in docs/coolify-openapi.yaml)
  • Updated corresponding test assertion

How to reproduce

// This returns 404 with the current code:
const deployments = await client.listApplicationDeployments('your-app-uuid');

The correct Coolify v4 endpoint is GET /api/v1/deployments/applications/{uuid} (with optional skip and take query params), not GET /api/v1/applications/{uuid}/deployments.

Test plan

  • Updated test in coolify-client.test.ts to expect correct URL
  • All 200 tests pass
  • Verified against live Coolify v4 instance (the correct path returns deployment history, the old path returns 404)

The `listApplicationDeployments` method was using the path
`/applications/{uuid}/deployments` which returns 404. The correct
Coolify API path per the OpenAPI spec (operationId:
`list-deployments-by-app-uuid`) is `/deployments/applications/{uuid}`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@op-fasc op-fasc requested a review from StuMason as a code owner February 14, 2026 09:20
@StuMason StuMason enabled auto-merge (squash) February 14, 2026 12:05
@StuMason StuMason disabled auto-merge February 14, 2026 12:05
@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.33%. Comparing base (2f8055f) to head (5849493).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #120   +/-   ##
=======================================
  Coverage   91.33%   91.33%           
=======================================
  Files           1        1           
  Lines         404      404           
  Branches      111      111           
=======================================
  Hits          369      369           
  Misses          6        6           
  Partials       29       29           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@StuMason StuMason merged commit 2fba62c into StuMason:main Feb 14, 2026
6 of 7 checks passed
@StuMason
Copy link
Owner

@op-fasc thank you, much appreciated.

@claude how did we miss this? I want you to review the codebase and make sure all the other endpoints are right, and let's put something in your docs so this doesn't happen again (we should be testing against the endpoints to make sure they exist)

@claude
Copy link

claude bot commented Feb 14, 2026

Claude finished @StuMason's task in 2m 28s —— View jobclaude/pr-120-20260214-1347Create PR ➔


Endpoint Audit & Documentation Update Complete


How Was This Bug Missed?

The incorrect endpoint path (/applications/{uuid}/deployments instead of /deployments/applications/{uuid}) was missed because:

  1. The OpenAPI chunks are incomplete — The file docs/openapi-chunks/deployments-api.yaml only includes /deployments, /deployments/{uuid}, and /deploy endpoints. The list-deployments-by-app-uuid endpoint is missing from the chunk but exists in the main spec at line 4166 of docs/coolify-openapi.yaml.

  2. REST convention assumptions — Most REST APIs use /resource/{id}/sub-resource patterns. The original code assumed /applications/{uuid}/deployments which follows this convention, but Coolify uses the inverted path /deployments/applications/{uuid}.

  3. Unit tests with mocks don't catch path errors — The test mocked the client method, so it passed regardless of whether the actual API path was correct.


Endpoint Audit Results

I audited all 70+ endpoints in coolify-client.ts against docs/coolify-openapi.yaml. No other incorrect paths were found. All current endpoints match the OpenAPI spec:

Category Endpoints Status
Servers /servers, /servers/{uuid}, /servers/{uuid}/resources, etc. ✅ Correct
Projects /projects, /projects/{uuid}, /projects/{uuid}/environments ✅ Correct
Applications /applications, /applications/{uuid}, /applications/{uuid}/envs, etc. ✅ Correct
Databases /databases, /databases/{uuid}, /databases/postgresql, etc. ✅ Correct
Services /services, /services/{uuid}, /services/{uuid}/envs, etc. ✅ Correct
Deployments /deployments, /deployments/{uuid}, /deployments/applications/{uuid} ✅ Correct (fixed by this PR)
Teams /teams, /teams/{id}, /teams/current ✅ Correct
Private Keys /security/keys, /security/keys/{uuid} ✅ Correct
GitHub Apps /github-apps, /github-apps/{id} ✅ Correct
Cloud Tokens /cloud-tokens, /cloud-tokens/{uuid} ✅ Correct

Documentation Update

I've updated CLAUDE.md with a new "Endpoint Verification Workflow" section that:

  1. Documents known gotchas — Warns that endpoint paths can be misleading and that OpenAPI chunks may be incomplete
  2. Provides a verification workflow — 4 steps to verify endpoints before implementation:
    • Search the main OpenAPI spec (not just chunks)
    • Verify the actual path pattern (Coolify doesn't always follow REST conventions)
    • Test against live server with /smoke-test
    • Document non-obvious paths with comments

|

StuMason added a commit that referenced this pull request Feb 25, 2026
- fix: map fqdn to domains for Coolify API compatibility (#125)
- fix: correct API path for listing application deployments (#120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants