# Pontos de extremidade da API REST para SCIM

Use a API REST para automatizar a criação de usuários e as associações de equipe com o SCIM.

## Sobre o SCIM

> \[!NOTE]
> Esses pontos de extremidade só dão suporte à autenticação por meio de um personal access token (classic). Para saber mais, confira [Gerenciar seus tokens de acesso pessoal](/pt/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).

GitHub fornece pontos de extremidade para uso de provedores de identidade (IdPs) habilitados para SCIM. Uma integração no IdP pode usar a API REST para provisionar, gerenciar ou desprovisionar automaticamente contas de usuário em uma GitHub Enterprise Server instância que usa o SSO (logon único) do SAML para autenticação. Confira [Sobre o provisionamento de usuário com o SCIM no GitHub Enterprise Server](/pt/enterprise-server@3.22/admin/managing-iam/provisioning-user-accounts-with-scim/user-provisioning-with-scim-on-ghes).

Esses endpoints são baseados no SCIM 2.0. Para obter mais informações, confira a documentação do IdP ou confira a [especificação no site do IETF](https://datatracker.ietf.org/doc/html/rfc7644).

### URLs raiz

Um IdP pode usar a URL raiz a seguir para se comunicar com os pontos de extremidade desta categoria de uma instância GitHub Enterprise Server.

```http
http(s)://HOSTNAME/api/v3/scim/v2/
```

**Não** inclua o trecho `enterprises/{enterprise}/` das URLs fornecidas na documentação do ponto de extremidade abaixo. Essa parte do caminho não é aplicável a GitHub Enterprise Server. No futuro, essa documentação exibirá as URLs corretas para GitHub Enterprise Server.

Os pontos de extremidade desta categoria diferenciam maiúsculas de minúsculas. Por exemplo, a primeira letra no endpoint `Users` precisa ser maiúscula.

```shell
GET /scim/v2/Users/{scim_user_id}
```

### Autenticação

A integração SCIM no IdP executa ações em nome de um proprietário da empresa para a instância GitHub Enterprise Server. Para saber mais, confira [Habilidades de funções em uma empresa](/pt/enterprise-server@3.22/admin/managing-accounts-and-repositories/managing-roles-in-your-enterprise/abilities-of-roles#enterprise-owners).

Para autenticar solicitações de API, a pessoa que configura o SCIM no IdP deve usar um personal access token (classic) com o escopo `scim:enterprise`, que o IdP deve incluir no cabeçalho `Authorization` da solicitação. Para obter mais informações sobre personal access tokens (classic), confira [Gerenciar seus tokens de acesso pessoal](/pt/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).

> \[!NOTE]
> Os proprietários da empresa devem gerar e usar um personal access token (classic) para autenticação de solicitações para pontos de extremidade nesta categoria.               Desta vez, Fine-grained personal access token e chamadores do aplicativo do GitHub não têm suporte.

### Mapear dados do SAML e SCIM

Depois que um GitHub Enterprise Server usuário é autenticado com êxito usando o SSO do SAML, GitHub vincula o usuário a uma identidade provisionada por SCIM. Para vincular as identidades com êxito, o provedor de identidade SAML e a integração do SCIM devem usar identificadores exclusivos correspondentes.

Quando ocorrer uma incompatibilidade entre os dados SAML e SCIM de um usuário, GitHub retornará um erro informando quais atributos de SAML e SCIM não corresponderam. Para saber mais sobre esse erro, confira [Solução de problemas de gerenciamento de identidade e acesso da empresa](/pt/enterprise-server@3.22/admin/managing-iam/understanding-iam-for-enterprises/troubleshooting-identity-and-access-management-for-your-enterprise#saml-and-scim-data-mismatch-errors).

GitHub requer a seguinte declaração SAML e o seguinte atributo SCIM para associar corretamente o usuário à identidade provisionada pelo SCIM. Os provedores de identidade podem diferir no campo usado para identificar exclusivamente um usuário.

#### Microsoft Entra ID para SAML

Para usar a ID do Entra (anteriormente conhecida como Azure AD) para SAML, as declarações SAML a seguir e o atributo SCIM devem corresponder.

| Declaração SAML                                                 | Atributo correspondente do SCIM |
| :-------------------------------------------------------------- | :------------------------------ |
| `http://schemas.microsoft.com/identity/claims/objectidentifier` | `externalId`                    |

#### Outros IdPs para SAML

Para usar outros IdPs para SAML, GitHub usará o atributo "Nome de usuário" configurado em seus "atributos de usuário" SAML para corresponder ao atributo SCIM listado abaixo. Se deixado em branco, o atributo "Username" em seus "User attributes" SAML usará como padrão o `NameID` SAML. Para obter mais informações sobre as configurações SAML, confira [Configurar o logon único SAML para sua empresa](/pt/enterprise-server@3.22/admin/managing-iam/using-saml-for-enterprise-iam/configuring-saml-single-sign-on-for-your-enterprise#configuring-saml-sso).

| Declaração SAML                                                                                        | Atributo correspondente do SCIM |
| :----------------------------------------------------------------------------------------------------- | :------------------------------ |
| Atributo "Username" configurado em seus "atributos de usuário" SAML, ou `NameID` caso esteja em branco | `userName`                      |

### Atributos de usuário do SCIM com suporte

Os pontos de extremidade de `User` desta categoria dão suporte aos atributos a seguir dentro dos parâmetros de uma solicitação.

| Nome              | Tipo     | Descrição                                                                                                                                                                                                                                                                                                                                                              |
| :---------------- | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `displayName`     | String   | Nome de usuário legível por pessoas.                                                                                                                                                                                                                                                                                                                                   |
| `name.formatted`  | String   | O nome completo do usuário, incluindo todos os nomes do meio, títulos e sufixos, formatados para exibição.                                                                                                                                                                                                                                                             |
| `name.givenName`  | String   | Primeiro nome do usuário.                                                                                                                                                                                                                                                                                                                                              |
| `name.familyName` | String   | Sobrenome do usuário.                                                                                                                                                                                                                                                                                                                                                  |
| `userName`        | String   | O nome de usuário do usuário, gerado pelo IdP. Passa por [normalização](/pt/enterprise-server@3.22/admin/managing-iam/iam-configuration-reference/username-considerations-for-external-authentication#about-username-normalization) antes de ser usado.                                                                                                                |
| `emails`          | Array    | Lista de emails do usuário.                                                                                                                                                                                                                                                                                                                                            |
| `roles`           | Array    | Lista de funções do usuário.                                                                                                                                                                                                                                                                                                                                           |
| `externalId`      | String   | Esse identificador é gerado por um provedor IdP. Você pode encontrar o `externalId` de um usuário no IdP ou usando o endpoint [List SCIM provisioned identities](#list-scim-provisioned-identities-for-an-enterprise) e filtrando por outros atributos conhecidos, como o nome de usuário ou o endereço de e-mail de um usuário na instância GitHub Enterprise Server. |
| `id`              | String   | Identificador gerado pelo ponto de extremidade do SCIM da instância.                                                                                                                                                                                                                                                                                                   |
| `active`          | booleano | Indica se a identidade está ativa (`true`) ou deve ser suspensa (`false`).                                                                                                                                                                                                                                                                                             |

> \[!NOTE]
> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.

## List provisioned SCIM groups for an enterprise

```
GET /scim/v2/enterprises/{enterprise}/Groups
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Lists provisioned SCIM groups in an enterprise.
You can improve query search time by using the excludedAttributes query parameter with a value of members to exclude members from the response.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`filter`** (string)
  If specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are externalId, id, and displayName. For example, ?filter=externalId eq "9138790-10932-109120392-12321".

* **`excludedAttributes`** (string)
  Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time.

* **`startIndex`** (integer)
  Used for pagination: the starting index of the first result to return when paginating through values.
  Default: `1`

* **`count`** (integer)
  Used for pagination: the number of results to return per page.
  Default: `30`

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

### HTTP response status codes

* **200** - Success, either groups were found or not found

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups
```

**Response schema (Status: 200):**

* `schemas`: required, array of string, enum: `urn:ietf:params:scim:api:messages:2.0:ListResponse`
* `totalResults`: required, integer
* `Resources`: required, array of object
* `startIndex`: required, integer
* `itemsPerPage`: required, integer

## Provision a SCIM enterprise group

```
POST /scim/v2/enterprises/{enterprise}/Groups
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Creates a SCIM group for an enterprise.
If members are included as part of the group provisioning payload, they will be created as external group members. It is up to a provider to store a mapping between the externalId and id of each user.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

#### Body parameters

* **`schemas`** (array of strings) (required)
  The URIs that are used to indicate the namespaces of the SCIM schemas.
  Supported values are: urn:ietf:params:scim:schemas:core:2.0:Group

* **`externalId`** (string) (required)
  A unique identifier for the resource as defined by the provisioning client.

* **`displayName`** (string) (required)
  A human-readable name for a security group.

* **`members`** (array of objects)
  The group members.
  * **`value`** (string) (required)
    The local unique identifier for the member
  * **`displayName`** (string) (required)
    The display name associated with the member

### HTTP response status codes

* **201** - Group has been created

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **409** - Duplicate record detected

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X POST \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering",
  "members": [
    {
      "value": "879db59-3bdf-4490-ad68-ab880a2694745",
      "displayName": "User 1"
    },
    {
      "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
      "displayName": "User 2"
    }
  ]
}'
```

**Response schema (Status: 201):**

* all of:
  * **object**
    * `schemas`: required, array of string, enum: `urn:ietf:params:scim:schemas:core:2.0:Group`, `urn:ietf:params:scim:api:messages:2.0:ListResponse`
    * `externalId`: string or null
    * `displayName`: string or null
    * `members`: array of objects:
      * `value`: required, string
      * `$ref`: required, string
      * `display`: string
  * **object**
    * `id`: string
    * `members`: array of objects:
      * `value`: string
      * `$ref`: string
      * `display`: string
    * `meta`: object:
      * `resourceType`: required, string, enum: `User`, `Group`
      * `created`: string
      * `lastModified`: string
      * `location`: string

## Get SCIM provisioning information for an enterprise group

```
GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Gets information about a SCIM group.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_group_id`** (string) (required)
  A unique identifier of the SCIM group.

* **`excludedAttributes`** (string)
  Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

### HTTP response status codes

* **200** - Success, a group was found

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise group](#provision-a-scim-enterprise-group).

## Set SCIM information for a provisioned enterprise group

```
PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Replaces an existing provisioned group’s information.
You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the Update an attribute for a SCIM enterprise group endpoint instead.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_group_id`** (string) (required)
  A unique identifier of the SCIM group.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

#### Body parameters

* **`schemas`** (array of strings) (required)
  The URIs that are used to indicate the namespaces of the SCIM schemas.
  Supported values are: urn:ietf:params:scim:schemas:core:2.0:Group

* **`externalId`** (string) (required)
  A unique identifier for the resource as defined by the provisioning client.

* **`displayName`** (string) (required)
  A human-readable name for a security group.

* **`members`** (array of objects)
  The group members.
  * **`value`** (string) (required)
    The local unique identifier for the member
  * **`displayName`** (string) (required)
    The display name associated with the member

### HTTP response status codes

* **200** - Group was updated

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **409** - Duplicate record detected

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Group

**Request:**

```curl
curl -L \
  -X PUT \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering"
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise group](#provision-a-scim-enterprise-group).

#### Group with member

**Request:**

```curl
curl -L \
  -X PUT \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering",
  "members": [
    {
      "value": "879db59-3bdf-4490-ad68-ab880a2694745",
      "displayName": "User 1"
    },
    {
      "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
      "displayName": "User 2"
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise group](#provision-a-scim-enterprise-group).

## Update an attribute for a SCIM enterprise group

```
PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Update a provisioned group’s individual attributes.
To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the SCIM specification.  Update can also be used to add group memberships.
Group memberships can be sent one at a time or in batches for faster performance. Note: The memberships are referenced through a local user id, and the user will need to be created before they are referenced here.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_group_id`** (string) (required)
  A unique identifier of the SCIM group.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

#### Body parameters

* **`Operations`** (array of objects) (required)
  patch operations list
  * **`op`** (string) (required)
    Can be one of: `add`, `replace`, `remove`
  * **`path`** (string)
  * **`value`** (string)
    Corresponding 'value' of that field specified by 'path'

* **`schemas`** (array of strings) (required)
  undefinedSupported values are: urn:ietf:params:scim:api:messages:2.0:PatchOp

### HTTP response status codes

* **200** - Success, group was updated

* **204** - No Content

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **409** - Duplicate record detected

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Update Group

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "displayName",
      "value": "Employees"
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise group](#provision-a-scim-enterprise-group).

#### Add Members

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "add",
      "path": "members",
      "value": [
        {
          "value": "879db59-3bdf-4490-ad68-ab880a2694745"
        },
        {
          "value": "0db508eb-91e2-46e4-809c-30dcbda0c685"
        }
      ]
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise group](#provision-a-scim-enterprise-group).

## Delete a SCIM group from an enterprise

```
DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Deletes a SCIM group from an enterprise.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_group_id`** (string) (required)
  A unique identifier of the SCIM group.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

### HTTP response status codes

* **204** - Group was deleted, no content

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X DELETE \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID
```

**Response schema (Status: 204):**

## List SCIM provisioned identities for an enterprise

```
GET /scim/v2/enterprises/{enterprise}/Users
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Lists provisioned SCIM enterprise members.
When a user with a SCIM-provisioned external identity is removed from an enterprise through a patch with active flag set to false, the account's metadata is preserved to allow the user to re-join the enterprise in the future. However, the user's account will be suspended and the user will not be able to sign-in. In order to permanently suspend the users account with no ability to re-join the enterprise in the future, use the delete request. Users that were not permanently deleted will be visible in the returned results.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`filter`** (string)
  If specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are userName, externalId, id, and displayName. For example, ?filter=externalId eq "9138790-10932-109120392-12321".

* **`startIndex`** (integer)
  Used for pagination: the starting index of the first result to return when paginating through values.
  Default: `1`

* **`count`** (integer)
  Used for pagination: the number of results to return per page.
  Default: `30`

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

### HTTP response status codes

* **200** - Success, either users were found or not found

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users
```

**Response schema (Status: 200):**

Same response schema as [List provisioned SCIM groups for an enterprise](#list-provisioned-scim-groups-for-an-enterprise).

## Provision a SCIM enterprise user

```
POST /scim/v2/enterprises/{enterprise}/Users
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Creates an external identity for a new SCIM enterprise user.
SCIM does not authenticate users, it only provisions them. The authentication of users is done by SAML. However, when SCIM is enabled, all users need to be provisioned through SCIM before a user can sign in through SAML. The matching of a user to a SCIM provisioned user is done when the SAML assertion is consumed. The user will be matched on SAML response NameID to SCIM userName.
When converting existing enterprise to use SCIM, the user handle (userName) from the SCIM payload will be used to match the provisioned user to an already existing user in the enterprise. Since the new identity record is created for newly provisioned users the matching for those records is done using a user's handle. Currently the matching will be performed to all of the users no matter if they were SAML JIT provisioned or created as local users.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

#### Body parameters

* **`schemas`** (array of strings) (required)
  The URIs that are used to indicate the namespaces of the SCIM schemas.
  Supported values are: urn:ietf:params:scim:schemas:core:2.0:User

* **`externalId`** (string) (required)
  A unique identifier for the resource as defined by the provisioning client.

* **`active`** (boolean) (required)
  Whether the user active in the IdP.

* **`userName`** (string) (required)
  The username for the user.

* **`name`** (object)
  * **`formatted`** (string)
    The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.
  * **`familyName`** (string) (required)
    The family name of the user.
  * **`givenName`** (string) (required)
    The given name of the user.
  * **`middleName`** (string)
    The middle name(s) of the user.

* **`displayName`** (string) (required)
  A human-readable name for the user.

* **`emails`** (array of objects) (required)
  The emails for the user.
  * **`value`** (string) (required)
    The email address.
  * **`type`** (string) (required)
    The type of email address.
  * **`primary`** (boolean) (required)
    Whether this email address is the primary address.

* **`roles`** (array of objects)
  The roles assigned to the user.
  * **`display`** (string)
  * **`type`** (string)
  * **`value`** (string) (required)
    The role value representing a user role in GitHub.
    Can be one of: `user`, `27d9891d-2c17-4f45-a262-781a0e55c80a`, `guest_collaborator`, `1ebc4a02-e56c-43a6-92a5-02ee09b90824`, `enterprise_owner`, `981df190-8801-4618-a08a-d91f6206c954`, `ba4987ab-a1c3-412a-b58c-360fc407cb10`, `billing_manager`, `0e338b8c-cc7f-498a-928d-ea3470d7e7e3`, `e6be2762-e4ad-4108-b72d-1bbe884a0f91`
  * **`primary`** (boolean)
    Is the role a primary role for the user.

### HTTP response status codes

* **201** - User has been created

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **409** - Duplicate record detected

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### User

**Request:**

```curl
curl -L \
  -X POST \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "externalId": "E012345",
  "active": true,
  "userName": "E012345",
  "name": {
    "formatted": "Ms. Mona Lisa Octocat",
    "familyName": "Octocat",
    "givenName": "Mona",
    "middleName": "Lisa"
  },
  "displayName": "Mona Lisa",
  "emails": [
    {
      "value": "mlisa@example.com",
      "type": "work",
      "primary": true
    }
  ],
  "roles": [
    {
      "value": "user",
      "primary": false
    }
  ]
}'
```

**Response schema (Status: 201):**

* all of:
  * **object**
    * `schemas`: required, array of string, enum: `urn:ietf:params:scim:schemas:core:2.0:User`
    * `externalId`: string or null
    * `active`: required, boolean
    * `userName`: string
    * `name`: object:
      * `formatted`: string
      * `familyName`: string
      * `givenName`: string
      * `middleName`: string
    * `displayName`: string or null
    * `emails`: required, array of objects:
      * `value`: required, string
      * `type`: string
      * `primary`: boolean
    * `roles`: array of objects:
      * `display`: string
      * `type`: string
      * `value`: required, string, enum: `user`, `27d9891d-2c17-4f45-a262-781a0e55c80a`, `guest_collaborator`, `1ebc4a02-e56c-43a6-92a5-02ee09b90824`, `enterprise_owner`, `981df190-8801-4618-a08a-d91f6206c954`, `ba4987ab-a1c3-412a-b58c-360fc407cb10`, `billing_manager`, `0e338b8c-cc7f-498a-928d-ea3470d7e7e3`, `e6be2762-e4ad-4108-b72d-1bbe884a0f91`
      * `primary`: boolean
  * **object**
    * `id`: required, string
    * `groups`: array of objects:
      * `value`: string
      * `$ref`: string
      * `display`: string
    * `meta`: required, object:
      * `resourceType`: required, string, enum: `User`, `Group`
      * `created`: string
      * `lastModified`: string
      * `location`: string

#### Enterprise Owner

**Request:**

```curl
curl -L \
  -X POST \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "externalId": "E012345",
  "active": true,
  "userName": "E012345",
  "name": {
    "formatted": "Ms. Mona Lisa Octocat",
    "familyName": "Octocat",
    "givenName": "Mona",
    "middleName": "Lisa"
  },
  "displayName": "Mona Lisa",
  "emails": [
    {
      "value": "mlisa@example.com",
      "type": "work",
      "primary": true
    }
  ],
  "roles": [
    {
      "value": "enterprise_owner",
      "primary": false
    }
  ]
}'
```

**Response schema (Status: 201):**

* all of:
  * **object**
    * `schemas`: required, array of string, enum: `urn:ietf:params:scim:schemas:core:2.0:User`
    * `externalId`: string or null
    * `active`: required, boolean
    * `userName`: string
    * `name`: object:
      * `formatted`: string
      * `familyName`: string
      * `givenName`: string
      * `middleName`: string
    * `displayName`: string or null
    * `emails`: required, array of objects:
      * `value`: required, string
      * `type`: string
      * `primary`: boolean
    * `roles`: array of objects:
      * `display`: string
      * `type`: string
      * `value`: required, string, enum: `user`, `27d9891d-2c17-4f45-a262-781a0e55c80a`, `guest_collaborator`, `1ebc4a02-e56c-43a6-92a5-02ee09b90824`, `enterprise_owner`, `981df190-8801-4618-a08a-d91f6206c954`, `ba4987ab-a1c3-412a-b58c-360fc407cb10`, `billing_manager`, `0e338b8c-cc7f-498a-928d-ea3470d7e7e3`, `e6be2762-e4ad-4108-b72d-1bbe884a0f91`
      * `primary`: boolean
  * **object**
    * `id`: required, string
    * `groups`: array of objects:
      * `value`: string
      * `$ref`: string
      * `display`: string
    * `meta`: required, object:
      * `resourceType`: required, string, enum: `User`, `Group`
      * `created`: string
      * `lastModified`: string
      * `location`: string

## Get SCIM provisioning information for an enterprise user

```
GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Gets information about a SCIM user.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_user_id`** (string) (required)
  The unique identifier of the SCIM user.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

### HTTP response status codes

* **200** - Success, a user was found

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise user](#provision-a-scim-enterprise-user).

## Set SCIM information for a provisioned enterprise user

```
PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Replaces an existing provisioned user's information.
You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the Update an attribute for a SCIM user endpoint instead.
Warning

Setting active: false will suspend a user and obfuscate the user handle and user email. Since the implementation is a generic SCIM implementation and does not differentiate yet between different IdP providers, for Okta, the user GDPR data will not be purged and the credentials will not be removed.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_user_id`** (string) (required)
  The unique identifier of the SCIM user.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

#### Body parameters

* **`schemas`** (array of strings) (required)
  The URIs that are used to indicate the namespaces of the SCIM schemas.
  Supported values are: urn:ietf:params:scim:schemas:core:2.0:User

* **`externalId`** (string) (required)
  A unique identifier for the resource as defined by the provisioning client.

* **`active`** (boolean) (required)
  Whether the user active in the IdP.

* **`userName`** (string) (required)
  The username for the user.

* **`name`** (object)
  * **`formatted`** (string)
    The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.
  * **`familyName`** (string) (required)
    The family name of the user.
  * **`givenName`** (string) (required)
    The given name of the user.
  * **`middleName`** (string)
    The middle name(s) of the user.

* **`displayName`** (string) (required)
  A human-readable name for the user.

* **`emails`** (array of objects) (required)
  The emails for the user.
  * **`value`** (string) (required)
    The email address.
  * **`type`** (string) (required)
    The type of email address.
  * **`primary`** (boolean) (required)
    Whether this email address is the primary address.

* **`roles`** (array of objects)
  The roles assigned to the user.
  * **`display`** (string)
  * **`type`** (string)
  * **`value`** (string) (required)
    The role value representing a user role in GitHub.
    Can be one of: `user`, `27d9891d-2c17-4f45-a262-781a0e55c80a`, `guest_collaborator`, `1ebc4a02-e56c-43a6-92a5-02ee09b90824`, `enterprise_owner`, `981df190-8801-4618-a08a-d91f6206c954`, `ba4987ab-a1c3-412a-b58c-360fc407cb10`, `billing_manager`, `0e338b8c-cc7f-498a-928d-ea3470d7e7e3`, `e6be2762-e4ad-4108-b72d-1bbe884a0f91`
  * **`primary`** (boolean)
    Is the role a primary role for the user.

### HTTP response status codes

* **200** - User was updated

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **409** - Duplicate record detected

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### User

**Request:**

```curl
curl -L \
  -X PUT \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "externalId": "E012345",
  "active": true,
  "userName": "E012345",
  "name": {
    "formatted": "Ms. Mona Lisa Octocat",
    "familyName": "Octocat",
    "givenName": "Mona",
    "middleName": "Lisa"
  },
  "displayName": "Mona Lisa",
  "emails": [
    {
      "value": "mlisa@example.com",
      "type": "work",
      "primary": true
    }
  ],
  "roles": [
    {
      "value": "user",
      "primary": false
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise user](#provision-a-scim-enterprise-user).

## Update an attribute for a SCIM enterprise user

```
PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Update a provisioned user's individual attributes.
To change a user's values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the SCIM specification.
Note

Complicated SCIM path selectors that include filters are not supported. For example, a path selector defined as "path": "emails\[type eq "work"]" will not work.

Warning

Setting active: false will suspend a user and obfuscate the user handle and user email. Since the implementation is a generic SCIM implementation and does not differentiate yet between different IdP providers (Okta, for example), the user GDPR data in the SCIM metadata will not be purged and the credentials will not be removed.
{
"Operations":\[{
"op":"replace",
"value":{
"active":false
}
}]
}

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_user_id`** (string) (required)
  The unique identifier of the SCIM user.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

#### Body parameters

* **`Operations`** (array of objects) (required)
  patch operations list
  * **`op`** (string) (required)
    Can be one of: `add`, `replace`, `remove`
  * **`path`** (string)
  * **`value`** (string)
    Corresponding 'value' of that field specified by 'path'

* **`schemas`** (array of strings) (required)
  undefinedSupported values are: urn:ietf:params:scim:api:messages:2.0:PatchOp

### HTTP response status codes

* **200** - Success, user was updated

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **409** - Duplicate record detected

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Multi Valued Property

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "emails[type eq 'work'].value",
      "value": "updatedEmail@microsoft.com"
    },
    {
      "op": "replace",
      "path": "name.familyName",
      "value": "updatedFamilyName"
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise user](#provision-a-scim-enterprise-user).

#### Single Valued Property

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "userName",
      "value": "5b50642d-79fc-4410-9e90-4c077cdd1a59@testuser.com"
    },
    {
      "op": "replace",
      "path": "displayName",
      "value": "Monalisa Octocat"
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise user](#provision-a-scim-enterprise-user).

#### Disable User

**Request:**

```curl
curl -L \
  -X PATCH \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
  -d '{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:PatchOp"
  ],
  "Operations": [
    {
      "op": "replace",
      "path": "active",
      "value": false
    }
  ]
}'
```

**Response schema (Status: 200):**

Same response schema as [Provision a SCIM enterprise user](#provision-a-scim-enterprise-user).

## Delete a SCIM user from an enterprise

```
DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}
```

Note

The SCIM API endpoints for enterprise accounts are currently in private preview and are subject to change.

Permanently suspends a SCIM user from an enterprise, removes all data for the user, obfuscates the login, email, and display name of the user, removes all external-identity SCIM attributes, and deletes the emails, avatar, PATs, SSH keys, OAuth authorizations credentials, GPG keys, and SAML mappings for the user. You will not be able to undo this action.

### Parameters

#### Headers

* **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

* **`scim_user_id`** (string) (required)
  The unique identifier of the SCIM user.

* **`enterprise`** (string) (required)
  The slug version of the enterprise name.

### HTTP response status codes

* **204** - User was deleted, no content

* **400** - Bad request

* **401** - Authorization failure

* **403** - Permission denied

* **404** - Resource not found

* **429** - Too many requests

* **500** - Internal server error

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X DELETE \
  http(s)://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID
```

**Response schema (Status: 204):**