---
description: >-
  .selectServer() is used to select a server that you want to edit on the
  session ID
---

# selectServer

**.selectServer(SessionID, serverCode)**

Select a server to edit for a session ID

| Parameter  | Type   | Required | Description                                             |
| ---------- | ------ | -------- | ------------------------------------------------------- |
| SessionID  | string | true     | The session of the account you want to select server on |
| serverCode | string | true     | The code of the server you want to select               |

**Example:**

```javascript
// Dependencies
const CubedCraft = require('cubed-api');

// Account Details
const username = 'ACCOUNT_USERNAME';
const password = 'ACCOUNT_PASSWORD';

// Server Details
const serverName = 'SERVER_NAME';

// Logging Into The Account
CubedCraft.login(username, password).then(ses => {

    // Getting All Of The User's Servers With Their Session ID
    CubedCraft.getServers(ses).then(servers => {
        const server = servers.find(s => s.name.toLowerCase() === serverName.toLowerCase());
        console.log(server.code);
    })
    
});
```

{% hint style="info" %}
Read the page on selecting a server for more information: [https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/selecting-a-server-to-edit](https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/selecting-a-server-to-edit)
{% endhint %}
