Resource Contributors
Manage contributors for marketplace resources. Contributors can help manage and update resources.
Base Endpoint
Section titled “Base Endpoint”All contributor endpoints are prefixed with /resources/:resourceId/contributors
Add Contributor
Section titled “Add Contributor”POST /resources/:resourceId/contributorsAdd a contributor to a resource.
Authentication: Required (must be resource owner)
URL Parameters:
resourceId(string) - Resource ID
Request Body:
{ "userId": "user-id-to-add", "role": "CONTRIBUTOR"}Contributor Roles:
CONTRIBUTOR- Can edit resource details and upload filesMAINTAINER- Can edit, upload, and manage other contributors
Response:
{ "id": "contributor-id", "userId": "user-id", "resourceId": "resource-id", "role": "CONTRIBUTOR", "user": { "id": "user-id", "username": "username", "displayName": "Display Name", "image": "https://..." }, "createdAt": "2024-01-01T00:00:00Z"}Get Contributors
Section titled “Get Contributors”GET /resources/:resourceId/contributorsGet all contributors for a resource.
Authentication: Required
URL Parameters:
resourceId(string) - Resource ID
Response:
{ "contributors": [ { "id": "contributor-id", "userId": "user-id", "role": "CONTRIBUTOR", "user": { "id": "user-id", "username": "username", "displayName": "Display Name", "image": "https://..." }, "createdAt": "2024-01-01T00:00:00Z" } ]}Update Contributor Role
Section titled “Update Contributor Role”PATCH /resources/:resourceId/contributors/:userIdUpdate a contributor’s role.
Authentication: Required (must be resource owner or maintainer)
URL Parameters:
resourceId(string) - Resource IDuserId(string) - Contributor user ID
Request Body:
{ "role": "MAINTAINER"}Response:
{ "id": "contributor-id", "role": "MAINTAINER", "updatedAt": "2024-01-01T00:00:00Z"}Remove Contributor
Section titled “Remove Contributor”DELETE /resources/:resourceId/contributors/:userIdRemove a contributor from a resource.
Authentication: Required (must be resource owner or maintainer)
URL Parameters:
resourceId(string) - Resource IDuserId(string) - Contributor user ID to remove
Response:
{ "message": "Contributor removed successfully"}