---
raw: true
search:
  tags:
    - Versions
    - POST
seo:
  description: >-
    Opens a comment thread on a version. Leave… Reference for the POST
    /v1/spaces/{spaceId}/versions/{versionId}/comments endpoint in the Spacefast
    Partner API.
sidebar:
  label: Create a version comment
  badge: POST
title: Create a version comment
type: openapi-operation
---
Opens a comment thread on a version. Leave out `target` to comment on the whole page; `mentions` notifies the people you name.

`POST /v1/spaces/{spaceId}/versions/{versionId}/comments`

**Request body** (`application/json`, required)

- `pagePath` (string) — Page the thread is anchored to. Ignored when \`target\` is a file anchor: that anchor's \`file.path\` is the page path, so the thread is always filed under the file it is about.
- `body` (string, required)
- `target` (object | null) — Where in the page or file this thread points. Omit it for a comment on the whole page: the API stores a page anchor. A file anchor files the thread under its \`file.path\`; any other shape is stored and returned as sent.
- `mentions` (string[]) — Spacefast user ids to @mention. Each must be on the Space's team and able to open it; \`GET /v1/spaces/{spaceId}/comments/mentionable\` lists who qualifies. Mentioned people are notified.
- `idempotencyKey` (string)

Request body example:

```json
{
  "pagePath": "/",
  "body": "string",
  "target": {
    "property1": null,
    "property2": null
  },
  "mentions": [
    "string"
  ],
  "idempotencyKey": "string"
}
```

**Responses**

- `201` — Response for status 201
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 201:

```json
{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "castThreadId": "string",
    "spaceId": "string",
    "versionId": "string",
    "channel": "string",
    "pagePath": "string",
    "url": "string",
    "status": "open",
    "moderationState": "clear",
    "heldCommentIds": [
      "string"
    ],
    "unread": true,
    "unreadCount": 0,
    "body": "string",
    "author": {
      "kind": "string",
      "id": "string",
      "profileId": "string",
      "name": "string",
      "username": "string",
      "avatarUrl": "http://example.com",
      "color": "string"
    },
    "target": {
      "property1": null,
      "property2": null
    },
    "mentions": [
      "string"
    ],
    "reactions": {
      "property1": {
        "count": 0,
        "actors": {
          "property1": {
            "name": "string"
          },
          "property2": {
            "name": "string"
          }
        }
      },
      "property2": {
        "count": 0,
        "actors": {
          "property1": {
            "name": "string"
          },
          "property2": {
            "name": "string"
          }
        }
      }
    },
    "attachmentOrigin": "http://example.com",
    "attachments": [
      {
        "id": "string",
        "name": "string",
        "contentType": "string",
        "size": 1,
        "kind": "screenshot",
        "crop": {
          "x": 0,
          "y": 0,
          "width": 0,
          "height": 0
        },
        "url": "string"
      }
    ],
    "comments": [
      {
        "attachments": [
          {
            "id": "string",
            "name": "string",
            "contentType": "string",
            "size": 1,
            "kind": "screenshot",
            "crop": {
              "x": 0,
              "y": 0,
              "width": 0,
              "height": 0
            },
            "url": "string"
          }
        ],
        "mentions": [
          "string"
        ],
        "property1": null,
        "property2": null
      }
    ],
    "permalink": "string",
    "dashboardUrl": "http://example.com",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastActivityAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
```
