Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2719,6 +2719,56 @@ Example of a comment object
}
```

### Get Project Comments

Get comment threads of a project. Returns up to 1000 comment threads per request. Use `offset` for pagination.

```python
comment_threads = client.get_project_comments(project="YOUR_PROJECT_SLUG")
```

#### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| project | str | Yes | Project slug |
| status | str | No | Filter by task status |
| external_status | str | No | Filter by task external status |
| tags | list | No | Filter by task tags |
| issue_category_id | str | No | Filter by issue category ID |
| offset | int | No | Offset for pagination |
| limit | int | No | Number of comment threads to retrieve (default: 100, max: 1000) |

#### Response

Example of a comment thread object

```python
{
"id": "YOUR_THREAD_ID",
"text": "comment text",
"comment": {
"id": "YOUR_COMMENT_ID",
"taskId": "YOUR_TASK_ID",
"contentId": "YOUR_CONTENT_ID",
"type": "text",
"isResolved": False,
"points": [185.98, 86.55],
"scale": 0,
"frame": 0,
"status": "todo",
"priority": 0,
"taskAnnotationId": None,
"issueCategoryId": None,
"color": None,
"createdAt": "2026-03-03T03:51:55.240Z",
"updatedAt": "2026-03-03T03:51:55.240Z",
},
"createdAt": "2026-03-03T03:51:55.247Z",
"updatedAt": "2026-03-03T03:51:55.247Z",
}
```

## Project

### Create Project
Expand Down
8 changes: 8 additions & 0 deletions examples/get_project_comments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from pprint import pprint

import fastlabel

client = fastlabel.Client()

comment_threads = client.get_project_comments(project="YOUR_PROJECT_SLUG")
pprint(comment_threads)
36 changes: 32 additions & 4 deletions fastlabel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5248,12 +5248,40 @@ def get_task_comments(
"Limit must be less than or equal to 1000.", 422
)
endpoint = "comments"
params = {"project": project, "taskId": task_id}
if offset is not None:
params["offset"] = offset
if limit is not None:
params["limit"] = limit
return self.api.get_request(endpoint, params=params)

def get_project_comments(
self,
project: str,
status: str = None,
external_status: str = None,
tags: list = None,
issue_category_id: str = None,
offset: int = None,
limit: int = 100,
) -> list:
if limit > 1000:
raise FastLabelInvalidException(
"Limit must be less than or equal to 1000.", 422
)
endpoint = "comments/threads"
params = {"project": project}
if task_id:
params["taskId"] = task_id
if offset:
if status:
params["taskStatus"] = status
if external_status:
params["taskExternalStatus"] = external_status
if tags:
params["taskTags"] = tags
if issue_category_id:
params["issueCategoryId"] = issue_category_id
if offset is not None:
params["offset"] = offset
if limit:
if limit is not None:
params["limit"] = limit
return self.api.get_request(endpoint, params=params)

Expand Down
Loading