---
title: "Update organization IdP Sync mapping"
method: PATCH
path: "/api/v2/settings/idpsync/organization/mapping"
tags: ["Enterprise"]
---

# Update organization IdP Sync mapping

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

## Request body

- CodersdkPatchOrganizationIDPSyncMappingRequest
  - `add` object[]
    - `gets` string — The ID of the Coder resource the user should be added to
    - `given` string — The IdP claim the user has
  - `remove` object[]
    - `gets` string — The ID of the Coder resource the user should be added to
    - `given` string — The IdP claim the user has

## Response `200`

OK

- CodersdkOrganizationSyncSettings
  - `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` object — 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.

---

[API](https://skmtc.net/coder/apis/coder-api.md) · [All operations](https://skmtc.net/coder/apis/coder-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/coder/coder-api/versions/56b6e9f08540/schema)
