# Rename or reorder a space

> PATCH /spaces/{spaceId}

Source: https://mockflow.com/developers/reference/spaces/update-space

**PATCH** `https://api.mockflow.com/v1/spaces/{spaceId}`  
Scopes: `boards:write`

**curl**

```bash
curl https://api.mockflow.com/v1/spaces/spc_92kd \
  -X PATCH \
  -H "Authorization: Bearer $MOCKFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Q4 Launch Planning",
  "position": 0
}'
```

**JavaScript**

```javascript
const response = await fetch("https://api.mockflow.com/v1/spaces/spc_92kd", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.MOCKFLOW_API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
  "name": "Q4 Launch Planning",
  "position": 0
})
});

const data = await response.json();
```

**Python**

```python
import os, requests

response = requests.patch(
    "https://api.mockflow.com/v1/spaces/spc_92kd",
    headers={"Authorization": f"Bearer {os.environ['MOCKFLOW_API_KEY']}"},
    json={
  "name": "Q4 Launch Planning",
  "position": 0
},
)

response.raise_for_status()
data = response.json()
```

**200**

```json
{
  "id": "string",
  "name": "Q4 Launch Planning",
  "builtIn": false,
  "role": "owner",
  "boardCount": 0,
  "memberCount": 0
}
```

**429**

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests.",
    "docsUrl": "https://mockflow.com/developers/concepts/errors#rate_limited"
  },
  "requestId": "req_45d49816999bac40"
}
```

Rename is open to a shared admin or editor. Reorder is the owning workspace's.

### Authorization

- `Authorization` (string, required): `Bearer <key>`. The key needs `boards:write` scope. Create and manage keys in the [developer console](/developers/console/); what each scope unlocks is on the [scopes page](/developers/concepts/scopes).

### Path parameters

- `spaceId` (string, required)

### Body

- `name` (string)
- `position` (integer)

### Response

- `id` (string): A space id, or the reserved `default` and `trash`.
- `name` (string)
- `builtIn` (boolean)
- `role` (enum<string>): The product's roles. Owner is the workspace that holds the board or space and cannot be granted or transferred. Admin can rename and share, editor can edit, reviewer can view, export and add comment items. There is no viewer role and no pending state. One of `owner`, `admin`, `editor` or `reviewer`.
- `boardCount` (integer)
- `memberCount` (integer)
- `coverUrl` (string | null)
- `publicUrl` (string | null)
- `position` (integer): Dashboard order, lowest first.
- `createdBy` (string | null)
- `createdAt` (string | null)
- `updatedAt` (string | null)
- `deletedAt` (string | null)

### Errors

- 429 `rate_limited`: Too many requests.
