CorefinityCorefinityDocs
Open the Control PanelControl Panel
Recipes · 1 of 8

Create a site and deploy it

Create a WordPress site, follow it until it is ready, connect its repository and deploy.

On this page

Creating a site opens a contract for it. This recipe creates the WordPress site journal.harbourandfinch.example.com, switches it to git deployments and deploys its repository.

Before you start

  • A token with the read and write scopes and the Deploy tick, which starting the deployment needs, and exec to read the new site's login in step 4.
  • A role with the Manage Deployment Source, Manage Deployment Repositories and Create Deployments permissions, for steps 5 to 7.
  • Steps 2 to 8 need two-factor enrolment when your company requires it.
  • No step waits for a maintenance window.

Every successful create is billable. There is no test mode.

  1. Choose a version

    List the application versions offered where the site will run. This step is optional.

    Terminal
    curl "https://manage.corefinity.com/api/app-versions?platform=wordpress&placement=region:uk" \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
  2. Create the site

    Send where the site runs, its package, the site itself and the environments to create with it. content: fresh installs the application; content: empty leaves the site empty for your own code.

    Terminal
    curl -X POST https://manage.corefinity.com/api/corestack/sites \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{
        "placement": {"kind": "platform", "region": "uk"},
        "package": "cs4",
        "site": {"platform": "wordpress", "domain": "journal.harbourandfinch.example.com", "content": "fresh", "php_version": "8.3"},
        "environments": []
      }'
    StatusMeaning
    201The create has started
    202The create is accepted and waits for room

    Either way the answer carries the new site and the operation to follow. Note site.id and operation.id.

  3. Follow the operation

    Read the operation every few seconds until its status is completed or failed; see Long-running work.

    Terminal
    curl https://manage.corefinity.com/api/corestack/operations/5120 \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
  4. Read the first login

    A fresh install creates an administrator, shown once; skip this step for an empty site. This request needs the exec scope and no body, and answers 200.

    Terminal
    curl -X POST https://manage.corefinity.com/api/corestack/sites/1051/provisioning/reveal \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
    json
    {
      "credentials": {
        "admin": {"url": "https://journal.harbourandfinch.example.com/wp-admin/", "username": "journal_admin", "password": "Example-admin-2026"},
        "revealed_at": "2026-11-03T09:20:00+00:00",
        "note": "Shown once. Store it in your password manager."
      },
      "revealed_at": "2026-11-03T09:20:00+00:00",
      "remaining": 0
    }
  5. Switch the site to git deployments

    A new site deploys by upload. Switching to git answers 201 with the operation that moves the site's files into the releases layout; follow it as in step 3.

    The switch replaces the upload layout with the releases layout; switching back to manual moves the files back.

    Terminal
    curl -X PUT https://manage.corefinity.com/api/corestack/sites/1051/deployments/mode \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{"mode": "git"}'
  6. Connect the repository

    Read the site's deployment settings to find, in connections, the id of a repository connection you may use. Then set the repository and branch, which answers 200 with the settings as they are now.

    Terminal
    curl https://manage.corefinity.com/api/corestack/sites/1051/deployments \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"
    
    curl -X PUT https://manage.corefinity.com/api/corestack/sites/1051/deployments/repository \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{"connection_id": 4217, "repo": "northwind-digital/harbourandfinch", "branch": "main", "root_directory": null, "auto_deploy": false}'
  7. Deploy

    Deploy the connected branch. A deployment replaces the release the site serves with one built from that branch.

    The answer is 201 with the new deployment, status queued.

    Terminal
    curl -X POST https://manage.corefinity.com/api/corestack/sites/1051/deployments \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json" \
      -H "Content-Type: application/json" \
      -d '{}'
  8. Follow the deployment

    A deployment is read on the site's deployment settings, not on the operations endpoint. Read them again until the deployment at the top of deployments has the status succeeded, failed, cancelled or skipped.

    Terminal
    curl https://manage.corefinity.com/api/corestack/sites/1051/deployments \
      -H "Authorization: Bearer $COREFINITY_TOKEN" -H "Accept: application/json"

Create in a CoreCluster

To create the site in one of your CoreClusters, send the same request to POST /corestack/clusters/{cluster}/sites. The site is sized by a tier there, not a package; the endpoint's reference page lists its fields.

If it is refused

StatusreasonWhat to do
422invalidCorrect the field named in field and errors. A rule of the create can refuse a field with a reason of its own; the message says why
403forbiddenYou may not create sites for this company, or your role lacks the permission named in permission
404feature_offSite creation, or deployments, is not on for your company
409no_payment_methodAdd a card or a Direct Debit mandate to your billing account first
429rate_limitedA person can create 100 sites an hour. Wait for the seconds in Retry-After; see Rate limits
409already_revealedThe login was shown already or has expired, or the site has none: an empty site, or an install that has not finished
409modeThe site still deploys by upload; do step 5 first and wait for its operation
422no_repositoryNo repository is connected; do step 6 first
409deployment_runningWait for the running deployment to finish
409busyAnother change to the site is in progress. Wait for it to finish

Next

Was this helpful?
Open in ClaudeOpen in ChatGPT