API v2: PUT /clients/{id} does not update resource_limits or apply hosting_plan_id  [SOLVED]

Have you discovered a bug? Tell us about it.
Post Reply
AxelL
Posts: 2
Joined: Mon 13. Apr 2026, 13:52

API v2: PUT /clients/{id} does not update resource_limits or apply hosting_plan_id

Post by AxelL »

I'm sure the cause of the problem is within KeyHelp
Yes

Server operating system + version
Debian 13 (Trixie)

Server virtualization technology used
KVM

KeyHelp version + build number
26.0 (Build 3618)

Problem description / error messages
When using the KeyHelp REST API (v2) to update a client’s resource_limits or to apply a hosting_plan_id, the API returns a successful HTTP 200 response with {"id": <client_id>}, but the actual client’s resource limits remain unchanged (still the default 1 MiB disk space).
The same issue occurs when trying to update hosting_plan_id – the response indicates success, but the plan is not applied, and resource limits are not recalculated.

Expected result
  • Updating resource_limits should immediately change the client’s quotas (e.g., disk_space to 5 368 709 120 bytes).
  • Setting hosting_plan_id should apply the corresponding hosting plan and its resources to the client.
Actual result
  • The API returns {"id": 22} but no changes are made.
    The client’s resource_limits stay at the default values (disk_space: "1048576").
    Even manually applying the plan via the admin panel works, but the API does not.
Steps to reproduce
1. Create a new client using POST /clients (any valid data).
2. Immediately try to update the client’s resource_limits with PUT /clients/{id} and payload:

Code: Select all

{
  "resource_limits": {
    "disk_space": "5368709120"
  }
}
3. Perform a GET /clients/{id} to verify the limits.
4. Also try updating hosting_plan_id to a valid plan ID (e.g., 2) using PUT /clients/{id} with payload:

Code: Select all

{
  "hosting_plan_id": 2
}
5. The response is always {"id": ...} but no actual change occurs.

Additional information
  • PHP curl extension is installed and active (php -m | grep curl → curl).
    Log excerpts from /var/log/keyhelp/php-error.log show no related errors after the attempts (only older errors from April 6 about curl_version() that have been fixed).
    The issue is not in the client code – tests performed directly with Insomnia (REST client) show the same behavior.
    Manually changing the client’s hosting plan via the KeyHelp web interface works correctly.
    KeyHelp option “Ignore resource limits for user accounts” is enabled (but disabling it doesn’t help).
I suspect a bug in the API endpoint /clients/{id} for PUT requests. Could you please investigate?
User avatar
Alexander
Keyweb AG
Posts: 4827
Joined: Wed 20. Jan 2016, 02:23

Re: API v2: PUT /clients/{id} does not update resource_limits or apply hosting_plan_id  [SOLVED]

Post by Alexander »

Hello,
2. Immediately try to update the client’s resource_limits with PUT /clients/{id} and payload:
As it is stated in the API documentation, The fields under resource_limits are read-only. These fields are not meant to be changed with PUT /client/{id}
4. Also try updating hosting_plan_id to a valid plan ID (e.g., 2) using PUT /clients/{id} with payload:
This is the way to go, but you misspelled the field name. The field name is id_hosting_plan not hosting_plan_id.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
AxelL
Posts: 2
Joined: Mon 13. Apr 2026, 13:52

Re: API v2: PUT /clients/{id} does not update resource_limits or apply hosting_plan_id

Post by AxelL »

Thank you very much!

Yes the field name must be id_hosting_plan, not hosting_plan_id...
After correcting the field name in my API calls, the hosting plan is now correctly applied to new clients, and the resource limits (disk space, etc.) are updated as expected.

Everything works perfectly now. Thank you for your fast and helpful support!
Best regards
Post Reply