---
title: "Get a site's SSH and SFTP access"
url: https://docs.corefinity.com/api/reference/access/get-site-access
type: endpoint
last_updated: 2026-11-13
feature: access
related:
  - https://docs.corefinity.com/guides/sites/access-and-security/connection-details.md
  - https://docs.corefinity.com/mcp/tools/corestack_ssh_access_get.md
---
# Get a site's SSH and SFTP access

Answers how to connect to the site or environment, its users with their keys, the company keys that reach it,
and ready `ssh`, `sftp`, `rsync` and database tunnel commands for the built-in `web` user. While SSH keys are
on for your company it also answers the usernames and host keys, and `web` lists every key that can log in as
it.

```http
GET /api/corestack/sites/{site}/access
```

- Scope: `read`
- Two-factor: required on your account (all)
- Rate limit: 120 a minute
- Try it in the console: on

## Path parameters

- `site` (integer, required): The id of a site row. A website's production site and each of its environments has its own id. Digits only.

## Request

### curl

```bash
curl https://manage.corefinity.com/api/corestack/sites/1042/access \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

### PHP

```php
use Illuminate\Support\Facades\Http;

$response = Http::withToken(env('COREFINITY_TOKEN'))
    ->acceptJson()
    ->get('https://manage.corefinity.com/api/corestack/sites/1042/access');

$data = $response->json();
```

### Node

```javascript
const res = await fetch('https://manage.corefinity.com/api/corestack/sites/1042/access', {
  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);
```

### Python

```python
import os
import requests

res = requests.get(
    "https://manage.corefinity.com/api/corestack/sites/1042/access",
    headers={
        "Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
        "Accept": "application/json",
    },
)

data = res.json() if res.content else None
```

## Responses

### 200 The site's access.

```json
{
  "apply": {
    "applied_at": "2026-11-03T10:03:10+00:00",
    "error": null,
    "operation": null,
    "state": "applied",
    "state_label": "Applied"
  },
  "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 web@ssh-northwind.example.net"
  },
  "host_keys": {
    "current": [
      {
        "fingerprint": "SHA256:ExampleHostKeyEd25519FingerprintNotARealOne",
        "type": "ed25519"
      }
    ],
    "managed_by": "panel",
    "next": null
  },
  "known_hosts": [
    "[ssh-northwind.example.net]:20101 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAAAExampleHostKeyOnlyThisIsNotARealHostKey1"
  ],
  "limits": {
    "company_keys_max": 50,
    "keys_per_user_max": 50,
    "root_path_suggestions": [
      "htdocs",
      "htdocs/wp-content/uploads",
      "shared"
    ],
    "users_max": 25
  },
  "logins": {
    "web": {
      "command": "ssh -p 20101 web@ssh-northwind.example.net",
      "login": "web"
    },
    "you": {
      "command": "ssh -p 20101 maya-northwind@ssh-northwind.example.net",
      "delivered": true,
      "login": "maya-northwind",
      "state": "ready"
    }
  },
  "persons": [],
  "ready_lines": {
    "rsync": "rsync -e 'ssh -p 20101' -a ./ web@ssh-northwind.example.net:/var/www/harbourandfinch.example.com/htdocs/",
    "sftp": "sftp -P 20101 web@ssh-northwind.example.net",
    "ssh": "ssh -p 20101 web@ssh-northwind.example.net",
    "tunnel": "ssh -N -L 3306:127.0.0.1:3306 -p 20101 web@ssh-northwind.example.net"
  },
  "terminal": {
    "active_session": null,
    "available": true,
    "reason": null
  },
  "users": [
    {
      "can_change": false,
      "can_delete": false,
      "connection": {
        "command": "ssh -p 20101 web@ssh-northwind.example.net",
        "sftp_command": "sftp -P 20101 web@ssh-northwind.example.net"
      },
      "created_at": "2026-11-02T10:15:00+00:00",
      "created_by": null,
      "id": 417,
      "keys": [
        {
          "added_at": "2026-11-03T10:02:44+00:00",
          "added_by": {
            "id": 2011,
            "name": "Maya Okafor"
          },
          "bits": null,
          "can_delete": true,
          "comment": null,
          "company_key_id": null,
          "fingerprint": "SHA256:O2Hqs6Iw0tDmPEeRkLTcr6n4V7Vhu5oPJRWviv9+2Ro",
          "id": 7308,
          "name": "Deployment service",
          "origin": {
            "layer": "environment",
            "owner": {
              "id": 1342,
              "name": "Production",
              "type": "environment"
            }
          },
          "restricted": false,
          "restrictions": [],
          "source": "user",
          "status": "applied",
          "status_label": "Applied",
          "type": "ssh-ed25519"
        },
        {
          "added_at": "2026-11-02T10:15:00+00:00",
          "added_by": null,
          "bits": null,
          "can_delete": false,
          "comment": null,
          "company_key_id": null,
          "fingerprint": "SHA256:ExampleDeployKeyFingerprintNotARealOne00000",
          "id": 0,
          "name": "Corefinity deploy key",
          "origin": {
            "layer": "system",
            "owner": null
          },
          "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": "ssh -p 20101 supplier@ssh-northwind.example.net",
        "sftp_command": "sftp -P 20101 supplier@ssh-northwind.example.net"
      },
      "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"
    }
  ]
}
```

### 401 No token, or a token that is not valid.

```json
{
  "message": "Unauthenticated."
}
```

### 403 The token lacks the scope (`scope_required`, with the `scope` to use), your company requires two-factor authentication and you have not set it up, or your account has no company that can use Managed Clusters, for example because the company was closed (`company_unavailable` or `company_not_enabled`, whichever the route checks first). For Managed Clusters routes; any other route uses `ForbiddenScopeOrTwoFactor`.

```json
{
  "code": "company_unavailable",
  "message": "Your company is unavailable.",
  "reason": "company_unavailable"
}
```

### 404 The id does not exist or is something you cannot see, or the feature is not on for your company (`feature_off`).

```json
{
  "code": "feature_off",
  "message": "Not found.",
  "reason": "feature_off"
}
```

### 429 Too many requests (`rate_limited`). Wait for the number of seconds in `Retry-After`, which `retry_after_seconds` repeats.

```json
{
  "code": "rate_limited",
  "message": "Too many requests. Try again in 60 seconds.",
  "reason": "rate_limited",
  "retry_after_seconds": 60
}
```

## If it is refused

| Status | Reason | What to do |
|---|---|---|
| 401 |  | 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. |
| 429 | `rate_limited` | Wait for the seconds in `Retry-After`. |

## The same task elsewhere

- Guide: [Connection details](https://docs.corefinity.com/guides/sites/access-and-security/connection-details.md)
- MCP tool: [`corestack_ssh_access_get`](https://docs.corefinity.com/mcp/tools/corestack_ssh_access_get.md)
