Skip to content

fix: use bulk endpoint for service env update to resolve 404#59

Closed
aerocyberlabs wants to merge 1 commit intocoollabsio:v4.xfrom
aerocyberlabs:fix/service-env-update-404
Closed

fix: use bulk endpoint for service env update to resolve 404#59
aerocyberlabs wants to merge 1 commit intocoollabsio:v4.xfrom
aerocyberlabs:fix/service-env-update-404

Conversation

@aerocyberlabs
Copy link
Copy Markdown

Summary

Fixes #48service env update returns 404 because PATCH /services/{uuid}/envs doesn't exist for services.

Changes

Routes single env var updates through the working bulk endpoint PATCH /services/{uuid}/envs/bulk instead.

The method:

  1. Fetches the current env var to preserve existing values for fields not being updated
  2. Applies the requested changes
  3. Sends via the bulk endpoint
  4. Fetches and returns the updated env var

How to test

coolify service env list <service_uuid>
coolify service env update <service_uuid> <env_uuid> --value "new_value"
# Previously: 404 "Service not found"
# Now: updates successfully via bulk endpoint

Related

Found while building Paasman, a universal CLI for self-hosted PaaS platforms.

The single-update endpoint PATCH /services/{uuid}/envs returns 404
for services. This fix routes single env var updates through the
bulk endpoint PATCH /services/{uuid}/envs/bulk, which works correctly.

The method fetches the current env var first to preserve existing
values for fields not being updated, then wraps the update in a
bulk request.

Fixes coollabsio#48
@aerocyberlabs aerocyberlabs force-pushed the fix/service-env-update-404 branch from e6df28d to f945546 Compare March 16, 2026 05:15
@andrasbacsai
Copy link
Copy Markdown
Member

Thanks for the PR. I will add it differently in #51, so I am closing this.

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.

service env update returns 404 - uses wrong API endpoint

2 participants