Get a paginated list of conversations for a project, sorted by newest first. Only the project owner can access this endpoint.
- Conversations are sorted by
createdAtDESC (newest first). - Supports optional filtering by
status(ACTIVEorCLOSED). - The
messageCountfield is computed (not stored) — it reflects the total number of messages in the conversation. - The
updatedAtfield reflects the timestamp of the last message added to the conversation. - Only the owner of the project (tenant check) can list its conversations.
sequenceDiagram
actor User
User->>+FE: opens Conversations list for a project
FE->>+BE: GET /api/v1/projects/{projectId}/conversations <br> Authorization: Bearer {accessToken}
BE->>BE: validate access token
alt token missing or invalid
BE-->>FE: 401 Unauthorized <br> ErrorResponse
end
BE->>DB: load project by projectId
alt project not found
BE-->>FE: 404 Not Found <br> ErrorResponse
end
BE->>BE: check project belongs to user's tenant
alt project does not belong to tenant
BE-->>FE: 403 Forbidden <br> ErrorResponse
end
BE->>DB: query conversations for project (with optional status filter, paginated)
BE->>-FE: 200 OK <br> ConversationListResponse
FE->>-User: display conversations list
GET /api/v1/projects/{projectId}/conversations
Query parameters:
status(optional) — filter by status:ACTIVEorCLOSEDpage(optional, default 0) — zero-based page numbersize(optional, default 20) — page size
200 OK ConversationListResponse:
{
"data": {
"content": [
{
"id": 7,
"title": "Add a contact form to the homepage",
"status": "ACTIVE",
"messageCount": 5,
"createdAt": "2026-04-29T10:30:00Z",
"updatedAt": "2026-04-29T11:00:00Z"
},
{
"id": 3,
"title": "Change the color scheme to dark mode",
"status": "CLOSED",
"messageCount": 12,
"createdAt": "2026-04-28T09:00:00Z",
"updatedAt": "2026-04-28T10:15:00Z"
}
],
"page": 0,
"size": 20,
"totalElements": 2,
"totalPages": 1
}
}
401 Unauthorized (missing or invalid access token) ErrorResponse:
{
"status": 401,
"code": "AUTHENTICATION_FAILED",
"message": "Access token is missing or invalid"
}
403 Forbidden (project does not belong to user’s tenant) ErrorResponse:
{
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have access to this project"
}
404 Not Found (project not found) ErrorResponse:
{
"status": 404,
"code": "NOT_FOUND_PROJECT",
"message": "Project not found"
}
Frontend
Validations
| Field | Constraints | Size | Pattern | Note |
|---|---|---|---|---|
| status | (optional) | — | ACTIVE | CLOSED | Query parameter; if omitted, all conversations are returned |
Backend
Validations
| Field | Constraints | Size | Pattern | Note |
|---|---|---|---|---|
| projectId | not_null, positive | — | — | Path variable; must reference an existing project |
| status | (optional) | — | ACTIVE | CLOSED | Invalid enum value returns 400 VALIDATION_ERROR |
Test Cases
| GIVEN | WHEN | THEN |
|---|---|---|
| authenticated user, project with 2 conversations | GET /projects/{projectId}/conversations is called | 200 OK with paginated list of 2 conversations, sorted newest first |
| authenticated user, project with no conversations | GET /projects/{projectId}/conversations is called | 200 OK with empty content list |
| authenticated user, project with mixed statuses, status=ACTIVE filter | GET /projects/{projectId}/conversations?status=ACTIVE is called | 200 OK with only ACTIVE conversations |
| authenticated user, project with mixed statuses, status=CLOSED filter | GET /projects/{projectId}/conversations?status=CLOSED is called | 200 OK with only CLOSED conversations |
| authenticated user, project does not exist | GET /projects/{projectId}/conversations is called | 404 NOT_FOUND_PROJECT error response is returned |
| authenticated user, project belongs to a different tenant | GET /projects/{projectId}/conversations is called | 403 FORBIDDEN error response is returned |
| no Authorization header | GET /projects/{projectId}/conversations is called | 401 AUTHENTICATION_FAILED error response is returned |
| invalid status value (e.g., status=UNKNOWN) | GET /projects/{projectId}/conversations is called | 400 VALIDATION_ERROR error response is returned |
Was this page helpful?
Thanks for the feedback.