Space comments

Integrate and manage user comments in a space.

Comments are a powerful way to gather feedback on your documentation. Use this API to post, list, update, or delete comments and keep conversations organized.

The Comment object

Attributes
all ofoptional

The Comment object

{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "replies": 1,
  "body": {
    "markdown": "text"
  },
  "target": {
    "node": {
      "id": "text",
      "preview": "text"
    },
    "changeRequest": "text",
    "review": "text",
    "page": {
      "id": "text",
      "title": "text",
      "emoji": "🎉",
      "icon": "gear",
      "createdAt": "2025-04-12T21:04:01.285Z",
      "updatedAt": "2025-04-12T21:04:01.285Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-12T21:04:01.285Z",
  "resolvedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  }
}

List all space comments

get
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

Query parameters
pagestringoptional

Identifier of the page results to fetch.

limitnumber · max: 1000optional

The number of results per page

orderstring · enumoptional

An order for the items in the list

Default: descAvailable options:
statusstring · enumoptional

When provided, only comments with the given status are returned. Defaults to "all".

Default: allAvailable options:
formatstring · enumoptional

Output format for the content.

Available options:
targetPagestringoptional

The target page of the comment

Responses
curl -L \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "comment",
      "id": "text",
      "postedBy": {
        "object": "user",
        "id": "text",
        "displayName": "text",
        "email": "text",
        "photoURL": "text",
        "urls": {
          "location": "https://example.com"
        }
      },
      "postedAt": "2025-04-12T21:04:01.285Z",
      "editedAt": "2025-04-12T21:04:01.285Z",
      "reactions": [
        {
          "emoji": "text",
          "count": 1,
          "users": [
            {
              "user": {
                "object": "user",
                "id": "text",
                "displayName": "text",
                "email": "text",
                "photoURL": "text",
                "urls": {
                  "location": "https://example.com"
                }
              },
              "reactedAt": "2025-04-12T21:04:01.285Z"
            }
          ]
        }
      ],
      "replies": 1,
      "body": {
        "markdown": "text"
      },
      "target": {
        "node": {
          "id": "text",
          "preview": "text"
        },
        "changeRequest": "text",
        "review": "text",
        "page": {
          "id": "text",
          "title": "text",
          "emoji": "🎉",
          "icon": "gear",
          "createdAt": "2025-04-12T21:04:01.285Z",
          "updatedAt": "2025-04-12T21:04:01.285Z",
          "path": "text",
          "outdated": true
        },
        "space": "text",
        "revision": "text"
      },
      "urls": {
        "location": "https://example.com"
      },
      "status": "resolved",
      "resolvedAt": "2025-04-12T21:04:01.285Z",
      "resolvedBy": {
        "object": "user",
        "id": "text",
        "displayName": "text",
        "email": "text",
        "photoURL": "text",
        "urls": {
          "location": "https://example.com"
        }
      }
    }
  ]
}

Create a space comment

post
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

Body
nodestringoptional

The node to which the comment is posted, if any.

pagestringoptional

The page to which the comment is posted, if any.

bodyone ofrequired

The content of the comment.

