CorefinityCorefinityDocs
Open the Control PanelControl Panel
Access · 4 of 7

Create an SSH or SFTP user

Adds a named user to the site or environment: ssh for SSH and SFTP over the whole site, or sftp for SFTP only, limited to one folder. A generated password is in this answer and nowhere else, so asking for one also needs the exec scope.

POST/api/corestack/sites/{site}/access/users
  • Needs exec as well: The body asks for a generated password (password is generate).

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.

Body

labelstring or null

A note to recognise the user by. Up to 60 characters.

passwordstring or null

none (the default) makes a user that signs in with keys only. set uses password_value. generate makes a password and answers it once; it also needs the exec scope.

generatesetnonenull
password_valuestring or null

The password, with set, and needed then: 12 to 64 characters, not the username and not containing the site's domain. One that breaks these is refused on password_value.

root_pathstring or null

For sftp users, the folder the user is limited to, inside htdocs or shared. Left out, it is htdocs. Not accepted for ssh users. At most 200 characters, with no / at either end; each part is letters, digits, dots, dashes and underscores.

typestringRequired

ssh gives SSH and SFTP over the whole site. sftp gives SFTP only, inside root_path.

sshsftp
usernamestringRequired

3 to 31 lower-case letters, digits or dashes, starting with a letter. Some names are reserved.

Returns

201 The user was added and the change is being applied. Follow operation.id with GET /corestack/sites/{site}/access/operations/{operation}. password holds a generated password, once; the answer is sent with Cache-Control: no-store.

Fields of the 201 answer
accessobjectRequired

The site's access with the new user in it. A site's or environment's SSH and SFTP access, as a change answers it.

Fields
applyobjectRequired

Whether the saved users and keys are live on the site. Whether a saved set of rules is live on the site.

Fields
applied_atstring or nullRequired
detailany

Sent only by the sets that have more to say, such as HTTP authentication.

errorstring or nullRequired
operationobject or any or nullRequired

The change that is applying the set, while one is running.

statestringRequired

Such as applied or applying.

state_labelstringRequired
company_keysarray of objectsRequired

The company keys that can reach the site.

Fields of each item
applied_herebooleanRequired

Whether the key reaches this site.

appliesstringRequired

Whether the company key applies to all of the company's sites or to selected ones.

allselected
fingerprintstringRequired
idintegerRequired

At least 1.

namestringRequired
connectionobjectRequired

Where to connect.

Fields
hoststringRequired

The SSH host of the site's cluster. Empty while the site has none yet.

portinteger or nullRequired

The site's or environment's own port.

ssh_userstringRequired

The built-in user, web.

tunnel_commandstringRequired

An ssh command that opens a tunnel to the database on 127.0.0.1:3306 of your machine.

limitsobjectRequired
Fields
company_keys_maxintegerRequired
keys_per_user_maxintegerRequired
root_path_suggestionsarray of stringsRequired

Folders an SFTP user is often limited to on this kind of site.

users_maxintegerRequired

The most named users a site can have.

terminalobjectRequired

Whether the browser terminal can be opened for the site.

Fields
active_sessionobject or nullRequired

The open terminal session on the site, when there is one, whoever opened it.

Fields
idintegerRequired

At least 1.

started_atstring or nullRequired

When the session started, in UTC with a +00:00 offset. Format: date-time.

userobjectRequired

Who opened the session. A session Corefinity support opened reads Corefinity support with a null id. A person by id and name. Corefinity staff read as Corefinity support with a null id.

Fields
idinteger or nullRequired
namestring or nullRequired
availablebooleanRequired
reasonstring or nullRequired

Why not, in plain words.

usersarray of objectsRequired

The built-in web user first, then the named users.

Fields of each item
can_changebooleanRequired
can_deletebooleanRequired
connectionobjectRequired
Fields
commandstring or nullRequired

The ssh command. Null for an SFTP user.

sftp_commandstring or nullRequired
created_atstring or nullRequired
created_byobject or any or nullRequired
idintegerRequired

The id the /access/users/{user} endpoints take.

keysarray of objectsRequired

The user's keys. While SSH keys are on for your company, web lists every key that can log in as it, from every level.

Fields of each item
added_atstring or nullRequired
added_byobject or any or nullRequired
bitsinteger or nullRequired
can_deletebooleanRequired

Whether this endpoint group can remove the key. Other keys are removed where they were added.

commentstring or nullRequired

The comment at the end of the key line, when it had one.

company_key_idinteger or nullRequired
fingerprintstringRequired

The SHA-256 fingerprint, as ssh-keygen -lf prints it.

idintegerRequired

