New
The Gartner Hype Cycle Emerging Technologies Report is out!

Download now

Home
/
API
/
Members

Members

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

NameInTypeRequiredDescription
organizationpathstring(uuid)trueOrganization ID

Example responses

200 Response

[
  {
    "assignable": true,
    "display_name": "string",
    "name": "string"
  }
]

Responses

StatusMeaningDescriptionSchema
200OKOKarray of codersdk.AssignableRoles

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
[array item]arrayfalse
» assignablebooleanfalse
» display_namestringfalse
» namestringfalse

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

NameInTypeRequiredDescription
organizationpathstringtrueOrganization ID
userpathstringtrueUser ID, name, or me
bodybodycodersdk.UpdateRolestrueUpdate 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

StatusMeaningDescriptionSchema
200OKOKcodersdk.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

StatusMeaningDescriptionSchema
200OKOKarray of codersdk.AssignableRoles

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
[array item]arrayfalse
» assignablebooleanfalse
» display_namestringfalse
» namestringfalse

To perform this operation, you must be authenticated. Learn more.

See an opportunity to improve our docs? Make an edit.