---
title: "Rename a space or change its lifetime"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename a space or change its lifetime

Path: CloudRaker Paperwork API › Spaces

`PATCH /v1/spaces/{spaceId}`

Send `name`, `ttl`, or both.

- `name` renames the space. The id does not change, so its files and runs stay attached.
- `ttl` sets a new deadline: `expiresAt` becomes now plus `ttl` seconds, whether that extends the space or shortens it.

Only a space created with `POST /v1/spaces` can be changed here; any other space answers `404`.

```json
{ "name": "Acme onboarding", "ttl": 2592000 }
```

**Learn more:** [Spaces](https://docs.cloudraker.com/paperwork/developers/spaces)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `spaceId` (`updateApiSpace.path.spaceId`; string, required)
  - minLength 1

## Request body

_Required._

- `name` (`updateApiSpace.name`; string, optional) — The new name for the space.
  - minLength 1; maxLength 120; example `"Acme onboarding"`
- `ttl` (`updateApiSpace.ttl`; integer, optional) — Seconds until the space expires, from now.
  - min 300; max 7776000; example `604800`

## Example request

```json
{
  "name": "Acme onboarding",
  "ttl": 604800
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.cloudraker.com/v1/spaces/<spaceId>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Acme onboarding",
  "ttl": 604800
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/spaces/<spaceId>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({name: 'Acme onboarding', ttl: 604800})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/v1/spaces/<spaceId>"

payload = {
    "name": "Acme onboarding",
    "ttl": 604800
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The space.

#### Example

```json
{
  "object": "space",
  "id": "string",
  "name": "string",
  "createdAt": "string",
  "expiresAt": "string"
}
```

- `object` (`updateApiSpace.response.200.object`; string, required)
- `id` (`updateApiSpace.response.200.id`; string, required)
- `name` (`updateApiSpace.response.200.name`; string, required)
- `createdAt` (`updateApiSpace.response.200.createdAt`; string, required)
- `expiresAt` (`updateApiSpace.response.200.expiresAt`; string | null, required)

### 400

Invalid request (`invalid_request`).

### 404

Unknown, archived, expired, or not an API-created space.

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`updateApiSpace.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`updateApiSpace.response.429.message`; string, required)
- `retryable` (`updateApiSpace.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`updateApiSpace.response.429.requestId`; string, required)
- `docUrl` (`updateApiSpace.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/spaces/update-api-space/index.md