The id DELETE /corestack/sites/{site}/access/keys/{key} takes. 0 for the Corefinity deploy key.

namestringRequired
originobject

Sent while SSH keys are on for your company. The level the key comes from.

Fields
layerstringRequired
agencycompanywebsiteenvironmentuserlegacysystem
ownerobject or any or nullRequired
restrictedbooleanRequired

True when the key carries restrictions from before it was imported. Only Corefinity changes those.

restrictionsarray of stringsRequired
sourcestringRequired

company is a company key. system is the Corefinity deploy key. Everything else reads user.

usercompanysystem
statusstringRequired
pendingappliedfailedremoving
status_labelstringRequired
typestringRequired

The key type, such as ssh-ed25519 or ssh-rsa.

kindstringRequired

built_in is web. It cannot be changed or removed.

built_innamed
labelstring or nullRequired
passwordobjectRequired

Whether the user has a password. The password itself is never answered here.

Fields
setbooleanRequired
set_atstring or nullRequired
set_byobject or any or nullRequired
root_pathstring or nullRequired

The folder an SFTP user is limited to, relative to the site.

root_path_absolutestring or nullRequired

The same folder as a path on the server.

statusstringRequired

pending until the change that made or changed the user is live.

pendingappliedfailedremoving
status_labelstringRequired
typestringRequired
sshsftp
type_labelstringRequired
uidinteger or nullRequired

The user's numeric id on the server.

usernamestringRequired
operationobjectRequired

A change the Control Panel is making or has made. A save or an action that starts work answers one in operation; read it again by id with GET /corestack/operations/{operation} until status is completed or failed. Both answers have this shape; the few endpoints that answer a different one say so.

Fields
applied_atstring or null
can_retryboolean or null
clusterobject or any or null

The cluster the operation runs on.

committed_atstring or null
completed_atstring or nullRequired
created_atstring or nullRequired
environmentobject or any or null
errorstring or nullRequired

Why the operation failed, in plain words. Null unless status is failed.

failure_reasonstring or null

A stable code for the failure.

from_versionstring or null
hotboolean or null

True when the change applies without a maintenance window.

idintegerRequired
installobject or null
labelstring or null
notesarray of objects

What the operation did differently on purpose. Empty when nothing.

Fields of each item
codestringRequired
textstringRequired
parent_operation_idinteger or null
requested_byany

Who asked for the change.

reset_targetany

Present on some site creations and copies.

resultany

Always null here. A one-time result is read once with the reveal endpoint.

result_statestring
nonependingavailableviewed
retried_by_operation_idinteger or null
retries_operation_idinteger or null
retry_requiresany

What a retry needs first, if anything.

revealedany

Who revealed a one-time result and when, when there was one.

scopestringRequired
siteclusterbatch
siteobject or any or null

The website the operation belongs to. Null for a cluster's own operation.

statusstringRequired

Where a change is. completed and failed are final; every other status means the change is still running and blocks another change to the same site.

pendingcommittedrolling_outexecutingcompletedfailed
status_labelstringRequired
stepstring or null

The key of the step the operation is at. Null once it has completed.

stepsarray of objectsRequired
Fields of each item
keystring
labelstring
statestring

One of done, current, todo, failed or skipped.

subjectobject or null
summarystring or null
to_versionstring or null
typestringRequired

The kind of change, such as crons_change or redirects_change.

type_labelstringRequired
passwordobject or any or nullRequired

The generated password, or null when none was generated.

userobjectRequired

The built-in web user, or a named SSH or SFTP user.

Fields
can_changebooleanRequired
can_deletebooleanRequired
connectionobjectRequired
Fields
commandstring or nullRequired

The ssh command. Null for an SFTP user.

sftp_commandstring or nullRequired
created_atstring or nullRequired
created_byobject or any or nullRequired
idintegerRequired

The id the /access/users/{user} endpoints take.

keysarray of objectsRequired

The user's keys. While SSH keys are on for your company, web lists every key that can log in as it, from every level.

Fields of each item
added_atstring or nullRequired
added_byobject or any or nullRequired
bitsinteger or nullRequired
can_deletebooleanRequired

Whether this endpoint group can remove the key. Other keys are removed where they were added.

commentstring or nullRequired

The comment at the end of the key line, when it had one.

company_key_idinteger or nullRequired
fingerprintstringRequired

The SHA-256 fingerprint, as ssh-keygen -lf prints it.

idintegerRequired

The id DELETE /corestack/sites/{site}/access/keys/{key} takes. 0 for the Corefinity deploy key.

namestringRequired
originobject

Sent while SSH keys are on for your company. The level the key comes from.

