{
  "openapi": "3.0.2",
  "info": {
    "version": "28",
    "title": "Kiteworks API — comments Operations"
  },
  "paths": {
    "/rest/comments/{id}": {
      "get": {
        "tags": [
          "comments"
        ],
        "summary": "Get a comment",
        "description": "Returns the details of the specified comment, including the file it is attached to and the comment text. **Requires `comment_view` permission on the associated file.**",
        "responses": {
          "200": {
            "description": "Returns the comment record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                },
                "examples": {
                  "Comment": {
                    "summary": "A single comment record",
                    "value": {
                      "id": 201,
                      "parent_id": 0,
                      "object_id": 7,
                      "folder_id": 3,
                      "user_id": 5,
                      "created": "2024-03-15T10:00:00+00:00",
                      "modified": "2024-03-15T10:00:00+00:00",
                      "contents": "Please review section 3.",
                      "deleted": false,
                      "is_comment": true
                    }
                  }
                }
              }
            }
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "The unique identifier of the comment.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "with",
            "description": "With parameters",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "description": "Determines the detail level of the response body.",
            "schema": {
              "type": "string",
              "enum": [
                "full_with_links",
                "full",
                "compact"
              ]
            }
          }
        ],
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X GET \\\n  \"https://{instance}.kiteworks.com/rest/comments/:id\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\""
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nid = \"VALUE\"  # The unique identifier of the comment.\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/comments/{id}\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n}\nresponse = requests.get(url, headers=headers)\nprint(response.json())"
          }
        ]
      },
      "put": {
        "tags": [
          "comments"
        ],
        "summary": "Update a comment",
        "description": "Updates the text of the specified comment. **Requires `comment_edit` permission on the associated file.** Only the comment author or a folder manager may update the comment.",
        "responses": {
          "200": {
            "description": "Returns the updated comment record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                },
                "examples": {
                  "Comment updated": {
                    "summary": "An updated comment",
                    "value": {
                      "id": 201,
                      "parent_id": 0,
                      "object_id": 7,
                      "folder_id": 3,
                      "user_id": 5,
                      "created": "2024-03-15T10:00:00+00:00",
                      "modified": "2024-03-16T08:00:00+00:00",
                      "contents": "Please review section 3 and section 4.",
                      "deleted": false,
                      "is_comment": true
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content<br /><br /><i>Possible error codes: </i>ERR_INPUT_MAX_VALUE, ERR_INPUT_HTML_TAGS_INVALID, ERR_INPUT_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                },
                "examples": {
                  "ERR_INPUT_HTML_TAGS_INVALID": {
                    "summary": "Cannot contain HTML tags other than B, I, or U",
                    "description": "Cannot contain HTML tags other than B, I, or U",
                    "value": {
                      "errors": {
                        "code": "ERR_INPUT_HTML_TAGS_INVALID",
                        "message": "Cannot contain HTML tags other than B, I, or U"
                      }
                    }
                  },
                  "ERR_INPUT_REQUIRED": {
                    "summary": "Field is required",
                    "description": "Field is required",
                    "value": {
                      "errors": {
                        "code": "ERR_INPUT_REQUIRED",
                        "message": "Field is required"
                      }
                    }
                  }
                }
              }
            }
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "The unique identifier of the comment.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Comment.Put"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X PUT \\\n  \"https://{instance}.kiteworks.com/rest/comments/:id\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n         \"contents\": \"string\",\n         \"addLinks\": true\n       }'"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nid = \"VALUE\"  # The unique identifier of the comment.\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/comments/{id}\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n    \"Content-Type\": \"application/json\",\n}\npayload = {\n  \"contents\": \"string\",\n  \"addLinks\": true\n}\nresponse = requests.put(url, headers=headers, json=payload)\nprint(response.json())"
          }
        ]
      },
      "delete": {
        "tags": [
          "comments"
        ],
        "summary": "Delete a comment",
        "description": "Deletes the specified comment. **Requires `comment_delete` permission on the associated file.** Only the comment author or a folder manager may delete the comment.",
        "responses": {
          "204": {
            "description": "The comment was successfully deleted. Returns no content."
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "The unique identifier of the comment.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X DELETE \\\n  \"https://{instance}.kiteworks.com/rest/comments/:id\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\""
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nid = \"VALUE\"  # The unique identifier of the comment.\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/comments/{id}\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n}\nresponse = requests.delete(url, headers=headers)\nprint(response.json())"
          }
        ]
      }
    },
    "/rest/files/{id}/comments": {
      "get": {
        "tags": [
          "comments",
          "files"
        ],
        "summary": "Get file comments",
        "description": "Returns a list of comments on the specified file. **Requires `comment_view` permission on the file.**",
        "responses": {
          "200": {
            "description": "Returns a paginated list of comments for the specified file.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Comment"
                      }
                    },
                    "metadata": {
                      "$ref": "#/components/schemas/MetaData"
                    }
                  }
                },
                "examples": {
                  "File comment list": {
                    "summary": "Two comments on a file",
                    "value": {
                      "data": [
                        {
                          "id": 201,
                          "parent_id": 0,
                          "object_id": 7,
                          "folder_id": 3,
                          "user_id": 5,
                          "created": "2024-03-15T10:00:00+00:00",
                          "modified": "2024-03-15T10:00:00+00:00",
                          "contents": "Please review section 3.",
                          "deleted": false,
                          "is_comment": true
                        },
                        {
                          "id": 202,
                          "parent_id": 201,
                          "object_id": 7,
                          "folder_id": 3,
                          "user_id": 3,
                          "created": "2024-03-15T11:00:00+00:00",
                          "modified": "2024-03-15T11:00:00+00:00",
                          "contents": "Done, updated section 3.",
                          "deleted": false,
                          "is_comment": true
                        }
                      ],
                      "total": 2,
                      "page": 1,
                      "pageSize": 20
                    }
                  }
                }
              }
            }
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "The unique identifier (UUID) of the file.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "parentId",
            "description": "Unique identifier of the parent comment",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "parentId:in",
            "description": "Unique identifier of the parent comment. Search for results that match any of the specified values for this parameter.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "userId",
            "description": "Unique identifier of the comment author",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userId:in",
            "description": "Unique identifier of the comment author. Search for results that match any of the specified values for this parameter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created",
            "description": "The creation date of the comment.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:gt",
            "description": "The creation date of the comment.. Search for results where this parameter value is greater than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:gte",
            "description": "The creation date of the comment.. Search for results where this parameter value is greater than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:lt",
            "description": "The creation date of the comment.. Search for results where this parameter value is less than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:lte",
            "description": "The creation date of the comment.. Search for results where this parameter value is less than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified",
            "description": "The last modification date of the comment.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:gt",
            "description": "The last modification date of the comment.. Search for results where this parameter value is greater than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:gte",
            "description": "The last modification date of the comment.. Search for results where this parameter value is greater than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:lt",
            "description": "The last modification date of the comment.. Search for results where this parameter value is less than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:lte",
            "description": "The last modification date of the comment.. Search for results where this parameter value is less than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "contents:contains",
            "description": "Content of the comment. Search for results that contain the specified characters in this parameter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "orderBy",
            "description": "Sorting options",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "enum": [
                "id:asc",
                "id:desc",
                "created:asc",
                "created:desc",
                "modified:asc",
                "modified:desc",
                "parentId:asc",
                "parentId:desc"
              ]
            }
          },
          {
            "in": "query",
            "name": "offset",
            "description": "Offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "with",
            "description": "With parameters",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "description": "Determines the detail level of the response body.",
            "schema": {
              "type": "string",
              "enum": [
                "full_with_links",
                "full",
                "compact"
              ]
            }
          }
        ],
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X GET \\\n  \"https://{instance}.kiteworks.com/rest/files/:id/comments\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\""
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nid = \"VALUE\"  # The unique identifier (UUID) of the file.\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/files/{id}/comments\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n}\nresponse = requests.get(url, headers=headers)\nprint(response.json())"
          }
        ]
      },
      "post": {
        "tags": [
          "comments",
          "files"
        ],
        "summary": "Add file comment",
        "description": "Adds a comment to the specified file. To reply to an existing comment, include a `parentId` in the request body. **Requires `comment_add` permission on the file.**",
        "responses": {
          "200": {
            "description": "Returns the newly created comment record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                },
                "examples": {
                  "Comment created": {
                    "summary": "A newly created comment on a file",
                    "value": {
                      "id": 203,
                      "parent_id": 0,
                      "object_id": 7,
                      "folder_id": 3,
                      "user_id": 5,
                      "created": "2024-03-16T09:00:00+00:00",
                      "modified": "2024-03-16T09:00:00+00:00",
                      "contents": "Looks good to me.",
                      "deleted": false,
                      "is_comment": true
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden<br /><br /><i>Possible error codes: </i>ERR_ACCESS_USER",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                },
                "examples": {
                  "ERR_ACCESS_USER": {
                    "summary": "Insufficient access permissions",
                    "description": "Insufficient access permissions",
                    "value": {
                      "errors": {
                        "code": "ERR_ACCESS_USER",
                        "message": "Insufficient access permissions"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content<br /><br /><i>Possible error codes: </i>ERR_INPUT_MAX_VALUE, ERR_INPUT_HTML_TAGS_INVALID, ERR_INPUT_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Errors"
                },
                "examples": {
                  "ERR_INPUT_HTML_TAGS_INVALID": {
                    "summary": "Cannot contain HTML tags other than B, I, or U",
                    "description": "Cannot contain HTML tags other than B, I, or U",
                    "value": {
                      "errors": {
                        "code": "ERR_INPUT_HTML_TAGS_INVALID",
                        "message": "Cannot contain HTML tags other than B, I, or U"
                      }
                    }
                  },
                  "ERR_INPUT_REQUIRED": {
                    "summary": "Field is required",
                    "description": "Field is required",
                    "value": {
                      "errors": {
                        "code": "ERR_INPUT_REQUIRED",
                        "message": "Field is required"
                      }
                    }
                  }
                }
              }
            }
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "The unique identifier (UUID) of the file.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "returnEntity",
            "description": "If set to `true`, returns information about the newly created entity.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "description": "Determines the detail level of the response body.",
            "schema": {
              "type": "string",
              "enum": [
                "full_with_links",
                "full"
              ]
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Comment.Post"
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X POST \\\n  \"https://{instance}.kiteworks.com/rest/files/:id/comments\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n         \"parentId\": 1,\n         \"contents\": \"string\",\n         \"addLinks\": true\n       }'"
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nid = \"VALUE\"  # The unique identifier (UUID) of the file.\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/files/{id}/comments\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n    \"Content-Type\": \"application/json\",\n}\npayload = {\n  \"parentId\": 1,\n  \"contents\": \"string\",\n  \"addLinks\": true\n}\nresponse = requests.post(url, headers=headers, json=payload)\nprint(response.json())"
          }
        ]
      }
    },
    "/rest/folders/{id}/comments": {
      "get": {
        "tags": [
          "comments",
          "folders"
        ],
        "summary": "List comments for the folder",
        "description": "Returns all comments on files within the specified folder. **Requires `comment_view` permission on the folder.**",
        "responses": {
          "200": {
            "description": "Returns a paginated list of comments for files within the specified folder.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Comment"
                      }
                    },
                    "metadata": {
                      "$ref": "#/components/schemas/MetaData"
                    }
                  }
                },
                "examples": {
                  "Folder comment list": {
                    "summary": "Two comments on files in a folder",
                    "value": {
                      "data": [
                        {
                          "id": 201,
                          "parent_id": 0,
                          "object_id": 7,
                          "folder_id": 3,
                          "user_id": 5,
                          "created": "2024-03-15T10:00:00+00:00",
                          "modified": "2024-03-15T10:00:00+00:00",
                          "contents": "Please review section 3.",
                          "deleted": false,
                          "is_comment": true
                        },
                        {
                          "id": 202,
                          "parent_id": 201,
                          "object_id": 7,
                          "folder_id": 3,
                          "user_id": 3,
                          "created": "2024-03-15T11:00:00+00:00",
                          "modified": "2024-03-15T11:00:00+00:00",
                          "contents": "Done, updated section 3.",
                          "deleted": false,
                          "is_comment": true
                        }
                      ],
                      "total": 2,
                      "page": 1,
                      "pageSize": 20
                    }
                  }
                }
              }
            }
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "description": "The unique identifier (UUID) of the folder.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "parentId",
            "description": "Unique identifier of the parent comment",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "parentId:in",
            "description": "Unique identifier of the parent comment. Search for results that match any of the specified values for this parameter.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "userId",
            "description": "Unique identifier of the comment author",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "userId:in",
            "description": "Unique identifier of the comment author. Search for results that match any of the specified values for this parameter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "created",
            "description": "The creation date of the comment.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:gt",
            "description": "The creation date of the comment.. Search for results where this parameter value is greater than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:gte",
            "description": "The creation date of the comment.. Search for results where this parameter value is greater than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:lt",
            "description": "The creation date of the comment.. Search for results where this parameter value is less than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "created:lte",
            "description": "The creation date of the comment.. Search for results where this parameter value is less than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified",
            "description": "The last modification date of the comment.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:gt",
            "description": "The last modification date of the comment.. Search for results where this parameter value is greater than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:gte",
            "description": "The last modification date of the comment.. Search for results where this parameter value is greater than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:lt",
            "description": "The last modification date of the comment.. Search for results where this parameter value is less than the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "modified:lte",
            "description": "The last modification date of the comment.. Search for results where this parameter value is less than or equal to the specified value.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "contents:contains",
            "description": "Content of the comment. Search for results that contain the specified characters in this parameter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "orderBy",
            "description": "Sorting options",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "enum": [
                "id:asc",
                "id:desc",
                "created:asc",
                "created:desc",
                "modified:asc",
                "modified:desc",
                "parentId:asc",
                "parentId:desc"
              ]
            }
          },
          {
            "in": "query",
            "name": "offset",
            "description": "Offset",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "description": "Limit",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "with",
            "description": "With parameters",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "description": "Determines the detail level of the response body.",
            "schema": {
              "type": "string",
              "enum": [
                "full_with_links",
                "full",
                "compact"
              ]
            }
          }
        ],
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X GET \\\n  \"https://{instance}.kiteworks.com/rest/folders/:id/comments\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\""
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\nid = \"VALUE\"  # The unique identifier (UUID) of the folder.\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/folders/{id}/comments\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n}\nresponse = requests.get(url, headers=headers)\nprint(response.json())"
          }
        ]
      }
    },
    "/rest/permissions/comment/{comment_id}": {
      "get": {
        "tags": [
          "comments",
          "permissions"
        ],
        "summary": "Return the list of permissions available on a comment",
        "description": "Returns the list of actions the current user is allowed to perform on the specified comment, such as editing or deleting it.",
        "responses": {
          "200": {
            "description": "Comment permissions retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Permission"
                      }
                    }
                  }
                },
                "examples": {
                  "CommentPermissions": {
                    "summary": "Permissions available on a comment",
                    "value": {
                      "data": [
                        {
                          "id": "COMMENT_EDIT",
                          "name": "Edit Comment",
                          "allowed": true
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "490": {
            "description": "Request blocked by WAF"
          }
        },
        "deprecated": false,
        "parameters": [
          {
            "in": "path",
            "name": "comment_id",
            "description": "ID of the comment",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "id",
            "description": "Unique action identifier",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "id:in",
            "description": "Unique action identifier. Search for results that match any of the specified values for this parameter.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "name",
            "description": "Action name",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "name:contains",
            "description": "Action name. Search for results that contain the specified characters in this parameter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "allowed",
            "description": "Determines if one has permissions to perform action",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "enabled",
            "description": "Determines if the given action is available considering the current object state (locked, deleted, etc.).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "with",
            "description": "With parameters",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "mode",
            "description": "Determines the detail level of the response body.",
            "schema": {
              "type": "string",
              "enum": [
                "full_with_links",
                "full",
                "compact"
              ]
            }
          }
        ],
        "x-codeSamples": [
          {
            "lang": "Shell",
            "label": "cURL",
            "source": "curl -X GET \\\n  \"https://{instance}.kiteworks.com/rest/permissions/comment/:comment_id\" \\\n  -H \"Authorization: Bearer YOUR_TOKEN\""
          },
          {
            "lang": "Python",
            "label": "Python",
            "source": "import requests\n\ncomment_id = \"VALUE\"  # ID of the comment\n\nurl = f\"https://{{instance}}.kiteworks.com/rest/permissions/comment/{comment_id}\"\nheaders = {\n    \"Authorization\": \"Bearer YOUR_TOKEN\",\n}\nresponse = requests.get(url, headers=headers)\nprint(response.json())"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Comment": {
        "description": "Class Comment",
        "required": [
          "contents",
          "id",
          "objectId",
          "parentId",
          "userId"
        ],
        "properties": {
          "id": {
            "description": "Comment unique identifier",
            "type": "integer"
          },
          "parentId": {
            "description": "Unique identifier of the parent comment, if the comment is a reply",
            "type": "integer"
          },
          "objectId": {
            "description": "Unique identifier (UUID) of the file being commented on",
            "type": "string"
          },
          "folderId": {
            "description": "Unique identifier (UUID) of the folder containing the object being commented on",
            "type": "string"
          },
          "userId": {
            "description": "Unique identifier (UUID) of the user who authored the comment",
            "type": "string"
          },
          "created": {
            "description": "Date and time when the comment was created",
            "type": "string",
            "format": "date"
          },
          "modified": {
            "description": "Date and time when the comment was last modified",
            "type": "string",
            "format": "date"
          },
          "contents": {
            "description": "Text content of the comment",
            "type": "string"
          },
          "deleted": {
            "description": "Indicates whether the comment has been deleted",
            "type": "boolean"
          },
          "isComment": {
            "description": "Indicates whether the item is a comment",
            "type": "boolean"
          },
          "object": {
            "description": "File being commented on (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "$ref": "#/components/schemas/BaseObject"
          },
          "author": {
            "description": "Author of the comment (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "$ref": "#/components/schemas/UserBasicInfo"
          },
          "parent": {
            "description": "The comment this reply is responding to, if applicable (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "$ref": "#/components/schemas/Comment"
          },
          "permissions": {
            "description": "Permissions of the current user regarding the comment (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            }
          },
          "links": {
            "description": "HATEOAS links associated with the entity",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "Errors": {
        "type": "object",
        "properties": {
          "error": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Comment.Put": {
        "description": "Class Comment",
        "required": [
          "contents"
        ],
        "properties": {
          "contents": {
            "description": "Text content of the comment",
            "type": "string"
          },
          "addLinks": {
            "description": "Indicates whether HATEOAS links should be included in the response",
            "type": "boolean"
          }
        }
      },
      "MetaData": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of items available."
          },
          "limit": {
            "type": "integer",
            "description": "Maximum number of items returned per page."
          },
          "offset": {
            "type": "integer",
            "description": "Number of items skipped before the current page."
          }
        }
      },
      "Comment.Post": {
        "description": "Class Comment",
        "required": [
          "contents"
        ],
        "properties": {
          "parentId": {
            "description": "Unique identifier of the parent comment. Set this value when replying to an existing comment",
            "type": "integer"
          },
          "contents": {
            "description": "Text content of the comment",
            "type": "string"
          },
          "addLinks": {
            "description": "Indicates whether HATEOAS links should be included in the response",
            "type": "boolean"
          }
        }
      },
      "Permission": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the permission."
          },
          "name": {
            "type": "string",
            "description": "Name of the permission."
          },
          "allowed": {
            "type": "boolean",
            "description": "Indicates whether the permission is granted (True) or denied (False)."
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Error code"
          },
          "message": {
            "type": "string",
            "description": "Error message"
          }
        }
      },
      "BaseObject": {
        "description": "Class Object",
        "required": [
          "id",
          "name",
          "parentId",
          "userId"
        ],
        "properties": {
          "id": {
            "description": "Unique identifier of object",
            "type": "string"
          },
          "created": {
            "description": "Date and time when the object was created",
            "type": "string",
            "format": "date-time"
          },
          "deleted": {
            "description": "Indicates whether the object is deleted",
            "type": "boolean"
          },
          "permDeleted": {
            "description": "Indicates whether the object is permanently deleted",
            "type": "boolean"
          },
          "expire": {
            "description": "Date and time when the object expires and becomes inaccessible",
            "type": "string",
            "format": "date-time"
          },
          "modified": {
            "description": "Date and time when the object was last modified",
            "type": "string",
            "format": "date-time"
          },
          "name": {
            "description": "Display name of the object",
            "type": "string"
          },
          "parentId": {
            "description": "Parent Folder identifier",
            "type": "string"
          },
          "userId": {
            "description": "Unique identifier of Object creator",
            "type": "string"
          },
          "parent": {
            "description": "Folder that directly contains this object (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "$ref": "#/components/schemas/Folder"
          },
          "permalink": {
            "description": "Permanent URL for accessing the object in the web application",
            "type": "string"
          },
          "creator": {
            "description": "Basic profile information of the user who created the object (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "$ref": "#/components/schemas/UserBasicInfo"
          },
          "permissions": {
            "description": "Current user's permissions (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            }
          },
          "vendorDocId": {
            "description": "Identifier of the corresponding document in the external vendor system (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "type": "string"
          },
          "vendorDocName": {
            "description": "Display name of the corresponding document in the external vendor system (Explicit field. May be retrieved only if mentioned in \"with\" parameter)",
            "type": "string"
          },
          "source": {
            "description": "Numeric code identifying the external system that originated this object (e.g. Salesforce, Teams)",
            "type": "integer"
          },
          "links": {
            "description": "HATEOAS links associated with the entity",
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserBasicInfo": {
        "required": [
          "email",
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "description": "The unique identifier of the user",
            "type": "string"
          },
          "name": {
            "description": "The name of the user",
            "type": "string"
          },
          "email": {
            "description": "The user's email",
            "type": "string"
          },
          "profileIcon": {
            "description": "URL to the user's profile icon image",
            "type": "string"
          }
        }
      },
      "Folder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier (UUID) of the folder."
          },
          "parentId": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier (UUID) of the parent object."
          },
          "name": {
            "type": "string",
            "description": "Name of the object."
          },
          "type": {
            "type": "string",
            "description": "Type of the object.<br>`f` – File.<br>`d` – Folder."
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "description": "Unique identifier (UUID) who created the folder."
          },
          "creator": {
            "description": "Details of the user who created the object.",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserBasic"
              }
            ]
          },
          "created": {
            "type": "string",
            "format": "date",
            "description": "The date and time when the object was created."
          },
          "modified": {
            "type": "string",
            "format": "date",
            "description": "The date and time when the object was last modified."
          },
          "expire": {
            "type": "string",
            "format": "date",
            "description": "Expiration timestamp of the object, if applicable."
          },
          "permissions": {
            "description": "List of permissions associated with the object.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Permission"
            }
          },
          "deleted": {
            "type": "boolean",
            "description": "Indicates whether the object has been deleted."
          },
          "permDeleted": {
            "type": "boolean",
            "description": "Indicates whether the object has been permanently deleted."
          },
          "permalink": {
            "type": "string",
            "description": "Permanent URL link to access the object."
          },
          "path": {
            "type": "string",
            "description": "Path to the folder in the hierarchy."
          },
          "members": {
            "description": "List of members who have access to the object.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            }
          },
          "vendorDocId": {
            "type": "string",
            "description": "Vendor document ID associated with the object."
          },
          "vendorDocName": {
            "type": "string",
            "description": "Name of the vendor document associated with the object."
          },
          "secure": {
            "type": "boolean",
            "description": "Indicates whether the folder or the parent folder containing the file is marked as secure."
          },
          "source": {
            "type": "integer",
            "description": "ID representing the source of the object (1 - Salesforce, 2 - Teams)."
          },
          "isShared": {
            "type": "boolean",
            "description": "Indicates if the folder is shared with other users."
          },
          "syncable": {
            "type": "boolean",
            "description": "Indicates if the folder can be synced by Desktop Sync Client."
          },
          "fileLifetime": {
            "type": "integer",
            "description": "Time duration (in days) for which the files in this folder are kept after being added to the folder."
          },
          "description": {
            "type": "string",
            "description": "The description of the folder."
          },
          "isFavorite": {
            "type": "boolean",
            "description": "Indicates if the folder is marked as a favorite by the user."
          },
          "pushedFilesCount": {
            "type": "integer",
            "description": "The number of files that have been pushed to mobile apps in this folder."
          },
          "currentUserRole": {
            "description": "The role of the current user in this folder.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Role"
              }
            ]
          },
          "avStatus": {
            "type": "string",
            "description": "The Antivirus (AV) status of the folder."
          },
          "dlpStatus": {
            "type": "string",
            "description": "The Data Loss Prevention (DLP) status of the folder."
          },
          "totalMembersCount": {
            "type": "integer",
            "description": "Total number of members who have access to this folder."
          },
          "totalFoldersCount": {
            "type": "integer",
            "description": "Total number of subfolders within this folder."
          },
          "totalFilesCount": {
            "type": "integer",
            "description": "Total number of files within this folder."
          },
          "maxFolderExpiration": {
            "type": "string",
            "format": "date",
            "description": "The maximum expiration date allowed for files in this folder."
          },
          "maxFileLifetime": {
            "type": "integer",
            "description": "The maximum duration (in days) that files in this folder can be kept after being added to the folder."
          },
          "isLdapGroupMember": {
            "type": "boolean",
            "description": "Indicates if the folder is part of an LDAP group."
          },
          "isUnderMyFolder": {
            "type": "boolean",
            "description": "Indicates if this folder is a subfolder of the user's \"My Folder\"."
          },
          "pathIds": {
            "type": "string",
            "description": "A list of IDs representing the path of the folder within the folder hierarchy."
          },
          "isRoot": {
            "type": "boolean",
            "description": "Indicates if this folder is a root folder."
          },
          "rootId": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the root folder if this is a subfolder."
          },
          "useFolderQuota": {
            "type": "boolean",
            "description": "Indicates if a folder quota is applied to this folder."
          },
          "quota": {
            "type": "integer",
            "description": "The storage quota for the folder (in bytes)."
          },
          "size": {
            "type": "integer",
            "description": "The total storage size used by the folder (in bytes)."
          },
          "freeSpace": {
            "type": "integer",
            "description": "The amount of free space available in the folder (in bytes)."
          },
          "inheritanceEnabled": {
            "type": "boolean",
            "description": "Indicates if a folder inherits permissions from the parent folder"
          }
        }
      },
      "UserBasic": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier (UUID) for the user."
          },
          "email": {
            "type": "string",
            "description": "Email address associated with the user."
          },
          "name": {
            "type": "string",
            "description": "Full name of the user."
          },
          "profileIcon": {
            "type": "string",
            "description": "URL or identifier for the user's profile icon."
          }
        }
      },
      "Member": {
        "type": "object",
        "properties": {
          "objectId": {
            "type": "string",
            "description": "Unique identifier (UUID) of the associated object (file or folder)."
          },
          "roleId": {
            "type": "integer",
            "description": "Role assigned to the member."
          },
          "userId": {
            "type": "string",
            "description": "Unique identifier (UUID) of the user."
          },
          "groupId": {
            "type": "integer",
            "description": "Unique identifier of the LDAP group."
          },
          "user": {
            "description": "User details of the member.",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserBasic"
              }
            ]
          },
          "role": {
            "description": "Role details assigned to the member.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Role"
              }
            ]
          },
          "group": {
            "description": "Group details if the member belongs to a group.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Group"
              }
            ]
          },
          "sharedBy": {
            "description": "Details of the user who shared the file or folder.",
            "allOf": [
              {
                "$ref": "#/components/schemas/UserBasic"
              }
            ]
          },
          "created": {
            "type": "string",
            "format": "date",
            "description": "Date when the file or folder was shared."
          },
          "inheritRoleId": {
            "type": "integer",
            "description": "Inherited role ID from the parent folder, if applicable."
          },
          "allowedFolderRoleId": {
            "type": "array",
            "description": "List of allowed folder role IDs.",
            "items": {
              "type": "integer"
            }
          },
          "email": {
            "type": "string",
            "description": "Email associated with the member."
          },
          "rank": {
            "type": "integer",
            "description": "Rank of the member role."
          },
          "originFolder": {
            "readOnly": true
          }
        }
      },
      "Role": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Role ID"
          },
          "name": {
            "type": "string",
            "description": "Role name"
          },
          "rank": {
            "type": "integer",
            "description": "Role rank"
          },
          "type": {
            "type": "string",
            "description": "Role type"
          }
        }
      },
      "Group": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "LDAP Group ID"
          },
          "name": {
            "type": "string",
            "description": "LDAP Group name"
          },
          "dn": {
            "type": "string",
            "description": "LDAP Group domain name"
          },
          "email": {
            "type": "string",
            "description": "LDAP Group email"
          },
          "description": {
            "type": "string",
            "description": "LDAP Group description"
          }
        }
      }
    }
  }
}
