Skip to content
Skip to Content
Coder Docs

Update role IdP Sync mapping

PATCH
/api/v2/organizations/{organization}/settings/idpsync/roles/mapping

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Path Parameters

organization*string

Organization ID or name

Formatuuid

Request Body

Description of the mappings to add and remove

application/json
  1. body
add?array<>
remove?array<>

Response Body

OK

application/json
  1. response
field?string

Field is the name of the claim field that specifies what organization roles a user should be given. If empty, no roles will be synced.

mapping?

Mapping is a map from OIDC groups to Coder organization roles.

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X PATCH \	"$CODER_URL/api/v2/organizations/{organization}/settings/idpsync/roles/mapping" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN" \	-H "Content-Type: application/json" \	-d '{  "add": [    {      "gets": "string",      "given": "string"    }  ],  "remove": [    {      "gets": "string",      "given": "string"    }  ]}'
Example Response200
{  "field": "string",  "mapping": {    "property1": [      "string"    ],    "property2": [      "string"    ]  }}