---
agentTools:
  projectIndex: https://docs.cancergenomicscloud.org/llms.txt
---

# 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](https://docs.cancergenomicscloud.org/docs/set-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.

[block:code]
{
  "codes": [
    {
      "code": "https://cgc-api.sbgenomics.com/v2/projects/{project_owner}/{project}/members",
      "language": "text",
      "name": "Path"
    }
  ]
}
[/block]

\##Request

\###Example request

[block:code]
{
  "codes": [
    {
      "code": "POST /v2/projects/rjfranklin/my-project/members HTTP/1.1\nHost: cgc-api.sbgenomics.com\nX-SBG-Auth-Token: 3210a98c1db9318fa9d9273156740f74",
      "language": "http",
      "name": null
    },
    {
      "code": "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\"",
      "language": "curl",
      "name": "cURL"
    }
  ],
  "sidebar": true
}
[/block]

[block:callout]
{
  "type": "success",
  "title": "Member permissions",
  "body": "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.\n\nFor more information, see the documentation on [setting permissions](https://docs.cancergenomicscloud.org/docs/set-permissions)."
}
[/block]

\###Header Fields

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Description",
    "0-0": "`X-SBG-Auth-Token`\n<span style=\"color:red\"><i>required</i></span>",
    "0-1": "Your CGC [authentication token](https://docs.cancergenomicscloud.org/docs/get-your-authentication-token).",
    "h-2": ""
  },
  "cols": 2,
  "rows": 1
}
[/block]

\###Path parameters

[block:parameters]
{
  "data": {
    "0-0": "`project`",
    "1-0": "`project_owner`",
    "h-0": "Name",
    "h-1": "Description",
    "0-1": "The ID of the project you are adding someone to.",
    "1-1": "The owner of the project you are adding someone to."
  },
  "cols": 2,
  "rows": 2
}
[/block]

\###Query parameters

[block:parameters]
{
  "data": {
    "h-0": "Name",
    "h-1": "Data type",
    "h-2": "Description",
    "0-0": "`fields`",
    "0-1": "string",
    "0-2": "Selector specifying a subset of fields to include in the response."
  },
  "cols": 3,
  "rows": 1
}
[/block]

\##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.

[block:parameters]
{
  "data": {
    "h-0": "Key",
    "h-1": "Datatype of value",
    "h-2": "Description of value",
    "0-0": "`username`",
    "0-1": "string",
    "0-2": "The CGC username of the person you want to add to the project",
    "1-0": "`permissions`",
    "1-1": "array of key-value pairs. The keys are strings, and the values are Booleans.",
    "1-2": "The possible keys are:\n       `\"write\"`\n       `\"read\"`\n       `\"copy\"`\n       `\"execute\"`\n       `\"admin\"`\nEach key may have the values `true` or `false`."
  },
  "cols": 3,
  "rows": 2
}
[/block]

[block:callout]
{
  "type": "success",
  "title": "Read permissions",
  "body": "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`."
}
[/block]

\###Example request body

[block:code]
{
  "codes": [
    {
      "code": "{\n    \"username\" : \"Jane_Doe\",\n    \"permissions\": {\n        \"read\" : true,\n        \"write\": true,\n        \"execute\": false\n    }\n}",
      "language": "json"
    }
  ]
}
[/block]

\##Response

[See a list of CGC-specific response codes that may be contained in the body of the response.](https://docs.cancergenomicscloud.org/docs/api-status-codes)

\###Example response body

[block:code]
{
  "codes": [
    {
      "code": "{\n    \"href\": \"https://cgc-api.sbgenomics.com/v2/projects/RFranklin/my-project/members/Jane_Doe\",\n    \"username\": \"Jane_Doe\",\n    \"permissions\": {\n        \"write\": true,\n        \"read\": true,\n        \"copy\": false,\n        \"execute\": true,\n        \"admin\": false\n    }\n}",
      "language": "json"
    }
  ],
  "sidebar": true
}
[/block]