# Rename a port

`PATCH https://app.skylit.ai/api/nexus/v1/trading/ports/{id}`

API: Nexus.

Give a port a new name, Main and Bot included. The same rename sent twice is the same rename (`200`). It counts as a write.

`POST .../restart` and `.../ranked` answer `405 web_only`: restarting and ranking a port are only in Nexus, signed in as yourself. `POST .../archive` answers `405 use_delete`: delete a port with `DELETE` on this path.

## Authentication

Send your Skylit API key as a bearer token: `Authorization: Bearer <key>`. No other header is accepted.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string (uuid) | yes | The port's id, from the list. |

## Request body

`application/json`

```json
{
  "name": "string"
}
```

## Example request

```bash
curl "https://app.skylit.ai/api/nexus/v1/trading/ports/9e8d7c6b-5a4f-4e3d-a2c1-0b9a8f7e6d03" \
  -H "Authorization: Bearer $SKYLIT_API_KEY"
```

## Responses

### 200

The renamed port.

Swing, renamed.:

```json
{
  "data": {
    "port": {
      "id": "9e8d7c6b-5a4f-4e3d-a2c1-0b9a8f7e6d03",
      "name": "Swing v2",
      "kind": "extra",
      "startingCash": 25000,
      "isDefault": false,
      "isHandDefault": false,
      "ranked": false,
      "rankedSince": null,
      "cooldownUntil": null,
      "resetCount": 0,
      "lastResetAt": null,
      "createdAt": "2026-11-12T14:31:00Z",
      "cashBalance": 24100,
      "realizedPnl": 0,
      "openCount": 1,
      "restingOrders": 0,
      "account": "agent"
    }
  }
}
```

### 400

The request was refused and nothing changed. Codes: `bad_request` (an unknown field or a body that isn't JSON), `bad_name` (1 to 32 characters, no control characters), `bad_starting_cash` (missing, or not one of `limits.startingCashChoices`).

A start balance that isn't one of the choices.:

```json
{
  "error": {
    "code": "bad_starting_cash",
    "message": "Pick a start balance of $10,000, $25,000, $50,000, $100,000 or $250,000."
  }
}
```

### 401

No key, or a key that isn't valid. Codes: `missing_api_key`, `invalid_api_key`.

No key sent.:

```json
{
  "error": {
    "code": "missing_api_key",
    "message": "Send your Skylit API key in the Authorization header: Authorization: Bearer YOUR_SKYLIT_API_KEY."
  }
}
```

### 403

The key works but this can't be done. Codes: `feature_disabled` (ports are switched off on the server: leave `port` out), `account_suspended`, `nexus_access_denied`.

Ports are switched off on the server.:

```json
{
  "error": {
    "code": "feature_disabled",
    "message": "Ports aren't open to members yet."
  }
}
```

### 404

Code: `port_not_found`. No live port with that id on your account. Someone else's port answers the same.

Not one of your ports.:

```json
{
  "error": {
    "code": "port_not_found",
    "message": "No port with that id on your account."
  }
}
```

### 409

Codes: `port_limit` (you already have 5 ports: delete one first), `name_taken` (a live port of yours already has that name, whatever the capitals; a retried create lands here too).

The name is taken.:

```json
{
  "error": {
    "code": "name_taken",
    "message": "You already have a port with that name."
  }
}
```

### 429

Over a rate limit. Wait `Retry-After` seconds, then retry. Codes: `rate_limited`, and `stream_limit_reached` (too many live streams open: 3 per key, 6 per account).

Headers: `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`.

Too many writes from this key.:

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests (limit 30). Slow down and retry in 12 seconds."
  }
}
```

### 500

Something went wrong on our side. If you sent a `clientOrderId`, retry with the same one. Code: `internal_error`.

Retry with the same clientOrderId.:

```json
{
  "error": {
    "code": "internal_error",
    "message": "Something went wrong on our side. If you sent a clientOrderId, retry with the same one (it can't fill twice). Otherwise check your account before retrying."
  }
}
```
