CorefinityCorefinityDocs
Open the Control PanelControl Panel
Deployment templates · 8 of 15

List the environments a template reaches

Answers the environments of this platform the template reaches, 50 a page, each with what every stage does (follows the template or holds its own content), and a summary of the counts. Paged by cursor: send next_cursor back as cursor; null means the last page.

GET/api/corestack/companies/{company}/deploy-templates/{platform}/usage

Path parameters

companyintegerRequired

The id of a company you belong to or manage. Digits only. At least 1.

platformstringRequired

The platform the template is for, such as magento2, laravel or wordpress. The list answers the ones your company can have.

Query parameters

cursorinteger

The next_cursor of the previous answer, a whole number here. Anything else is refused 422 invalid on cursor. 0 to 999999.

rolestring

Only production environments, or only the others.

productionuat
stagestring
builddatabasepost_deploysettings
statestring

Only the environments in this state.

follows_every_stageoverrides_someoverrides_every_stagereplaced_belowchanged_since_deploykeptrelink_pending
qstring

A domain or environment name to search for. Up to 100 characters.

Returns

200 A page of environments, with the summary.

Fields of the 200 answer
dataarray of objectsRequired
Fields of each item
binding_idintegerRequired

The id of the environment's pipeline, the {binding} of the site pipeline endpoints.

changed_since_deployarray of strings

The stages that changed since the environment last deployed.

environmentobjectRequired
Fields
namestring
slugstring
last_deploymentobject or null
rolestringRequired
productionuat
siteobjectRequired
Fields
domainstring
idinteger
kindstring
ownerobject or null

The company that owns the site, when it is not this one.

site_idintegerRequired
stagesobjectRequired

By stage, whether it follows the template (state), and the revision and level it follows.

statesarray of stringsRequired
next_cursorinteger or nullRequired
summaryobjectRequired

Counts across every environment the template reaches, whatever the filters.

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.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl https://manage.corefinity.com/api/corestack/companies/1204/deploy-templates/magento2/usage \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "data": [
    {
      "binding_id": 2210,
      "changed_since_deploy": [],
      "environment": {
        "name": "Production",
        "slug": "production"
      },
      "last_deployment": null,
      "role": "production",
      "site": {
        "domain": "harbourandfinch.example.com",
        "id": 1042,
        "kind": "corecluster",
        "owner": null
      },
      "site_id": 1042,
      "stages": {
        "build": {
          "level": "corefinity",
          "revision": 2,
          "state": "follows"
        },
        "database": {
          "level": "corefinity",
          "revision": 2,
          "state": "follows"
        },
        "post_deploy": {
          "level": "owner",
          "revision": 2,
          "state": "follows"
        },
        "settings": {
          "level": "corefinity",
          "revision": 2,
          "state": "follows"
        }
      },
      "states": [
        "follows_every_stage"
      ]
    }
  ],
  "next_cursor": null,
  "summary": {
    "changed_since_deploy": 0,
    "environments": 1,
    "follows_every_stage": 1,
    "kept": 0,
    "overrides_every_stage": 0,
    "overrides_some": 0,
    "production": 1,
    "relink_pending": 0,
    "replaced_below": 0
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT