Get role IdP Sync settings by organization
GET
CoderSessionTokenheader
Coder-Session-Token<token>organization*stringOrganization ID
Format
uuidOK
application/json- response
field?stringField 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 GET \ "$CODER_URL/api/v2/organizations/{organization}/settings/idpsync/roles" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN"const { CODER_URL, CODER_SESSION_TOKEN } = process.env;const url = `${CODER_URL}/api/v2/organizations/{organization}/settings/idpsync/roles`;const response = await fetch(url, { method: "GET", headers: { "Coder-Session-Token": CODER_SESSION_TOKEN, },});console.log(response.status, await response.text());import osimport requestsurl = ( os.environ["CODER_URL"] + "/api/v2/organizations/{organization}/settings/idpsync/roles")token = os.environ["CODER_SESSION_TOKEN"]response = requests.get( url, headers={ "Coder-Session-Token": token, },)print(response.status_code, response.text)package mainimport ( "fmt" "io" "net/http" "os")func main() { url := os.Getenv("CODER_URL") + "/api/v2/organizations/{organization}/settings/idpsync/roles" token := os.Getenv("CODER_SESSION_TOKEN") req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { panic(err) } req.Header.Set("Coder-Session-Token", token) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(resp.Status, string(out))}Example Response200
{ "field": "string", "mapping": { "property1": [ "string" ], "property2": [ "string" ] }}