Fields
layerstringRequired
agencycompanywebsiteenvironmentuserlegacysystem
ownerobject or any or nullRequired
restrictedbooleanRequired

True when the key carries restrictions from before it was imported. Only Corefinity changes those.

restrictionsarray of stringsRequired
sourcestringRequired

company is a company key. system is the Corefinity deploy key. Everything else reads user.

usercompanysystem
statusstringRequired
pendingappliedfailedremoving
status_labelstringRequired
typestringRequired

The key type, such as ssh-ed25519 or ssh-rsa.

kindstringRequired

built_in is web. It cannot be changed or removed.

built_innamed
labelstring or nullRequired
passwordobjectRequired

Whether the user has a password. The password itself is never answered here.

Fields
setbooleanRequired
set_atstring or nullRequired
set_byobject or any or nullRequired
root_pathstring or nullRequired

The folder an SFTP user is limited to, relative to the site.

root_path_absolutestring or nullRequired

The same folder as a path on the server.

statusstringRequired

pending until the change that made or changed the user is live.

pendingappliedfailedremoving
status_labelstringRequired
typestringRequired
sshsftp
type_labelstringRequired
uidinteger or nullRequired

The user's numeric id on the server.

usernamestringRequired

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.
403restrictedRestricted keys are changed by staff.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409busyAnother operation is running on the site. Wait for it to finish.
409in_useIt is still in use, still being removed, or managed somewhere else. Read the message: wait for the removal, remove what uses it first, or remove it where the message says.
409managed_elsewhereThis site is read-only here. Change it in the control panel that manages it.
409ssh_key_duplicateThe key is already added here. Use the existing one.
422invalidFix the field named in field; errors says why.
422ssh_person_managed_elsewhereThat username belongs to a person's own SSH login, managed in their profile. Choose another name.
429rate_limitedWait for the seconds in Retry-After.
502noneRead the message; it says what happened.
503noneTry again shortly.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/access/users \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "Photographer",
    "password": "generate",
    "root_path": "htdocs/wp-content/uploads",
    "type": "sftp",
    "username": "photographer"
  }'
{
  "access": {
    "apply": {
      "applied_at": "2026-11-03T10:03:10+00:00",
      "error": null,
      "operation": {
        "id": 5120,
        "scope": "site",
        "status": "committed",
        "status_label": "Waiting for the platform",
        "summary": "Add SFTP user photographer",
        "to_version": null,
        "type": "users_change",
        "type_label": "SSH / SFTP users"
      },
      "state": "applying",
      "state_label": "Applying"
    },
    "company_keys": [],
    "connection": {
      "host": "ssh-northwind.example.net",
      "port": 20101,
      "ssh_user": "web",
      "tunnel_command": "ssh -N -L 3306:127.0.0.1:3306 -p 20101 [email protected]"
    },
    "limits": {
      "company_keys_max": 50,
      "keys_per_user_max": 50,
      "root_path_suggestions": [
        "htdocs",
        "htdocs/wp-content/uploads",
        "shared"
      ],
      "users_max": 25
    },
    "terminal": {
      "active_session": null,
      "available": true,
      "reason": null
    },
    "users": [
      {
        "can_change": false,
        "can_delete": false,
        "connection": {
          "command": "ssh -p 20101 [email protected]",
          "sftp_command": "sftp -P 20101 [email protected]"
        },
        "created_at": "2026-11-02T10:15:00+00:00",
        "created_by": null,
        "id": 417,
        "keys": [
          {
            "added_at": "2026-11-02T10:15:00+00:00",
            "added_by": null,
            "bits": 3072,
            "can_delete": false,
            "comment": "cfcp:deploy",
            "company_key_id": null,
            "fingerprint": "SHA256:ExampleDeployKeyFingerprintNotARealOne00000",
            "id": 0,
            "name": "cfcp-deploy",
            "restricted": false,
            "restrictions": [],
            "source": "system",
            "status": "applied",
            "status_label": "Applied",
            "type": "ssh-rsa"
          }
        ],
        "kind": "built_in",
        "label": null,
        "password": {
          "set": false,
          "set_at": null,
          "set_by": null
        },
        "root_path": null,
        "root_path_absolute": null,
        "status": "applied",
        "status_label": "Applied",
        "type": "ssh",
        "type_label": "SSH + SFTP",
        "uid": 9991,
        "username": "web"
      },
      {
        "can_change": true,
        "can_delete": true,
        "connection": {
          "command": null,
          "sftp_command": "sftp -P 20101 [email protected]"
        },
        "created_at": "2026-11-05T09:16:40+00:00",
        "created_by": {
          "id": 2011,
          "name": "Maya Okafor"
        },
        "id": 419,
        "keys": [],
        "kind": "named",
        "label": "Photographer",
        "password": {
          "set": true,
          "set_at": "2026-11-05T09:16:40+00:00",
          "set_by": {
            "id": 2011,
            "name": "Maya Okafor"
          }
        },
        "root_path": "htdocs/wp-content/uploads",
        "root_path_absolute": "/var/www/harbourandfinch.example.com/htdocs/wp-content/uploads",
        "status": "pending",
        "status_label": "Applying",
        "type": "sftp",
        "type_label": "SFTP only",
        "uid": 20002,
        "username": "photographer"
      },
      {
        "can_change": true,
        "can_delete": true,
        "connection": {
          "command": "ssh -p 20101 [email protected]",
          "sftp_command": "sftp -P 20101 [email protected]"
        },
        "created_at": "2026-11-02T10:15:00+00:00",
        "created_by": {
          "id": 2011,
          "name": "Maya Okafor"
        },
        "id": 3418,
        "keys": [
          {
            "added_at": "2026-11-03T10:02:44+00:00",
            "added_by": null,
            "bits": null,
            "can_delete": true,
            "comment": null,
            "company_key_id": null,
            "fingerprint": "SHA256:KhDfvkk2rdhCA9zaR3SurL80w/B/MbslK5FOxIaEpY0",
            "id": 7312,
            "name": "Supplier laptop",
            "restricted": false,
            "restrictions": [],
            "source": "user",
            "status": "applied",
            "status_label": "Applied",
            "type": "ssh-ed25519"
          }
        ],
        "kind": "named",
        "label": "Print supplier",
        "password": {
          "set": false,
          "set_at": null,
          "set_by": null
        },
        "root_path": null,
        "root_path_absolute": null,
        "status": "applied",
        "status_label": "Applied",
        "type": "ssh",
        "type_label": "SSH + SFTP",
        "uid": 20001,
        "username": "supplier"
      }
    ]
  },
  "operation": {
    "applied_at": null,
    "can_retry": false,
    "cluster": {
      "id": 17,
      "name": "WordPress Cluster 1"
    },
    "committed_at": "2026-11-05T09:16:40Z",
    "completed_at": null,
    "created_at": "2026-11-05T09:16:40Z",
    "environment": {
      "env_id": "rs-northwind-harbourandfinch-example-com",
      "hostname": "harbourandfinch-example-com.northwind.cfstack.example.net",
      "id": 1042,
      "name": "Production",
      "role": "production",
      "role_label": "Production",
      "slug": "production"
    },
    "error": null,
    "failure_reason": null,
    "from_version": null,
    "hot": true,
    "id": 5120,
    "install": null,
    "label": "Picked up by the platform",
    "notes": [],
    "parent_operation_id": null,
    "requested_by": {
      "id": 2011,
      "name": "Maya Okafor"
    },
    "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": 1042
    },
    "status": "committed",
    "status_label": "Waiting for the platform",
    "step": "applied",
    "steps": [
      {
        "key": "saved",
        "label": "Saved",
        "state": "done"
      },
      {
        "key": "applied",
        "label": "Picked up by the platform",
        "state": "current"
      },
      {
        "key": "live",
        "label": "Live",
        "state": "todo"
      }
    ],
    "subject": null,
    "summary": "Add SFTP user photographer",
    "to_version": null,
    "type": "users_change",
    "type_label": "SSH / SFTP users"
  },
  "password": {
    "revealed_at": "2026-11-05T09:16:40+00:00",
    "value": "ExamplePasswordAbc23"
  },
  "user": {
    "can_change": true,
    "can_delete": true,
    "connection": {
      "command": null,
      "sftp_command": "sftp -P 20101 [email protected]"
    },
    "created_at": "2026-11-05T09:16:40+00:00",
    "created_by": {
      "id": 2011,
      "name": "Maya Okafor"
    },
    "id": 419,
    "keys": [],
    "kind": "named",
    "label": "Photographer",
    "password": {
      "set": true,
      "set_at": "2026-11-05T09:16:40+00:00",
      "set_by": {
        "id": 2011,
        "name": "Maya Okafor"
      }
    },
    "root_path": "htdocs/wp-content/uploads",
    "root_path_absolute": "/var/www/harbourandfinch.example.com/htdocs/wp-content/uploads",
    "status": "pending",
    "status_label": "Applying",
    "type": "sftp",
    "type_label": "SFTP only",
    "uid": 20002,
    "username": "photographer"
  }
}
Try it

Try it is off for this endpointIt reveals a secret. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT