Members
Get member roles by organization
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members/roles \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /organizations/{organization}/members/roles
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organization | path | string(uuid) | true | Organization ID |
Example responses
200 Response
[
{
"assignable": true,
"display_name": "string",
"name": "string"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | array of codersdk.AssignableRoles |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
[array item] | array | false | ||
» assignable | boolean | false | ||
» display_name | string | false | ||
» name | string | false |
To perform this operation, you must be authenticated. Learn more.
Assign role to organization member
Code samples
# Example request using curl
curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/roles \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
PUT /organizations/{organization}/members/{user}/roles
Body parameter
{
"roles": ["string"]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organization | path | string | true | Organization ID |
user | path | string | true | User ID, name, or me |
body | body | codersdk.UpdateRoles | true | Update roles request |
Example responses
200 Response
{
"created_at": "2019-08-24T14:15:22Z",
"organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
"roles": [
{
"display_name": "string",
"name": "string"
}
],
"updated_at": "2019-08-24T14:15:22Z",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | codersdk.OrganizationMember |
To perform this operation, you must be authenticated. Learn more.
Get site member roles
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/users/roles \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /users/roles
Example responses
200 Response
[
{
"assignable": true,
"display_name": "string",
"name": "string"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | OK | array of codersdk.AssignableRoles |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
[array item] | array | false | ||
» assignable | boolean | false | ||
» display_name | string | false | ||
» name | string | false |
To perform this operation, you must be authenticated. Learn more.
See an opportunity to improve our docs? Make an edit.
On this page