# Link environment to server

```http
POST /servers/{server_id}/environments/{environment_id}
```

Link a server environment. Requires project.runtime.manage.

## Parameters

| Name             | In   | Required | Description                                                                                                                                                                                                                                                                                                   |
| ---------------- | ---- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `server_id`      | path | Yes      | ID of a server you own. Linking and unlinking require project.runtime.manage on every project currently linked to the server. If none are linked, no project capability is required. Linking also requires project.runtime.manage on the environment’s project. Unlinking also requires API-key delete scope. |
| `environment_id` | path | Yes      |                                                                                                                                                                                                                                                                                                               |

## Responses

| Status | Description                     |
| ------ | ------------------------------- |
| 200    | Environment linked              |
| 400    | Invalid input                   |
| 401    | Unauthorized                    |
| 403    | Forbidden                       |
| 404    | Server or environment not found |
| 500    | Server error                    |
