# createServer

```graphql
mutation CreateServer($input: CreateServerInput!) {
  createServer(input: $input) {
    id
    shortId
    userId
    environmentIds
    hostname
    status
    createdAt
    updatedAt
  }
}
```

Create a dedicated server for an environment. Requires project.runtime.manage.

## Arguments

| Name                     | Type               | Required | Description |
| ------------------------ | ------------------ | -------- | ----------- |
| `input`                  | CreateServerInput! | Yes      |             |
| `input.projectReference` | String             |          |             |
| `input.environmentId`    | ID!                | Yes      |             |

## Variables

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

## Responses

| Status | Description                       |
| ------ | --------------------------------- |
| 200    | The Server! in data.createServer. |

## 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 CreateServer($input: CreateServerInput!) {\n  createServer(input: $input) {\n    id\n    shortId\n    userId\n    environmentIds\n    hostname\n    status\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "input": {
      "environmentId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createServer": {
      "id": "string",
      "shortId": "string",
      "userId": "string",
      "environmentIds": [
        "string"
      ],
      "hostname": "string",
      "status": "string",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```
