---
title: "Create a version comment"
method: POST
path: "/v1/spaces/{spaceId}/versions/{versionId}/comments"
tags: ["Versions"]
---

# Create a version comment

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

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/versions/{versionId}/comments`
- Auth: HTTP bearer

Opens a comment thread on a version. Leave out `target` to comment on the whole page; `mentions` notifies the people you name.

## Path parameters

- `spaceId` string, required
- `versionId` string, required

## Request body

- object
  - `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, nullable: 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

## Response `201`

Response for status 201

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `id` string, required
    - `castThreadId` string, required
    - `spaceId` string, required
    - `versionId` string, nullable, required
    - `channel` string, nullable, required
    - `pagePath` string, required
    - `url` string, nullable, required
    - `status` 'open' | 'archived', required: `open`, or `archived` for a resolved thread.
    - `moderationState` 'clear' | 'spam', required
    - `heldCommentIds` string[], required
    - `unread` boolean, required: Whether an open thread has a message by someone else since you last read it. Resolved threads are never unread.
    - `unreadCount` integer, required: Messages by others since you last read the thread. Zero exactly when `unread` is false.
    - `body` string, nullable, required
    - `author` object, nullable, required
      - `kind` string, nullable, required
      - `id` string, nullable, required
      - `profileId` string, nullable, required
      - `name` string, nullable, required
      - `username` string, nullable, required
      - `avatarUrl` string, uri, nullable, required
      - `color` string, nullable, required
    - `target` object, required
    - `mentions` string[], required: Spacefast user ids this thread or reply @mentions.
    - `reactions` object, required
    - `attachmentOrigin` string, uri, nullable, required
    - `attachments` object[], required
      - `id` string, required
      - `name` string, required
      - `contentType` string, required
      - `size` integer, required
      - `kind` 'screenshot' | 'image' | 'file', required
      - `crop` object
        - `x` number, required
        - `y` number, required
        - `width` number, required
        - `height` number, required
      - `url` string, nullable, required
    - `comments` object[], required
      - `attachments` object[], required
        - `id` string, required
        - `name` string, required
        - `contentType` string, required
        - `size` integer, required
        - `kind` 'screenshot' | 'image' | 'file', required
        - `crop` object
          - `x` number, required
          - `y` number, required
          - `width` number, required
          - `height` number, required
        - `url` string, nullable, required
      - `mentions` string[], required: Spacefast user ids this thread or reply @mentions.
    - `permalink` string, nullable, required
    - `dashboardUrl` string, uri, nullable, required: The thread in the dashboard, opened with the reader's own sign-in. Null without a team.
    - `createdAt` string, date-time, required: When the thread started. Never changes.
    - `lastActivityAt` string, date-time, required: When the latest message was posted. Resolving, reopening and reactions don't move it.
    - `updatedAt` string, date-time, nullable, required: When anything on the thread last changed. Lists are ordered by it.

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
