# deleteServerEnvironmentLink

```graphql
mutation DeleteServerEnvironmentLink($input: ServerEnvironmentLinkInput!) {
  deleteServerEnvironmentLink(input: $input) {
    ok
    id
    shortId
    userId
    environmentIds
    hostname
    status
    createdAt
    updatedAt
  }
}
```

Unlink a server environment. Requires project.runtime.manage; API keys also need delete scope.

## Arguments

| Name                  | Type                        | Required | Description                                                                                                                                                                                                                                                                                                   |
| --------------------- | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`               | ServerEnvironmentLinkInput! | Yes      |                                                                                                                                                                                                                                                                                                               |
| `input.serverId`      | ID!                         | 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. |
| `input.environmentId` | ID!                         | Yes      |                                                                                                                                                                                                                                                                                                               |

## Variables

```json
{
  "input": {
    "serverId": "string",
    "environmentId": "string"
  }
}
```

## Responses

| Status | Description                                                           |
| ------ | --------------------------------------------------------------------- |
| 200    | The ServerEnvironmentLinkResult! in data.deleteServerEnvironmentLink. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation DeleteServerEnvironmentLink($input: ServerEnvironmentLinkInput!) {\n  deleteServerEnvironmentLink(input: $input) {\n    ok\n    id\n    shortId\n    userId\n    environmentIds\n    hostname\n    status\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "input": {
      "serverId": "string",
      "environmentId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "deleteServerEnvironmentLink": {
      "ok": false,
      "id": "string",
      "shortId": "string",
      "userId": "string",
      "environmentIds": [
        "string"
      ],
      "hostname": "string",
      "status": "string",
      "createdAt": "string",
      "updatedAt": "string"
    }
  }
}
```
