Skip to content

Resource Contributors

Manage contributors for marketplace resources. Contributors can help manage and update resources.

All contributor endpoints are prefixed with /resources/:resourceId/contributors


POST /resources/:resourceId/contributors

Add 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 files
  • MAINTAINER - 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 /resources/:resourceId/contributors

Get 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"
}
]
}

PATCH /resources/:resourceId/contributors/:userId

Update a contributor’s role.

Authentication: Required (must be resource owner or maintainer)

URL Parameters:

  • resourceId (string) - Resource ID
  • userId (string) - Contributor user ID

Request Body:

{
"role": "MAINTAINER"
}

Response:

{
"id": "contributor-id",
"role": "MAINTAINER",
"updatedAt": "2024-01-01T00:00:00Z"
}

DELETE /resources/:resourceId/contributors/:userId

Remove a contributor from a resource.

Authentication: Required (must be resource owner or maintainer)

URL Parameters:

  • resourceId (string) - Resource ID
  • userId (string) - Contributor user ID to remove

Response:

{
"message": "Contributor removed successfully"
}