Responses
curl -L \
  --request POST \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "node": "text",
    "page": "text",
    "body": {
      "markdown": "text"
    }
  }'
{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "replies": 1,
  "body": {
    "markdown": "text"
  },
  "target": {
    "node": {
      "id": "text",
      "preview": "text"
    },
    "changeRequest": "text",
    "review": "text",
    "page": {
      "id": "text",
      "title": "text",
      "emoji": "🎉",
      "icon": "gear",
      "createdAt": "2025-04-12T21:04:01.285Z",
      "updatedAt": "2025-04-12T21:04:01.285Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-12T21:04:01.285Z",
  "resolvedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  }
}

Get a space comment

get
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

Query parameters
formatstring · enumoptional

Output format for the content.

Available options:
Responses
curl -L \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "replies": 1,
  "body": {
    "markdown": "text"
  },
  "target": {
    "node": {
      "id": "text",
      "preview": "text"
    },
    "changeRequest": "text",
    "review": "text",
    "page": {
      "id": "text",
      "title": "text",
      "emoji": "🎉",
      "icon": "gear",
      "createdAt": "2025-04-12T21:04:01.285Z",
      "updatedAt": "2025-04-12T21:04:01.285Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-12T21:04:01.285Z",
  "resolvedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  }
}

Update a space comment

put
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

Body
resolvedbooleanoptional

Whether the comment is resolved or not.

bodyone ofoptional

Content of the comment.

addedReactionsstring[]optional

Reactions to add to the comment.

removedReactionsstring[]optional

Reactions to remove from the comment.

Responses
curl -L \
  --request PUT \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "resolved": true,
    "body": {
      "markdown": "text"
    },
    "addedReactions": [
      "text"
    ],
    "removedReactions": [
      "text"
    ]
  }'
{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "replies": 1,
  "body": {
    "markdown": "text"
  },
  "target": {
    "node": {
      "id": "text",
      "preview": "text"
    },
    "changeRequest": "text",
    "review": "text",
    "page": {
      "id": "text",
      "title": "text",
      "emoji": "🎉",
      "icon": "gear",
      "createdAt": "2025-04-12T21:04:01.285Z",
      "updatedAt": "2025-04-12T21:04:01.285Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-12T21:04:01.285Z",
  "resolvedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  }
}

Delete a space comment

delete
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

Responses
curl -L \
  --request DELETE \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

No Content

List all space comment replies

get
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

Query parameters
pagestringoptional

Identifier of the page results to fetch.

limitnumber · max: 1000optional

The number of results per page

formatstring · enumoptional

Output format for the content.

Available options:
Responses
curl -L \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}/replies' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "object": "comment-reply",
      "id": "text",
      "postedBy": {
        "object": "user",
        "id": "text",
        "displayName": "text",
        "email": "text",
        "photoURL": "text",
        "urls": {
          "location": "https://example.com"
        }
      },
      "postedAt": "2025-04-12T21:04:01.285Z",
      "editedAt": "2025-04-12T21:04:01.285Z",
      "reactions": [
        {
          "emoji": "text",
          "count": 1,
          "users": [
            {
              "user": {
                "object": "user",
                "id": "text",
                "displayName": "text",
                "email": "text",
                "photoURL": "text",
                "urls": {
                  "location": "https://example.com"
                }
              },
              "reactedAt": "2025-04-12T21:04:01.285Z"
            }
          ]
        }
      ],
      "body": {
        "markdown": "text"
      },
      "urls": {
        "location": "https://example.com"
      }
    }
  ]
}

Create a space comment reply

post
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

Body
bodyone ofrequired

The content of the comment.

Responses
curl -L \
  --request POST \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}/replies' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "body": {
      "markdown": "text"
    }
  }'
{
  "object": "comment-reply",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "body": {
    "markdown": "text"
  },
  "urls": {
    "location": "https://example.com"
  }
}

Get a space comment reply

get
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

commentReplyIdstringrequired

The unique id of the comment reply

Query parameters
formatstring · enumoptional

Output format for the content.

Available options:
Responses
curl -L \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "object": "comment-reply",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "body": {
    "markdown": "text"
  },
  "urls": {
    "location": "https://example.com"
  }
}

Update a space comment reply

put
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

commentReplyIdstringrequired

The unique id of the comment reply

Body
bodyone ofoptional

Content of the comment.

addedReactionsstring[]optional

Reactions to add to the comment.

removedReactionsstring[]optional

Reactions to remove from the comment.

Responses
curl -L \
  --request PUT \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "body": {
      "markdown": "text"
    },
    "addedReactions": [
      "text"
    ],
    "removedReactions": [
      "text"
    ]
  }'
{
  "object": "comment-reply",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-12T21:04:01.285Z",
  "editedAt": "2025-04-12T21:04:01.285Z",
  "reactions": [
    {
      "emoji": "text",
      "count": 1,
      "users": [
        {
          "user": {
            "object": "user",
            "id": "text",
            "displayName": "text",
            "email": "text",
            "photoURL": "text",
            "urls": {
              "location": "https://example.com"
            }
          },
          "reactedAt": "2025-04-12T21:04:01.285Z"
        }
      ]
    }
  ],
  "body": {
    "markdown": "text"
  },
  "urls": {
    "location": "https://example.com"
  }
}

Delete a space comment reply

delete
Authorizations
Path parameters
spaceIdstringrequired

The unique id of the space

commentIdstringrequired

The unique id of the comment

commentReplyIdstringrequired

The unique id of the comment reply

Responses
curl -L \
  --request DELETE \
  --url 'https://api.gitbook.com/v1/spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

No Content

Was this helpful?