---
title: "Keep a run in the product"
---

> 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.

# Keep a run in the product

Path: CloudRaker Paperwork API › Runs

`POST /v1/runs/{id}/keep`

Promotes a temporary run into your workspace so it stops being temporary.

Keeping a run moves its files and outputs into a real space, re-indexes them for search, imports definition-bound extraction results as records, and clears the TTL — `expiresAt` becomes `null`.

**Two ways to name the destination:**

```json
{ "spaceId": "spc_01JQ8ZKMRT4V6WXYZ0ABCDEFGH" }
```

```json
{ "space": { "name": "Q3 invoices" } }
```

The response carries `dashboardUrl` — the space as a person would open it.

> **Note:** Keeping is idempotent for the same space, but keeping into a *different* space answers `409 already_kept`. A run that is still going answers `409 pipeline_running` — wait for [the run](https://docs.cloudraker.com/paperwork/api/runs/get-run) to finish first.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`keepRun.path.id`; string, required)
  - minLength 1

## Request body

_Required._

- `spaceId` (`keepRun.spaceId`; string, optional)
  - minLength 1
- `space` (`keepRun.space`; object, optional)
  - `name` (`keepRun.space.name`; string, required)
    - minLength 1; maxLength 120

## Example request

```json
{
  "spaceId": "string",
  "space": {
    "name": "string"
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/v1/runs/<id>/keep' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "spaceId": "string",
  "space": {
    "name": "string"
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/runs/<id>/keep';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({spaceId: 'string', space: {name: 'string'}})
};

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/runs/<id>/keep"

payload = {
    "spaceId": "string",
    "space": { "name": "string" }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

Kept.

#### Example

```json
{
  "object": "run",
  "id": "string",
  "spaceId": "string",
  "dashboardUrl": "string"
}
```

- `object` (`keepRun.response.200.object`; string, required)
- `id` (`keepRun.response.200.id`; string, required)
- `spaceId` (`keepRun.response.200.spaceId`; string, required)
- `dashboardUrl` (`keepRun.response.200.dashboardUrl`; string, required)

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`keepRun.response.400.success`; boolean, required)
  - one of `false`
- `error` (`keepRun.response.400.error`; array<unknown>, required)
- `data` (`keepRun.response.400.data`; unknown, required)

### 404

Unknown run id, or an unknown `spaceId`.

### 409

The run is still running (`pipeline_running`) or already kept.

### 410

The run expired.

### 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` (`keepRun.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`keepRun.response.429.message`; string, required)
- `retryable` (`keepRun.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`keepRun.response.429.requestId`; string, required)
- `docUrl` (`keepRun.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/runs/keep-run/index.md
