---
title: "Open a thread on a timeline entry"
---

> 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 thread on a timeline entry

Path: CloudRaker Workspace API › Workspace Sessions

`POST /workspace/sessions/{sessionId}/threads`

A reply opens a thread (spec §4.4/W6): the thread is rooted at an existing entry’s `seq`, and a later comment or turn carries the returned `thd_` id as its `threadId`. A `threadId` that is not a thread of this session is refused 404 wherever it is used, so nothing unvalidated lands on a permanent timeline. **Authorization:** `work_session:comment` on the session, OR `space:contribute` on one of its linked spaces; a desk session only for its owner. Any denial is 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `sessionId` (`openWorkspaceSessionThread.path.sessionId`; string, required)

## Request body

_Required._

- `rootSeq` (`openWorkspaceSessionThread.rootSeq`; integer, required)
  - min 1; max 9007199254740991
- `archived` (`openWorkspaceSessionThread.archived`; boolean, optional)
- `anchor` (`openWorkspaceSessionThread.anchor`; object, optional)
  - `artifactId` (`openWorkspaceSessionThread.anchor.artifactId`; string, required)
    - minLength 1; maxLength 128; example `"art_01J8Z…"`
  - `from` (`openWorkspaceSessionThread.anchor.from`; integer, required)
    - min 0; max 9007199254740991; example `512`
  - `to` (`openWorkspaceSessionThread.anchor.to`; integer, required)
    - min 0; max 9007199254740991; example `640`

## Example request

```json
{
  "archived": true,
  "rootSeq": 1,
  "anchor": {
    "artifactId": "art_01J8Z…",
    "from": 512,
    "to": 640
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/workspace/sessions/<sessionId>/threads' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "archived": true,
  "rootSeq": 1,
  "anchor": {
    "artifactId": "art_01J8Z…",
    "from": 512,
    "to": 640
  }
}
'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/workspace/sessions/<sessionId>/threads';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <token>'},
  body: JSON.stringify({
    archived: true,
    rootSeq: 1,
    anchor: {artifactId: 'art_01J8Z…', from: 512, to: 640}
  })
};

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/workspace/sessions/<sessionId>/threads"

payload = {
    "archived": True,
    "rootSeq": 1,
    "anchor": {
        "artifactId": "art_01J8Z…",
        "from": 512,
        "to": 640
    }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 201

The opened thread.

#### Example

```json
{
  "data": {
    "archivedAt": "2019-08-24T14:15:22Z",
    "id": "thd_01J8Z…",
    "rootSeq": 12,
    "createdAt": "2019-08-24T14:15:22Z",
    "anchor": {
      "artifactId": "art_01J8Z…",
      "from": 512,
      "to": 640,
      "quote": "string",
      "sourceVersion": 9007199254740991
    }
  }
}
```

- `data` (`openWorkspaceSessionThread.response.201.data`; object, required)
  - `id` (`openWorkspaceSessionThread.response.201.data.id`; string, required)
    - example `"thd_01J8Z…"`
  - `rootSeq` (`openWorkspaceSessionThread.response.201.data.rootSeq`; integer, required)
    - min -9007199254740991; max 9007199254740991; example `12`
  - `createdAt` (`openWorkspaceSessionThread.response.201.data.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `anchor` (`openWorkspaceSessionThread.response.201.data.anchor`; any of, required)
    - any of:
      - `object`
        - `artifactId` (`openWorkspaceSessionThread.response.201.data.anchor.1.artifactId`; string, required)
          - minLength 1; maxLength 128; example `"art_01J8Z…"`
        - `from` (`openWorkspaceSessionThread.response.201.data.anchor.1.from`; integer, required)
          - min 0; max 9007199254740991; example `512`
        - `to` (`openWorkspaceSessionThread.response.201.data.anchor.1.to`; integer, required)
          - min 0; max 9007199254740991; example `640`
        - `quote` (`openWorkspaceSessionThread.response.201.data.anchor.1.quote`; string, optional)
          - minLength 1; maxLength 2000
        - `sourceVersion` (`openWorkspaceSessionThread.response.201.data.anchor.1.sourceVersion`; integer, optional)
          - min 0; max 9007199254740991
      - `null`
  - `archivedAt` (`openWorkspaceSessionThread.response.201.data.archivedAt`; any of, optional)
    - any of: `string`, `null`

### 400

`validation_failed` — a malformed body, e.g. a missing `rootSeq`.

### 404

No such session, or the caller may not write it; `entry_not_found` — no entry at that `rootSeq`.


Source: https://docs.cloudraker.com/workspace/api/workspace-sessions/open-workspace-session-thread/index.md
