# Puntos de conexión de API de REST para SCIM

Usa la API REST para automatizar la creación de usuarios y las pertenencias a equipos con SCIM.

## Acerca de SCIM

> \[!NOTE]
> Estos puntos de conexión solo admiten la autenticación mediante personal access token (classic). Para más información, consulta [Administración de tokens de acceso personal](/es/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).

GitHub proporciona puntos de conexión para que los usen los proveedores de identidades habilitados para SCIM (IDP). Una integración en el IdP puede usar la API REST para aprovisionar, administrar o desaprovisionar automáticamente cuentas de usuario en una GitHub Enterprise Server instancia que use el inicio de sesión único (SSO) de SAML para la autenticación. Consulta [Acerca del aprovisionamiento de usuarios con SCIM en GitHub Enterprise Server](/es/enterprise-server@3.22/admin/managing-iam/provisioning-user-accounts-with-scim/user-provisioning-with-scim-on-ghes).

Estos puntos de conexión se basan en SCIM 2.0. Para obtener más información, consulta la documentación de tu IdP o la [especificación en el sitio web de IETF](https://datatracker.ietf.org/doc/html/rfc7644).

### Direcciones URL raíz

Un IdP puede usar la siguiente URL raíz para comunicarse con los puntos de conexión de esta categoría para una instancia de GitHub Enterprise Server.

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

**No** se debe incluir la parte `enterprises/{enterprise}/` de las direcciones URL proporcionadas en la documentación del punto de conexión siguiente. Esta parte de la ruta de acceso no es aplicable a GitHub Enterprise Server. En el futuro, esta documentación mostrará las direcciones URL correctas para GitHub Enterprise Server.

Los puntos de conexión de esta categoría distinguen mayúsculas de minúsculas. Por ejemplo, la primera letra del punto de conexión `Users` debe ser mayúscula.

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

### Autenticación

La integración de SCIM del IdP realiza acciones en nombre de un propietario de empresa para la instancia GitHub Enterprise Server. Para más información, consulta [Capacidades de roles en una empresa](/es/enterprise-server@3.22/admin/managing-accounts-and-repositories/managing-roles-in-your-enterprise/abilities-of-roles#enterprise-owners).

Para autenticar las solicitudes de API, la persona que configura SCIM en el IdP debe usar un personal access token (classic) con el alcance `scim:enterprise`, que el IdP debe proporcionar en el encabezado `Authorization` de la solicitud. Para obtener más información sobre personal access tokens (classic), consulta [Administración de tokens de acceso personal](/es/enterprise-server@3.22/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).

> \[!NOTE]
> Los propietarios de empresa deben generar y usar un personal access token (classic) para la autenticación de las solicitudes a puntos de conexión de esta categoría.               En este momento, no se admiten autores de llamadas Fine-grained personal access token y GitHub

### Mapeo de los datos de SAML y de SCIM

Una vez que un usuario GitHub Enterprise Server se autentica correctamente mediante SAML SSO, GitHub vincula al usuario con una identidad aprovisionada mediante SCIM. Para vincular correctamente las identidades, el proveedor de identidades de SAML y la integración de SCIM deben usar identificadores únicos coincidentes.

Cuando se produce un error de coincidencia entre los datos SAML y SCIM de un usuario, GitHub devolverá un error que indica qué atributos de SAML y SCIM no coincidieron. Para más información sobre este error, consulta [Solución de problemas de administración de acceso e identidad para la empresa](/es/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 requiere la siguiente declaración SAML y el atributo SCIM para relacionar correctamente al usuario con la identidad aprovisionada mediante SCIM. Los proveedores de identidades pueden diferir en el campo utilizado para identificar de forma única a un usuario.

#### Microsoft Entra ID compatible con SAML

Para usar Entra ID (anteriormente conocido como Azure AD) para SAML, las siguientes declaraciones de SAML y el atributo SCIM deben coincidir.

| Reclamación SAML                                                | Atributo SCIM correspondiente |
| :-------------------------------------------------------------- | :---------------------------- |
| `http://schemas.microsoft.com/identity/claims/objectidentifier` | `externalId`                  |

#### Otros IdP para el SAML

Para usar otros IdP para SAML, GitHub utilizará el atributo "Nombre de usuario" configurado en su SAML "Atributos de usuario" para que coincida con el atributo SCIM que se muestra a continuación. Si se deja en blanco, el atributo "Username" de los "Atributos de usuario" de SAML tendrá como valor predeterminado el valor `NameID` de SAML. Para más información sobre las configuraciones de SAML, consulta [Configurar el inicio de sesión único de SAML para tu empresa](/es/enterprise-server@3.22/admin/managing-iam/using-saml-for-enterprise-iam/configuring-saml-single-sign-on-for-your-enterprise#configuring-saml-sso).

| Reclamación SAML                                                                                  | Atributo SCIM correspondiente |
| :------------------------------------------------------------------------------------------------ | :---------------------------- |
| Atributo "Username" configurado en "Atributos de usuario" de SAML o `NameID` si se deja en blanco | `userName`                    |

### Atributos de usuario de SCIM compatibles

Los puntos de conexión `User` de esta categoría admiten los atributos siguientes en los parámetros de una solicitud.

| Nombre            | Tipo     | Descripción                                                                                                                                                                                                                                                                                                                                                                                                           |
| :---------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `displayName`     | Cadena   | Nombre legible para el usuario.                                                                                                                                                                                                                                                                                                                                                                                       |
| `name.formatted`  | Cadena   | El nombre completo del usuario, incluido el segundo nombre, los títulos y los sufijos, con formato para mostrar.                                                                                                                                                                                                                                                                                                      |
| `name.givenName`  | Cadena   | El primer nombre del usuario.                                                                                                                                                                                                                                                                                                                                                                                         |
| `name.familyName` | Cadena   | Los apellidos del usuario.                                                                                                                                                                                                                                                                                                                                                                                            |
| `userName`        | Cadena   | El nombre de usuario generado por el IdP para el usuario. Se somete a la [normalización](/es/enterprise-server@3.22/admin/managing-iam/iam-configuration-reference/username-considerations-for-external-authentication#about-username-normalization) antes de su uso.                                                                                                                                                 |
| `emails`          | Matriz   | Lista de correos electrónicos del usuario.                                                                                                                                                                                                                                                                                                                                                                            |
| `roles`           | Matriz   | Lista de roles del usuario.                                                                                                                                                                                                                                                                                                                                                                                           |
| `externalId`      | Cadena   | Este identificador lo genera un proveedor de IdP. Puedes encontrar el `externalId` de un usuario en el IdP, o mediante el punto de conexión [Enumerar las identidades aprovisionadas de SCIM](#list-scim-provisioned-identities-for-an-enterprise) y filtrando por otros atributos conocidos, como el nombre de usuario o la dirección de correo electrónico del usuario en la instancia de GitHub Enterprise Server. |
| `id`              | Cadena   | Identificador que genera el punto de conexión de SCIM de la instancia.                                                                                                                                                                                                                                                                                                                                                |
| `active`          | Booleano | Indica si la identidad está activa (`true`) o debe suspenderse (`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):**