Add a member to a project

/projects/{project_owner}/{project}/members

This call adds a new user to a specified project. It can only be successfully made by a user who has admin permissions in the project.

Users may have the following permissions on the CGC:

  • Read
  • Write
  • Copy
  • Execute
  • Admin

For more information, see the documentation on setting project member permissions. Note that some user permissions imply others: for example, if you give a user admin permission, then they automatically receive read, write, copy and execute permissions.

https://cgc-api.sbgenomics.com/v2/projects/{project_owner}/{project}/members

Request

Example request

POST /v2/projects/rjfranklin/my-project/members HTTP/1.1
Host: cgc-api.sbgenomics.com
X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74
curl --data '{"username": "Jane-Doe", "permissions": { "read": true, "write": true, "execute": false}}' -s -H "X-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74" -H "content-type: application/json" -X POST "https://cgc-api.sbgenomics.com/v2/projects/RFranklin/my-project/members"

👍

Member permissions

Requests to add a project member must include the key permissions. However, if you do not include a value for some permission, it will be set to false by default. The exception to this rule is the read permission, which is the default permission on a project. It enables a user to read project data, including file names, but access file contents.

For more information, see the documentation on setting permissions.

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your CGC authentication token.

Path parameters

NameDescription
projectThe ID of the project you are adding someone to.
project_ownerThe owner of the project you are adding someone to.

Query parameters

NameData typeDescription
fieldsstringSelector specifying a subset of fields to include in the response.

Request body

Inside the body of the call you should enter a set of key-value pairs. The following table describes the values you should enter.

KeyDatatype of valueDescription of value
usernamestringThe CGC username of the person you want to add to the project
permissionsarray of key-value pairs. The keys are strings, and the values are Booleans.The possible keys are:
"write"
"read"
"copy"
"execute"
"admin"
Each key may have the values true or false.

👍

Read permissions

All members of a project have read permissions by default. Even if you try setting read permissions to false, they will still default to true.

Example request body

{
    "username" : "Jane_Doe",
    "permissions": {
        "read" : true,
        "write": true,
        "execute": false
    }
}

Response

See a list of CGC-specific response codes that may be contained in the body of the response.

Example response body

{
    "href": "https://cgc-api.sbgenomics.com/v2/projects/RFranklin/my-project/members/Jane_Doe",
    "username": "Jane_Doe",
    "permissions": {
        "write": true,
        "read": true,
        "copy": false,
        "execute": true,
        "admin": false
    }
}
Language