Skip to content
Skip to Content
Coder Docs

Update organization IdP Sync mapping

PATCH
/api/v2/settings/idpsync/organization/mapping

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

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 selects the claim field to be used as the created user's organizations. If the field is the empty string, then no organization updates will ever come from the OIDC provider.

mapping?

Mapping maps from an OIDC claim --> Coder organization uuid

organization_assign_default?boolean

AssignDefault will ensure the default org is always included for every user, regardless of their claims. This preserves legacy behavior.

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

curl -X PATCH \	"$CODER_URL/api/v2/settings/idpsync/organization/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"    ]  },  "organization_assign_default": true}