---
title: "Comment on the text an anchor resolves to"
---

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

# Comment on the text an anchor resolves to

Path: CloudRaker Paperwork API › Redline

`POST /v1/redline/{sessionId}/comments`

Adds a comment anchored to the text `anchorText` matches.

```json
{ "anchorText": "thirty (30) days", "body": "Sixty days is the market standard here." }
```

`occurrence` (1-based) picks a match when the anchor is ambiguous. `author` names the comment's author in Word's review pane; it defaults to `CloudRaker`.

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

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `sessionId` (`addRedlineComment.path.sessionId`; string, required)
  - minLength 1

## Request body

_Required._

- `anchorText` (`addRedlineComment.anchorText`; string, required)
  - minLength 1; example `"thirty (30) days"`
- `body` (`addRedlineComment.body`; string, required)
  - minLength 1; example `"Sixty days is the market standard here."`
- `occurrence` (`addRedlineComment.occurrence`; integer, optional)
  - max 9007199254740991
- `author` (`addRedlineComment.author`; string, optional)
  - minLength 1; example `"Counsel"`

## Example request

```json
{
  "anchorText": "thirty (30) days",
  "occurrence": 9007199254740991,
  "body": "Sixty days is the market standard here.",
  "author": "Counsel"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/v1/redline/<sessionId>/comments' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "anchorText": "thirty (30) days",
  "occurrence": 9007199254740991,
  "body": "Sixty days is the market standard here.",
  "author": "Counsel"
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/redline/<sessionId>/comments';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    anchorText: 'thirty (30) days',
    occurrence: 9007199254740991,
    body: 'Sixty days is the market standard here.',
    author: 'Counsel'
  })
};

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/redline/<sessionId>/comments"

payload = {
    "anchorText": "thirty (30) days",
    "occurrence": 9007199254740991,
    "body": "Sixty days is the market standard here.",
    "author": "Counsel"
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

The new comment id and revision.

#### Example

```json
{
  "revision": -9007199254740991,
  "result": {
    "commentId": "c2",
    "resolved": true
  },
  "summary": {
    "paragraphCount": -9007199254740991,
    "comments": -9007199254740991,
    "trackedChanges": -9007199254740991
  }
}
```

- `revision` (`addRedlineComment.response.201.revision`; integer, required)
  - min -9007199254740991; max 9007199254740991
- `result` (`addRedlineComment.response.201.result`; object, required)
  - `commentId` (`addRedlineComment.response.201.result.commentId`; string, required)
    - example `"c2"`
  - `resolved` (`addRedlineComment.response.201.result.resolved`; boolean, optional)
- `summary` (`addRedlineComment.response.201.summary`; object, required)
  - `paragraphCount` (`addRedlineComment.response.201.summary.paragraphCount`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `comments` (`addRedlineComment.response.201.summary.comments`; integer, required)
    - min -9007199254740991; max 9007199254740991
  - `trackedChanges` (`addRedlineComment.response.201.summary.trackedChanges`; integer, required)
    - min -9007199254740991; max 9007199254740991

### 400

The anchor matched nothing.

### 404

Unknown or expired session.

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


Source: https://docs.cloudraker.com/paperwork/api/redline/add-redline-comment/index.md
