> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/kr/id-iam/api-scim/api-1/patch-user.md).

# 사용자 수정

## 사용자 수정

### 개요

The `PATCH /Users/{id}` 엔드포인트는 사용자에 대한 부분 업데이트를 수행하는 데 사용됩니다.

이 구현은 **제한된 PATCH 기능을 지원하며** 주로 사용자의 역할을 업데이트하는 데 사용됩니다.

Okta 또는 Microsoft Azure Active Directory와 같은 ID 공급자는 사용자 수명 주기 업데이트 동안 이 엔드포인트를 사용할 수 있습니다.

***

### 지원되는 작업

다음 작업만 지원됩니다:

* 사용자 역할 업데이트

다른 모든 PATCH 작업은 **지원되지 않습니다**.

***

### 엔드포인트

```bash
PATCH /Users/{id}
```

***

### 전체 URL

```bash
https://api.ggwp.com/scim/v2/Users/{id}
```

***

### 인증

```http
Authorization: Bearer <access_token>
```

***

## 요청 본문

### 지원되는 스키마

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"]
}
```

***

### 요청 예시 (역할 업데이트)

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
  "Operations": [
    {
      "op": "replace",
      "path": "roles",
      "value": [
        {
          "value": "moderator"
        }
      ]
    }
  ]
}
```

***

## 지원되는 값

### role

* **유형:** `string`
* **허용되는 값:**
  * `admin`
  * `moderator`

***

## 응답

### 성공 (200 OK)

```json
{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "id": "c118d158-c11b-495b-ab88-f57c8ac473c0",
  "userName": "Temp_user_prod",
  "externalId": "ABC1900BE",
  "active": true,
  "name": {
    "givenName": "Temp",
    "familyName": "User"
  },
  "displayName": "Temp User",
  "emails": [
    {
      "value": "temp_user_us@example.com",
      "primary": true
    }
  ],
  "roles": [
    {
      "value": "admin"
    }
  ],
  "meta": {
    "resourceType": "User",
    "location": "https://api.ggwp.com/scim/v2/Users/c118d158-c11b-495b-ab88-f57c8ac473c0",
    "created": "2026-04-01T11:15:22Z",
    "lastModified": "2026-04-01T11:15:22Z"
  }
}
```

***

## 오류 응답

### 400 잘못된 요청 (지원되지 않는 작업)

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "400",
  "detail": "역할 업데이트만 지원됩니다"
}
```

***

### 400 잘못된 요청 (잘못된 역할)

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "400",
  "detail": "잘못된 역할 값"
}
```

***

### 404 찾을 수 없음

```json
{
  "schemas": ["urn:ietf:params:scim:api:messages:2.0:Error"],
  "status": "404",
  "detail": "사용자를 찾을 수 없습니다"
}
```

***

## 검증 규칙

* 오직 `Replace` 작업만 지원됩니다
* 오직 `path = "roles"` 이 지원됩니다
* `value` 는 다음 중 하나여야 합니다:
  * `admin`
  * `moderator`
* 그 외의 모든 PATCH 요청은 거부됩니다
