CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployment pipeline · 10 of 15

Replace a stage of a pipeline

Replaces one stage and answers the whole pipeline; the next deployment runs the saved stage. Send the revision you read: a pipeline that changed since is refused stale. Your role needs the Edit Environment Deployment Pipeline permission.

PUT/api/corestack/sites/{site}/deployments/pipeline/{binding}/stages/{stage}
  • Needs exec as well: The save brings a command the pipeline does not run now.

Path parameters

siteintegerRequired

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.

bindingintegerRequired

The id of one of the environment's pipelines, as the pipeline read answers it in binding_id and bindings[].id. Digits only. At least 1.

stagestringRequired
builddatabasepost_deploy

Body

hooksobject

Build only. Your own lines for each hook of a preset build.

linesarray of strings

The stage's commands, one a line, at most 200 of them. The database and after-deploy stages take these alone; the build stage takes them with mode custom.

modestring

Build only.

presetcustom
platform_step_atinteger

Database only. How many of the lines run before the platform's own database step. At least 0.

presetobject

Build only, with mode preset: platform, frontend (a list) and options, from the presets the pipeline read offers.

revisionstring

The pipeline revision you read.

Returns

200 The pipeline after the save.

Fields of the 200 answer
binding_idintegerRequired

The pipeline this answer is about.

bindingsarray of objectsRequired

The environment's pipelines.

Fields of each item
idintegerRequired
is_defaultboolean
labelstringRequired
tagstring or null
canobjectRequired
Fields
editbooleanRequired
edit_codestring or null
edit_reasonstring or null
rehearsebooleanRequired
rehearse_codestring or null
rehearse_reasonstring or null
carry_overobject or null
classicobject or null

The commands of a pipeline that does not have the three stages yet. Null for a three-stage pipeline.

conversionobject or null
lockedobject or null

Set while Corefinity has locked the pipeline, so it cannot be edited. Null when it can.

Fields
reasonstringRequired

Why, in Corefinity's words.

optionsobject
Fields
build_readsarray of stringsRequired
cloudflare_purgebooleanRequired
extra_shared_pathsarray of objectsRequired
Fields of each item
kindstring
dirfile
pathstringRequired

A path relative to the site's root. Up to 255 characters.

sharedstring

Where the path's data is kept between releases, relative to the shared folder, when that is not the default.

migrateboolean or null

Laravel only, read only. The environment's own switch, which a pipeline whose run_migrations is null follows. Null on every other platform.

platform_sharedarray of objects

The paths the platform itself keeps between releases.

Fields of each item
kindstring
dirfile
pathstringRequired

A path relative to the site's root. Up to 255 characters.

sharedstring

Where the path's data is kept between releases, relative to the shared folder, when that is not the default.

pre_switch_checkboolean or objectRequired

Off (false), on (true), or on with the paths to request.

snapshot_before_upgradeboolean
varnish_purgeboolean

Magento 2 only. Whether Varnish is purged after the switch.

warm_upboolean or objectRequired

Off (false), on (true), or on with the paths to request.

originstring or null
placementobject

What a build of this environment runs with, such as its Node.js version and whether it opens a tunnel.

presetsobject

The build presets this platform offers, and the ones found in the site's code.

Fields
detectedarray
offeredarray of objects
Fields of each item
keystringRequired
kindstringRequired
labelstringRequired
revisionstring or nullRequired

Send this with a save.

savedobject or any or null

The last save. Null for a pipeline that has not been saved.

settingsobject or any or nullRequired

The settings. Null for a pipeline that does not have the three stages yet.

stage_modelstring or nullRequired

three_stage for a pipeline with the three stages. Null for one that still holds the commands it was carried over with.

stagesobject or any or nullRequired

The three stages. Null for a pipeline that does not have them yet.

templateobject or null

The deployment template each stage follows or has left. Present while deployment templates are on for your company.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403forbiddenThe person is not allowed to do this.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409pipeline_classicCorefinity still runs this pipeline in its classic form, so it cannot be edited yet.
409pipeline_lockedCorefinity has locked this pipeline: Held while a migration is checked.
409staleWhat you read has changed since you read it. Read it again, then send the change with its new version or quote.
422confirmThe action needs an explicit confirmation field. Ask the person, then send it.
422line_credentialsThis line holds a credential. Move this value into a variable, then save again.
422maintenance_policy_unavailableChoose Always or Off: this platform has no pending-upgrade check.
422invalidFix the field named in field; errors says why.
422timeout_out_of_rangeChoose a timeout between 60 and 3600 seconds.
422version_unavailableThis version is not available here.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/deployments/pipeline/2210/stages/post_deploy \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "lines": [
      "php artisan queue:restart",
      "php artisan config:cache"
    ],
    "revision": "413c6ef3a8a3ffe9"
  }'
{
  "binding_id": 2210,
  "bindings": [
    {
      "id": 2210,
      "is_default": false,
      "label": "harbourandfinch.example.com",
      "tag": null
    }
  ],
  "can": {
    "edit": true,
    "edit_code": null,
    "edit_reason": null,
    "rehearse": true,
    "rehearse_code": null,
    "rehearse_reason": null
  },
  "carry_over": null,
  "classic": null,
  "conversion": null,
  "locked": null,
  "options": {
    "build_reads": [],
    "cloudflare_purge": false,
    "extra_shared_paths": [],
    "migrate": false,
    "platform_shared": [
      {
        "kind": "dir",
        "path": "storage"
      },
      {
        "kind": "file",
        "path": ".env"
      }
    ],
    "pre_switch_check": false,
    "snapshot_before_upgrade": false,
    "warm_up": false
  },
  "origin": null,
  "presets": {
    "detected": [],
    "offered": [
      {
        "key": "laravel_standard",
        "kind": "platform",
        "label": "Laravel standard"
      },
      {
        "key": "none",
        "kind": "platform",
        "label": "No build"
      },
      {
        "key": "vite",
        "kind": "frontend",
        "label": "Vite"
      },
      {
        "key": "laravel_mix",
        "kind": "frontend",
        "label": "Laravel Mix"
      }
    ]
  },
  "revision": "1537f080a2c1e2d9",
  "saved": {
    "at": "2026-11-09T10:42:07Z",
    "by": {
      "name": "Maya Okafor",
      "token": null
    },
    "number": 1,
    "source": "editor"
  },
  "settings": {
    "keep_node_modules": false,
    "maintenance_policy": "off",
    "pause_crons": "auto",
    "run_migrations": null,
    "timeouts": {
      "build": 3600,
      "build_line": 3600,
      "database_line": 600,
      "post_line": 600
    },
    "tunnels": "auto"
  },
  "stage_model": "three_stage",
  "stages": {
    "build": {
      "effective": [],
      "hooks": [],
      "lines": [],
      "mode": "preset",
      "preset": {
        "frontend": [],
        "options": [],
        "platform": "none"
      }
    },
    "database": {
      "lines": [],
      "platform_step_at": 0
    },
    "post_deploy": {
      "lines": [
        {
          "badges": [],
          "comments": [],
          "origin": "custom",
          "text": "php artisan queue:restart",
          "verdict": "services"
        },
        {
          "badges": [
            {
              "id": "replaced_by_platform",
              "label": "Replaced by a CoreStack step",
              "severity": "info"
            }
          ],
          "comments": [],
          "origin": "custom",
          "text": "php artisan config:cache",
          "verdict": "platform_duplicate"
        }
      ]
    }
  }
}
Try it

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.

Was this helpful?
Open in ClaudeOpen in ChatGPT