Get a company's deployment template
Answers the template for one platform: what the company has set for each stage of the production and UAT configurations, what each stage inherits and what is in effect, the build presets on offer, and whether you may edit it.
Path parameters
The id of a company you belong to or manage. Digits only. At least 1.
The platform the template is for, such as magento2, laravel or wordpress. The list answers the ones your company can have.
Query parameters
A kept revision to read instead of the current one. At least 1.
current, previous or a revision number. Adds compare to the answer, with the before and after of each changed stage.
One upstream to answer, as upstreams[].upstream names it (none, or agency: and the agency's id).
Returns
200 The template.
Fields of the 200 answer
Fields
Whether you may save this template.
Why not, when you may not.
A sentence about the chains the template sits in, when there is more than one.
Fields
At least 1.
Present with compare_to. Each stage that differs between the two revisions, with its entry before and after.
Fields
The revision compared with.
By configuration, then by stage. An empty list when the two revisions hold the same content. Up to 0 items.
What the company's template sets, for production environments and for the others.
Fields
Fields
What the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffWhat the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffWhat the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffWhat the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffFields
What the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffWhat the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffWhat the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffWhat the template sets for one stage.
Fields
inherit takes the stage from the level above; replace sets it to value.
inheritreplaceA stage's content, in the shape the site pipeline's stage and settings endpoints take. The database and after-deploy stages hold lines; the build stage holds mode with a preset or its own lines; the settings stage holds the pipeline's settings, each one optional.
Fields
Build only. Your own lines for each hook of a preset build, when they are not inside preset. An empty list when there are none.
The stage's commands, one a line, as a list or as one string.
Settings only, as each of the settings below.
when_neededalwaysoffBuild only.
presetcustomautooffnullDatabase only. How many of the lines run before the platform's own database step. At least 0.
Build only, with mode preset: platform, frontend (a preset or a list of them), their options and optional hooks.
On a WordPress template, what a repository connected from now on holds. It never changes a repository already connected. While site content repositories are paused, a save of site_content is refused feature_off: a 422, not the 404 a switched-off endpoint answers.
whole_sitesite_contentWhere in the site that content goes. Null is wp-content, or web/app on Bedrock.
Laravel only.
Whole seconds for a stage or line key (build, build_line, database_line, post_line), or null. A save takes 60 to 3600 for each and no other key. An empty list when none is set.
autoonoffSet while Corefinity has locked the template, so it cannot be edited. Null when it can.
Fields
Why, in Corefinity's words.
Fields
The build presets this platform offers.
Fields of each item
platformfrontendThe lowest Node.js major version the preset needs.
The lowest Node.js major version an option of the preset needs, by option.
Send this with a save or a restore.
What each stage inherits and what is in effect, once for each chain the template sits in: none for the company's own environments, and one for each agency that manages some of them.
Fields of each item
The levels a stage is inherited through, from Corefinity's default down to this company.
Fields of each item
Such as corefinity, agency or owner.
Fields
By configuration (production, uat), then by stage: inherited (the level, company and revision the stage comes from, with its value), effective (the content in effect) and differs_from_none.
none, or agency: and the id of the agency whose template sits above this one.
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. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait 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 \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json"use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->get('https://manage.corefinity.com/api/corestack/companies/1204/deploy-templates/magento2');
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/companies/1204/deploy-templates/magento2', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
},
});
// 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.get(
"https://manage.corefinity.com/api/corestack/companies/1204/deploy-templates/magento2",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
)
data = res.json() if res.content else None{
"can": {
"edit": true,
"edit_reason": null
},
"chain_note": null,
"company": {
"id": 1180,
"name": "Northwind Digital"
},
"configs": {
"production": {
"build": {
"mode": "inherit"
},
"database": {
"mode": "inherit"
},
"post_deploy": {
"mode": "replace",
"value": {
"lines": [
"php bin/magento cache:flush"
]
}
},
"settings": {
"mode": "inherit"
}
},
"uat": {
"build": {
"mode": "inherit"
},
"database": {
"mode": "inherit"
},
"post_deploy": {
"mode": "inherit"
},
"settings": {
"mode": "inherit"
}
}
},
"locked": null,
"platform": "magento2",
"presets": {
"offered": [
{
"key": "magento2_standard",
"kind": "platform",
"label": "Magento 2 standard",
"node_floor": null,
"node_floor_when": null
},
{
"key": "none",
"kind": "platform",
"label": "No build",
"node_floor": null,
"node_floor_when": null
}
]
},
"revision": 2,
"template_id": 12,
"upstreams": [
{
"agency": null,
"chain": [
{
"company": null,
"level": "corefinity",
"revision": 2,
"template_id": null
},
{
"company": {
"id": 1180,
"name": "Northwind Digital"
},
"level": "owner",
"revision": 2,
"template_id": 12
}
],
"environments": {
"production": 1,
"total": 1
},
"stages": {
"production": {
"post_deploy": {
"differs_from_none": false,
"effective": {
"lines": [
"php bin/magento cache:flush"
]
},
"inherited": {
"company": null,
"level": "corefinity",
"revision": 2,
"value": {
"lines": []
}
}
}
}
},
"upstream": "none"
}
]
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "invalid",
"errors": {
"name": [
"The name argument is not in the expected format."
]
},
"field": "name",
"message": "Some arguments are not valid.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}