Copy PHP configuration to other environments
Copies this site's PHP configuration, without Xdebug, to other environments of the same site. The request is checked whole first, so a refusal applies nothing anywhere; then each target is changed on its own, and the answer has one entry for each in the order asked.
Path parameters
The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.
Body
When a change that needs a maintenance window is applied. now applies it at once. tonight queues it for the site's next window. window means the same as tonight. An endpoint that takes window only while maintenance windows are on for your company says so, and refuses it 422 on apply otherwise. Defaults to now.
nowtonightwindowMust be true when a target is production. Defaults to false.
What to copy. ini is the custom php.ini.
extensionssettingsfpminiThe ids of the environments to copy to, each once. Each must be another environment of this site that you may change. Up to 20 items.
Returns
200 One entry for each target, in the order asked.
Fields of the 200 answer
Fields of each item
At least 1.
The operation that applies the copy on this target. Null when nothing differs, when it was queued and when the target refused.
Why this target refused, with the status a change of it would answer. Null when it did not.
At least 1.
Fields of each item
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | managed_elsewhere | This site is read-only here. Change it in the control panel that manages it. |
422 | confirm | The action needs an explicit confirmation field. Ask the person, then send it. |
422 | copy_target_invalid | PHP settings can only be copied to another environment of this site. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/apply-to \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"parts": [
"settings",
"ini"
],
"targets": [
1043
]
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/apply-to', [
'parts' => [
'settings',
'ini',
],
'targets' => [
1043,
],
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/apply-to', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
parts: [
'settings',
'ini',
],
targets: [
1043,
],
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/corestack/sites/1042/php-runtime/apply-to",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"parts": [
"settings",
"ini",
],
"targets": [
1043,
],
},
)
data = res.json() if res.content else None{
"changes": [
{
"adopting": false,
"operation": {
"applied_at": null,
"can_retry": false,
"cluster": {
"id": 1017,
"name": "Northwind UK 1"
},
"committed_at": "2026-11-09T21:35:24Z",
"completed_at": null,
"created_at": "2026-11-09T21:35:24Z",
"environment": {
"env_id": "rs-northwind-harbourandfinch-example-com--staging",
"hostname": "staging-harbourandfinch-example-com.northwind.cfstack.example.net",
"id": 1043,
"name": "Staging",
"role": "staging",
"role_label": "Staging",
"slug": "staging"
},
"error": null,
"failure_reason": null,
"from_version": null,
"hot": false,
"id": 5121,
"install": null,
"label": "Picked up by PHP",
"notes": [],
"parent_operation_id": null,
"requested_by": {
"id": 2012,
"name": "Daniel Reyes"
},
"reset_target": null,
"result": null,
"result_state": "none",
"retried_by_operation_id": null,
"retries_operation_id": null,
"retry_requires": null,
"revealed": null,
"scope": "site",
"site": {
"domain": "harbourandfinch.example.com",
"id": 1043
},
"status": "committed",
"status_label": "Waiting for the platform",
"step": "applied",
"steps": [
{
"key": "saved",
"label": "Saved",
"state": "done"
},
{
"key": "applied",
"label": "Picked up by PHP",
"state": "current"
},
{
"key": "healthy",
"label": "Requests answered",
"state": "todo"
}
],
"subject": null,
"summary": "PHP configuration",
"to_version": null,
"type": "php_runtime",
"type_label": "PHP configuration"
},
"refused": null,
"site_id": 1043,
"warnings": []
}
]
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "managed_elsewhere",
"message": "This site is managed by another control panel",
"reason": "managed_elsewhere"
}{
"code": "confirm",
"message": "Copying PHP settings into production changes how it runs. Confirm to continue.",
"reason": "confirm"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it is off for this endpointIt overwrites data that cannot be brought back. Copy the request and run it yourself when you are sure.