---
title: "Open a redlining session on a Word document"
---

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

# Open a redlining session on a Word document

Path: CloudRaker Paperwork API › Tools

`POST /v1/files/{ref}/redline`

Opens an editing session on a `.docx` file so you can rewrite it with tracked changes.

```json
{ "ttl": 86400 }
```

`ttl` is seconds until the session expires, from 60 to 604800 (one week); it defaults to the redlining service's own default. Nothing is stored back into your corpus until you call [flush](https://docs.cloudraker.com/paperwork/api/redline/flush-redline-session).

Only a Word document can be redlined. Everything else answers `422`.

**Learn more:** [Redlining](https://docs.cloudraker.com/paperwork/developers/file-tools)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `ref` (`redlineFile.path.ref`; string, required)
  - minLength 1

## Request body

_Required._

- `ttl` (`redlineFile.ttl`; integer, optional)
  - min 60; max 604800; example `86400`

## Example request

```json
{
  "ttl": 86400
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/v1/files/<ref>/redline' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ttl": 86400
}'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/files/<ref>/redline';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({ttl: 86400})
};

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/files/<ref>/redline"

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

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

print(response.text)
```

## Responses

### 201

The open session.

#### Example

```json
{
  "object": "redline_session",
  "id": "rdl_01K9Z6P2R4",
  "fileId": "string",
  "expiresAt": "string",
  "revision": -9007199254740991
}
```

- `object` (`redlineFile.response.201.object`; string, required)
- `id` (`redlineFile.response.201.id`; string, required)
  - example `"rdl_01K9Z6P2R4"`
- `fileId` (`redlineFile.response.201.fileId`; string, required)
- `expiresAt` (`redlineFile.response.201.expiresAt`; string, required)
- `revision` (`redlineFile.response.201.revision`; integer, required)
  - min -9007199254740991; max 9007199254740991

### 400

Validation Error

#### Example

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

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

### 404

Unknown file.

### 422

The file is not a Word document.

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


Source: https://docs.cloudraker.com/paperwork/api/tools/redline-file/index.md
