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-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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-19T20:05:01.179Z",
      "updatedAt": "2025-04-19T20:05:01.179Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-19T20:05:01.179Z",
  "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
application/json
all ofoptional
get
GET /v1/spaces/{spaceId}/comments HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "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-19T20:05:01.179Z",
      "editedAt": "2025-04-19T20:05:01.179Z",
      "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-19T20:05:01.179Z"
            }
          ]
        }
      ],
      "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-19T20:05:01.179Z",
          "updatedAt": "2025-04-19T20:05:01.179Z",
          "path": "text",
          "outdated": true
        },
        "space": "text",
        "revision": "text"
      },
      "urls": {
        "location": "https://example.com"
      },
      "status": "resolved",
      "resolvedAt": "2025-04-19T20:05:01.179Z",
      "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
application/json
all ofoptional
post
POST /v1/spaces/{spaceId}/comments HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 56

{
  "node": "text",
  "page": "text",
  "body": {
    "markdown": "text"
  }
}
200

The comment was posted.

{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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-19T20:05:01.179Z",
      "updatedAt": "2025-04-19T20:05:01.179Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-19T20:05:01.179Z",
  "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
application/json
all ofoptional
get
GET /v1/spaces/{spaceId}/comments/{commentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

The returned comment.

{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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-19T20:05:01.179Z",
      "updatedAt": "2025-04-19T20:05:01.179Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-19T20:05:01.179Z",
  "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
application/json
all ofoptional
put
PUT /v1/spaces/{spaceId}/comments/{commentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 98

{
  "resolved": true,
  "body": {
    "markdown": "text"
  },
  "addedReactions": [
    "text"
  ],
  "removedReactions": [
    "text"
  ]
}
200

The comment was updated.

{
  "object": "comment",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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-19T20:05:01.179Z",
      "updatedAt": "2025-04-19T20:05:01.179Z",
      "path": "text",
      "outdated": true
    },
    "space": "text",
    "revision": "text"
  },
  "urls": {
    "location": "https://example.com"
  },
  "status": "resolved",
  "resolvedAt": "2025-04-19T20:05:01.179Z",
  "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
delete
DELETE /v1/spaces/{spaceId}/comments/{commentId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
205

The comment has been deleted.

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
application/json
all ofoptional
get
GET /v1/spaces/{spaceId}/comments/{commentId}/replies HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "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-19T20:05:01.179Z",
      "editedAt": "2025-04-19T20:05:01.179Z",
      "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-19T20:05:01.179Z"
            }
          ]
        }
      ],
      "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
application/json
objectoptional
post
POST /v1/spaces/{spaceId}/comments/{commentId}/replies HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 28

{
  "body": {
    "markdown": "text"
  }
}
200

The reply was posted.

{
  "object": "comment-reply",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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
application/json
objectoptional
get
GET /v1/spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

The returned comment reply.

{
  "object": "comment-reply",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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
application/json
objectoptional
put
PUT /v1/spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 82

{
  "body": {
    "markdown": "text"
  },
  "addedReactions": [
    "text"
  ],
  "removedReactions": [
    "text"
  ]
}
200

The reply was updated.

{
  "object": "comment-reply",
  "id": "text",
  "postedBy": {
    "object": "user",
    "id": "text",
    "displayName": "text",
    "email": "text",
    "photoURL": "text",
    "urls": {
      "location": "https://example.com"
    }
  },
  "postedAt": "2025-04-19T20:05:01.179Z",
  "editedAt": "2025-04-19T20:05:01.179Z",
  "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-19T20:05:01.179Z"
        }
      ]
    }
  ],
  "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
delete
DELETE /v1/spaces/{spaceId}/comments/{commentId}/replies/{commentReplyId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
205

The comment has been deleted.

No Content

Was this helpful?