[bug]: Project member list API does not expose the membership ID required for retrieve/update/delete
Is there an existing issue for this?
- [x] I have searched the existing issues
Current behavior
The public REST API's project member list endpoints do not expose the project membership ID required by the detail endpoints.
GET /api/v1/workspaces/{slug}/projects/{project_id}/project-members/returns user profiles, whereidisUser.id.- The
/members/alias behaves the same way. GET /api/v1/workspaces/{slug}/projects/{project_id}/project-members-lite/also returns the user ID: its serializer explicitly mapsidtomember.id.- However,
GET,PATCH, andDELETEon/project-members/{id}/(and/members/{id}/) look upProjectMemberby its primary key, so they requireProjectMember.id, notUser.id.
As a result, a client cannot discover the membership ID for an existing project member through these public member list endpoints, and cannot use the returned user ID to retrieve, update, or remove that membership.
Creating a member with POST does return ProjectMember.id, but that does not solve discovery for existing memberships. The detail GET also returns a user profile rather than the ProjectMemberSerializer response declared in its OpenAPI annotation.
Steps to reproduce
- Use a project containing an existing member, with sufficient permissions to read and manage project members.
- Call
GET /api/v1/workspaces/{slug}/projects/{project_id}/project-members/. - Take the member's
idfrom the response. This is the user's UUID. - Call
GET /api/v1/workspaces/{slug}/projects/{project_id}/project-members/{returned_id}/, or attempt a role update withPATCHon that URL. - The backend searches for
ProjectMember.pk = returned_id, although the supplied ID identifies aUser. The intended membership cannot be resolved unless the two distinct record IDs happen to match. - Calling
project-members-lite/does not provide the missing membership ID either.
This report is based on source inspection; a live HTTP reproduction and its exact error status have not been verified.
Expected behavior
Public project member list responses should expose both the user ID and the membership ID, allowing clients to list existing members and then retrieve, update, or remove a selected membership.
One backward-compatible approach would be to keep the existing user id and add an explicit project_member_id field to both list endpoints. The detail GET response and its OpenAPI schema should also agree about the IDs and fields returned.
Source evidence
Inspected repository commit: 7466675e471efe1c96b122615f7a0d30c9b2eb05.
- List response, creation response, and detail lookup/response
- Membership serializer and lite serializer's user-ID mapping
- Public member routes and aliases
Related: #8631 requests public project membership mutation support. This report concerns the distinct ID mismatch/discovery problem in the existing endpoints.
Environment
Repository source inspection; deployment environment not specified.
Browser
Not applicable (REST API).
Edition
Community repository.
Version
Repository commit 7466675e471efe1c96b122615f7a0d30c9b2eb05; deployed version not specified.
Hi! I’d like to work on this issue.
I’ve reviewed the current public project-member API implementation and confirmed the ID mismatch between the list endpoints and the detail endpoints. I’ll prepare a focused fix that preserves the existing user id while exposing the corresponding project membership ID, and I’ll add contract tests covering the list/detail flow and both member endpoint variants.
I’ll keep the change scoped to this API contract issue.