list_project_comments

ArtificialIntelligenceApi.list_project_comments(project_id, role_id, offset=None, limit=None, sortorder=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

List comments on an AI project

Returns the comments left on an AI project, newest first, one page at a time. You need at least read-only access on the project. Comments are ordered by creation time; use sortorder to flip the direction.

Parameters:
  • project_id (str) – Identifier of the AI project whose comments you want to read. This is the ProjectId returned when the project was created. (required)

  • role_id (str) – Amorphic role used to authorize this request. (required)

  • offset (int) – 1-based index of the first comment to return. Defaults to 1. Keep it at or below total_count; a higher offset fails instead of returning an empty page.

  • limit (int) – Maximum number of comments to return in one page. Defaults to 20, and values above 5000 are rejected.

  • sortorder (str) – Order comments by creation time. Use asc for oldest first; desc, the default, returns newest first.

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

ProjectCommentsList

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /ai/projects/{project_id}/comments

Success (HTTP 200)

One page of comments for the project. Page through results by increasing `offset` by `limit` while `next_available` is the string “yes”, and stop when it is “no”. `next_available` is a string, not a boolean. `total_count` is the number of comments on the project, and `count` is how many came back on this page.

First page of comments

{
  "comments": [
    {
      "ProjectId": "7c3f21ab-4d5e-4a19-9b0c-2f8e6d1a4b73",
      "CommentId": "01JMB7YQ4K9V2XZ3T5R8W6N0AC",
      "CommentTime": "2026-02-25T12:30:45.123456+00:00",
      "Type": "warning",
      "Description": "The sales knowledge base behind this project is refreshed weekly, so answers can lag by a few days.",
      "Author": "priya"
    },
    {
      "ProjectId": "7c3f21ab-4d5e-4a19-9b0c-2f8e6d1a4b73",
      "CommentId": "01JM9T3B5H8Q7C2K4D6F0G1XYZ",
      "CommentTime": "2026-02-24T09:12:03.884210+00:00",
      "Type": "info",
      "Description": "Greeting text reviewed and approved by the customer support team.",
      "Author": "john"
    }
  ],
  "count": 2,
  "total_count": 7,
  "next_available": "yes"
}

Last page of comments

{
  "comments": [
    {
      "ProjectId": "7c3f21ab-4d5e-4a19-9b0c-2f8e6d1a4b73",
      "CommentId": "01JM4A0R2E9P6S3T8V5W7X0YZ1",
      "CommentTime": "2026-02-19T16:45:11.002930+00:00",
      "Type": "deprecation",
      "Description": "The legacy FAQ agent attached to this project will be retired next quarter.",
      "Author": "john"
    }
  ],
  "count": 1,
  "total_count": 7,
  "next_available": "no"
}

Project has no comments yet

{
  "comments": [],
  "count": 0,
  "total_count": 0,
  "next_available": "no"
}

Errors

Documented error codes: AUTH-1001, AUTH-1030, AUTH-1012, IPV-1045, GE-1008.

HTTP 400

The request was invalid or you do not have permission. The body is {“Message”: “<CODE> - <text>”}. Common cases include a missing role_id header (AUTH-1001), a role without the ai.view permission (AUTH-1030), no read-only access on the project (AUTH-1012), and a limit above 5000 (IPV-1045). A non-numeric offset or limit is rejected as an invalid input. Permission failures return 400, not 403.

Caller has no access to the project

{
  "Message": "AUTH-1012 - User: john.doe requires at least read-only access on the resource to perform this action."
}

Limit above the maximum

{
  "Message": "IPV-1045 - Invalid parameter - 6000, value either missing or is invalid."
}

Offset is not a number

{
  "Message": "Invalid input - invalid literal for int() with base 10 'abc'"
}

HTTP 500

An unexpected server error. The body is {“Message”: “<CODE> - <text>”}, normally GE-1008. An `offset` beyond `total_count` currently surfaces here rather than as a 400, so keep paging within the reported total.

Request / response example

{
  "Message": "GE-1008 - Could not complete the request. Please try again."
}