Repository Collaborator

Repository Collaborator is the link object between Repositories and Collaborators. With them, you define who belongs to what repository, and what they can do in the repository.

Attributes

repository

The ID of the repository that the membership is meant for. When requesting, can be expanded to the full repository object by including the query parameter expand=repository.

  • Type: string
  • Required: true

collaborator

The ID of the collaborator that the membership is meant for. When requesting, can be expanded to the full collaborator object by including the query parameter expand=collaborator.

  • Type: string
  • Required: true

role

The role that the collaborator has directly in the repository. Must be one of admin, master, developer, or guest.

  • Type: string
  • Required: true

highest_role

The highest role the collaborator has in the repository. This field is automatically updated.

  • Type: string

Operations

GET /projects/:project_id/repositories/:repository_id/repository_collaborators

Lists all repository collaborators for a repository, with optional limit and offset parameters, as a metadata-results object.

GET /projects/:project_id/repositories/:repository_id/repository_collaborators/:collaborator_id

Returns a specific repository collaborator.

Example request

curl -X GET \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_collaborators/janedoe

Example response

{
"api_status": 200,
"api_timestamp": "2018-10-25T09:29:37Z",
"repository": {
"id": "acme"
},
"collaborator": {
"id": "janedoe"
},
"role": "developer",
"highest_role": "admin"
}

POST /projects/:project_id/repositories/:repository_id/repository_collaborators

Adds a repository collaborator for a repository. The collaborator must have a project role before a repository role can be defined.

Example request

curl -X POST \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
-H "Content-Type: application/json" \
-d '{ "repository_collaborator": { "id": "janedoe", "role": "guest" } }' \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_collaborators

Example response

{
   "api_status": 201,
   "api_timestamp": "2018-10-25T09:29:37Z",
   "repository": {
       "id": "acme"
   },
   "collaborator": {
      "id": "janedoe"
   },
   "role": "guest",
   "highest_role": "guest" 
}

PUT /projects/:project_id/repositories/:repository_id/repository_collaborators/:collaborator_id

Updates role for a repository collaborator. Returns the updated repository collaborator.

Example request

curl -X PUT \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
-H "Content-Type: application/json" \
-d '{ "repository_collaborator": { "role": "developer" } }' \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_collaborators/janedoe

Example response

{ 
   "api_status": 200,
   "api_timestamp": "2018-11-28T10:12:20Z",
   "repository": {
       "id": "acme"
   },
   "collaborator": {
       "id": "janedoe"
   },
   "role": "developer",
   "highest_role": "developer" 
}

DELETE /projects/:project_id/repositories/:repository_id/repository_collaborators/:collaborator_id

Removes a collaborator from a repository. Returns the removed repository collaborator.

Example request

curl -X DELETE \
-H "Accept: application/vnd.hth.v1" \
-H "Authorization: company_key='$COMPANY_KEY',account_key='$ACCOUNT_KEY'" \
https://helixteamhub.cloud/api/projects/luotsi/repositories/acme/repository_collaborators/janedoe

Example response

{ 
   "api_status": 200,
   "api_timestamp": "2018-11-28T10:12:28Z",
   "repository": {
       "id": "acme"
   },
   "collaborator": {
       "id": "janedoe"
   },
   "role": "developer",
   "highest_role": "developer" 
}