# Changing PHP allocation settings via API

**URL:** https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419
**Category:** API Questions
**Created:** [August 20, 2025, 2:33pm UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419 "2025-08-20T14:33:59Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![edjeavons](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/edjeavons/32/4952_2.png) [@edjeavons](https://community.kinsta.com/u/edjeavons)
#### Post date: [August 20, 2025, 2:33pm UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419/1 "2025-08-20T14:33:59Z")

</div>

Hi

Please may you verify that the /v2/sites/{site\_id}/change-site-php-allocation API endpoint is working [as documented](https://api-docs.kinsta.com/tag/WordPress-Site-Environments#operation/changeSitePhpAllocation)?

When I send the following request I get a good 202 response with an operation\_id in its body:

```auto
POST /v2/sites/REDACTED/change-site-php-allocation HTTP/1.1
Accept: application/json
Authorization: Bearer REDACTED
Content-Type: application/json; charset=utf-8
Host: api.kinsta.com
Connection: close
Content-Length: 38

{“thread_count”:6,“thread_memory”:512}

```

But the change doesn’t take affect and when i check the operation\_id it says:

```json
{
  “status”: 400,
  “message”: “Operation failed! Please refer to `data` for more details.”,
  “data”: {
    “status”: 400,
    “message”: “invalid type for variable: ‘worker_memory’”
  }
}

```

I have tried using the docs’ deprecated body instead but that didn’t work either.

Please let me know if I’ve made a mistake but I think I followed the docs correctly.

Thanks - Ed

---

<div class="post-metadata">

### Author: ![Adrian\_L](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/adrian_l/32/2810_2.png) [@Adrian\_L](https://community.kinsta.com/u/Adrian_L)
#### Post date: [August 21, 2025, 2:08am UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419/7 "2025-08-21T02:08:18Z")

</div>

@edjeavons

Thank you for the report! I can replicate the error as well, and I have forwarded this possible bug to our developers for review. We will keep you updated on any progress.

Best,

---

<div class="post-metadata">

### Author: ![Adrian\_L](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/adrian_l/32/2810_2.png) [@Adrian\_L](https://community.kinsta.com/u/Adrian_L)
#### Post date: [August 25, 2025, 1:12am UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419/9 "2025-08-25T01:12:49Z")

</div>

Hi @edjeavons

We are glad to inform you that our Developer team has fixed this issue. When you get a chance, please test it as well and confirm that the issue is resolved.

Thanks!

---

<div class="post-metadata">

### Author: ![edjeavons](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/edjeavons/32/4952_2.png) [@edjeavons](https://community.kinsta.com/u/edjeavons)
#### Post date: [August 27, 2025, 12:21pm UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419/10 "2025-08-27T12:21:12Z")

</div>

I confirm it’s working now. Thanks for fixing that.

Ed

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [August 28, 2025, 12:33am UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419/11 "2025-08-28T00:33:40Z")

</div>

Awesome! glad to hear that it’s working now from your end too, Ed @edjeavons ! 😃

You’re most welcome and thank you for your confirmation as well! 👍

Best regards,  
Agus Utomo

---

<div class="post-metadata">

### Author: ![Agus](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/agus/32/1515_2.png) [@Agus](https://community.kinsta.com/u/Agus)
#### Post date: [August 28, 2025, 12:33am UTC](https://community.kinsta.com/t/changing-php-allocation-settings-via-api/5419/12 "2025-08-28T00:33:57Z")

</div>


