REST API endpoints for SCIM
Use the REST API to automate user creation and team memberships with SCIM.
Note
- These endpoints allow you to provision user accounts for your enterprise on GitHub Enterprise Cloud using SCIM. The operation is only available for use with Enterprise Managed Users. If you don't use Enterprise Managed Users and want to provision access to your organizations using SCIM, see REST API endpoints for SCIM.
- GitHub recommends that you test provisioning in an environment that's isolated from the production data on your IdP and GitHub.
About SCIM
To create, manage, and deactivate user accounts for your enterprise members on GitHub, your IdP must implement SCIM for communication with GitHub. SCIM is an open specification for management of user identities between systems. Different IdPs provide different experiences for the configuration of SCIM provisioning. If you don't use a partner IdP with an existing integration, you can integrate using the following API endpoints. For more information, see Provisioning users and groups with SCIM using the REST API.
Base URL
To manage your enterprise's users and groups using SCIM, use the following base URL to communicate with the endpoints in this category.
https://api.github.com/scim/v2/enterprises/{enterprise}/
Authentication
To authenticate API requests, the person who configures SCIM on the IdP must use a personal access token (classic) with scim:enterprise scope, which the IdP must provide in the request's Authorization header. For more information about personal access tokens (classic), see Managing your personal access tokens.
GitHub recommends authenticating as the setup user for the enterprise. Other user accounts are created through SCIM, so authenticating as a different user could result in unintended consequences, such as getting locked out of your enterprise. Write requests to these APIs are possible through our published IdP applications, or through direct API access to our SCIM endpoints. If another enterprise owner needs to read information from the API, use a personal access token (classic) with the admin:enterprise scope to make GET requests on your current SCIM implementation. For more information, see Configuring SCIM provisioning for Enterprise Managed Users.
Mapping of SAML and SCIM data
After a managed user account successfully authenticates to access your enterprise using SAML SSO, GitHub links the user to a SCIM provisioned identity. To link the identities successfully, the SAML identity provider and the SCIM integration must use matching unique identifiers.
GitHub requires the following SAML claim and SCIM attribute to successfully match the user with the identity provisioned by SCIM. Identity providers may differ in the field used to uniquely identify a user.
Microsoft Entra ID for SAML
To use Entra ID (previously known as Azure AD) for SAML, the following SAML claims and SCIM attribute must match.
| SAML claim | Matching SCIM attribute | 
|---|---|
| http://schemas.microsoft.com/identity/claims/objectidentifier | externalId | 
Other IdPs for SAML
To use other IdPs for SAML, the following SAML claims and SCIM attribute must match.
| SAML claim | Matching SCIM attribute | 
|---|---|
| NameID | userName | 
Supported SCIM user attributes
Users endpoints in this category support the following attributes within a request's parameters.
| Name | Type | Description | 
|---|---|---|
| displayName | String | Human-readable name for a user. | 
| name.formatted | String | The user's full name, including all middle names, titles, and suffixes, formatted for display. | 
| name.givenName | String | The first name of the user. | 
| name.familyName | String | The last name of the user. | 
| userName | String | The username for the user, generated by the SCIM provider. Undergoes normalization before being used. Must be unique per user. | 
| emails | Array | List of the user's emails. | 
| roles | Array | List of the user's roles. | 
| externalId | String | This identifier is generated by a SCIM provider. Must be unique per user. | 
| id | String | Identifier generated by the GitHub's SCIM endpoint. | 
| active | Boolean | Indicates whether the identity is active ( true) or should be suspended (false). | 
Supported SCIM group attributes
Groups endpoints in this category support the following attributes within a request's parameters.
| Name | Type | Description | 
|---|---|---|
| displayName | String | Human-readable name for a group. | 
| members | String | List of members who are assigned to the group in SCIM provider | 
| externalId | String | This identifier is generated by a SCIM provider. Must be unique per user. | 
List provisioned SCIM groups for an enterprise
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.
Fine-grained access tokens for "List provisioned SCIM groups for an enterprise"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (read)
Parameters for "List provisioned SCIM groups for an enterprise"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | 
|---|
| filterstringIf specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are  | 
| excludedAttributesstringExcludes the specified attribute from being returned in the results. Using this parameter can speed up response time. | 
| startIndexintegerUsed for pagination: the starting index of the first result to return when paginating through values. Default:  | 
| countintegerUsed for pagination: the number of results to return per page. Default:  | 
HTTP response status codes for "List provisioned SCIM groups for an enterprise"
| Status code | Description | 
|---|---|
| 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 samples for "List provisioned SCIM groups for an enterprise"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/scim/v2/enterprises/ENTERPRISE/GroupsSuccess, either groups were found or not found
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 1,
  "Resources": [
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
      ],
      "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
      "id": "24b28bbb-5fc4-4686-a153-a020debb1155",
      "displayName": "Engineering",
      "members": [
        {
          "value": "879db59-3bdf-4490-ad68-ab880a2694745",
          "$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
          "displayName": "User 1"
        },
        {
          "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
          "$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
          "displayName": "User 2"
        }
      ],
      "meta": {
        "resourceType": "Group",
        "created": "2012-03-27T19:59:26.000Z",
        "lastModified": "2018-03-27T19:59:26.000Z",
        "location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
      }
    }
  ],
  "startIndex": 1,
  "itemsPerPage": 20
}Provision a SCIM enterprise group
Creates a SCIM group for an enterprise.
When members are part of the group provisioning payload, they're designated as external group members. Providers are responsible for maintaining a mapping between the externalId and id for each user.
Fine-grained access tokens for "Provision a SCIM enterprise group"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Provision a SCIM enterprise group"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | |||
|---|---|---|---|
| schemasarray of strings RequiredThe URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are:  | |||
| externalIdstring RequiredA unique identifier for the resource as defined by the provisioning client. | |||
| displayNamestring RequiredA human-readable name for a security group. | |||
| membersarray of objectsThe group members. | |||
| Properties of  | 
| Name, Type, Description | 
|---|
| valuestring RequiredThe local unique identifier for the member | 
| displayNamestring RequiredThe display name associated with the member | 
HTTP response status codes for "Provision a SCIM enterprise group"
| Status code | Description | 
|---|---|
| 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 samples for "Provision a SCIM enterprise group"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -X POST \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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"}]}'Group has been created
Status: 201{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering",
  "members": [
    {
      "value": "879db59-3bdf-4490-ad68-ab880a2694745",
      "$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
      "displayName": "User 1"
    },
    {
      "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
      "$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
      "displayName": "User 2"
    }
  ],
  "meta": {
    "resourceType": "Group",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
  }
}Get SCIM provisioning information for an enterprise group
Gets information about a SCIM group.
Fine-grained access tokens for "Get SCIM provisioning information for an enterprise group"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (read)
Parameters for "Get SCIM provisioning information for an enterprise group"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_group_idstring RequiredA unique identifier of the SCIM group. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | 
|---|
| excludedAttributesstringExcludes the specified attribute from being returned in the results. Using this parameter can speed up response time. | 
HTTP response status codes for "Get SCIM provisioning information for an enterprise group"
| Status code | Description | 
|---|---|
| 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 samples for "Get SCIM provisioning information for an enterprise group"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_IDSuccess, a group was found
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering",
  "members": [
    {
      "value": "879db59-3bdf-4490-ad68-ab880a2694745",
      "$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
      "displayName": "User 1"
    },
    {
      "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
      "$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
      "displayName": "User 2"
    }
  ],
  "meta": {
    "resourceType": "Group",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
  }
}Set SCIM information for a provisioned enterprise group
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.
Fine-grained access tokens for "Set SCIM information for a provisioned enterprise group"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Set SCIM information for a provisioned enterprise group"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_group_idstring RequiredA unique identifier of the SCIM group. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | |||
|---|---|---|---|
| schemasarray of strings RequiredThe URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are:  | |||
| externalIdstring RequiredA unique identifier for the resource as defined by the provisioning client. | |||
| displayNamestring RequiredA human-readable name for a security group. | |||
| membersarray of objectsThe group members. | |||
| Properties of  | 
| Name, Type, Description | 
|---|
| valuestring RequiredThe local unique identifier for the member | 
| displayNamestring RequiredThe display name associated with the member | 
HTTP response status codes for "Set SCIM information for a provisioned enterprise group"
| Status code | Description | 
|---|---|
| 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 samples for "Set SCIM information for a provisioned enterprise group"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request examples
curl -L \
  -X PUT \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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"}'Group was updated
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering",
  "members": [
    {
      "value": "879db59-3bdf-4490-ad68-ab880a2694745",
      "$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
      "displayName": "User 1"
    },
    {
      "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
      "$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
      "displayName": "User 2"
    }
  ],
  "meta": {
    "resourceType": "Group",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
  }
}Update an attribute for a SCIM enterprise group
Update a provisioned group’s individual attributes.
To modify a group's values, you'll need to use a specific Operations JSON format which must include at least one of the following operations: add, remove, or replace. For examples and more information on this SCIM format, consult the SCIM specification. The update function can also be used to add group memberships.
You can submit group memberships individually or in batches for improved efficiency.
Note
Memberships are referenced via a local user id. Ensure users are created before referencing them here.
Fine-grained access tokens for "Update an attribute for a SCIM enterprise group"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Update an attribute for a SCIM enterprise group"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_group_idstring RequiredA unique identifier of the SCIM group. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | ||||
|---|---|---|---|---|
| Operationsarray of objects Requiredpatch operations list | ||||
| Properties of  | 
| Name, Type, Description | 
|---|
| opstring RequiredCan be one of:  | 
| pathstring | 
| valuestringCorresponding 'value' of that field specified by 'path' | 
schemas array of strings RequiredundefinedSupported values are: urn:ietf:params:scim:api:messages:2.0:PatchOp
HTTP response status codes for "Update an attribute for a SCIM enterprise group"
| Status code | Description | 
|---|---|
| 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 samples for "Update an attribute for a SCIM enterprise group"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request examples
curl -L \
  -X PATCH \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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"}]}'Success, group was updated
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:Group"
  ],
  "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc",
  "externalId": "8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159",
  "displayName": "Engineering",
  "members": [
    {
      "value": "879db59-3bdf-4490-ad68-ab880a2694745",
      "$+ref": "https://api.github.localhost/scim/v2/Users/879db59-3bdf-4490-ad68-ab880a2694745",
      "displayName": "User 1"
    },
    {
      "value": "0db508eb-91e2-46e4-809c-30dcbda0c685",
      "$+ref": "https://api.github.localhost/scim/v2/Users/0db508eb-91e2-46e4-809c-30dcbda0c685",
      "displayName": "User 2"
    }
  ],
  "meta": {
    "resourceType": "Group",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Groups/24b28bbb-5fc4-4686-a153-a020debb1155"
  }
}Delete a SCIM group from an enterprise
Deletes a SCIM group from an enterprise.
Fine-grained access tokens for "Delete a SCIM group from an enterprise"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Delete a SCIM group from an enterprise"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_group_idstring RequiredA unique identifier of the SCIM group. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
HTTP response status codes for "Delete a SCIM group from an enterprise"
| Status code | Description | 
|---|---|
| 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 samples for "Delete a SCIM group from an enterprise"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_IDGroup was deleted, no content
Status: 204List SCIM provisioned identities for an enterprise
Lists provisioned SCIM enterprise members.
When you remove a user with a SCIM-provisioned external identity from an enterprise using a patch with active flag to false, the user's metadata remains intact. This means they can potentially re-join the enterprise later. Although, while suspended, the user can't sign in. If you want to ensure the user can't re-join in the future, use the delete request. Only users who weren't permanently deleted will appear in the result list.
Fine-grained access tokens for "List SCIM provisioned identities for an enterprise"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (read)
Parameters for "List SCIM provisioned identities for an enterprise"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | 
|---|
| filterstringIf specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are  | 
| startIndexintegerUsed for pagination: the starting index of the first result to return when paginating through values. Default:  | 
| countintegerUsed for pagination: the number of results to return per page. Default:  | 
HTTP response status codes for "List SCIM provisioned identities for an enterprise"
| Status code | Description | 
|---|---|
| 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 samples for "List SCIM provisioned identities for an enterprise"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/scim/v2/enterprises/ENTERPRISE/UsersSuccess, either users were found or not found
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:api:messages:2.0:ListResponse"
  ],
  "totalResults": 1,
  "Resources": [
    {
      "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User"
      ],
      "externalId": "E012345",
      "id": "7fce0092-d52e-4f76-b727-3955bd72c939",
      "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
        }
      ]
    }
  ],
  "startIndex": 1,
  "itemsPerPage": 20
}Provision a SCIM enterprise user
Creates an external identity for a new SCIM enterprise user.
SCIM is responsible for user provisioning, not authentication. The actual user authentication is handled by SAML. However, with SCIM enabled, users must first be provisioned via SCIM before they can sign in through SAML.
Fine-grained access tokens for "Provision a SCIM enterprise user"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Provision a SCIM enterprise user"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | |||||
|---|---|---|---|---|---|
| schemasarray of strings RequiredThe URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are:  | |||||
| externalIdstring RequiredA unique identifier for the resource as defined by the provisioning client. | |||||
| activeboolean RequiredWhether the user active in the IdP. | |||||
| userNamestring RequiredThe username for the user. | |||||
| nameobject | |||||
| Properties of  | 
| Name, Type, Description | 
|---|
| formattedstringThe full name, including all middle names, titles, and suffixes as appropriate, formatted for display. | 
| familyNamestring RequiredThe family name of the user. | 
| givenNamestring RequiredThe given name of the user. | 
| middleNamestringThe middle name(s) of the user. | 
displayName string RequiredA human-readable name for the user.
emails array of objects RequiredThe emails for the user.
Properties of emails
| Name, Type, Description | 
|---|
| valuestring RequiredThe email address. | 
| typestring RequiredThe type of email address. | 
| primaryboolean RequiredWhether this email address is the primary address. | 
roles array of objects The roles assigned to the user.
Properties of roles
| Name, Type, Description | 
|---|
| displaystring | 
| typestring | 
| valuestring RequiredThe role value representing a user role in GitHub. Can be one of:  | 
| primarybooleanIs the role a primary role for the user. | 
HTTP response status codes for "Provision a SCIM enterprise user"
| Status code | Description | 
|---|---|
| 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 samples for "Provision a SCIM enterprise user"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request examples
curl -L \
  -X POST \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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}]}'User has been created
Status: 201{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "7fce0092-d52e-4f76-b727-3955bd72c939",
  "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
    }
  ],
  "meta": {
    "resourceType": "User",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
  }
}Get SCIM provisioning information for an enterprise user
Gets information about a SCIM user.
Fine-grained access tokens for "Get SCIM provisioning information for an enterprise user"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (read)
Parameters for "Get SCIM provisioning information for an enterprise user"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_user_idstring RequiredThe unique identifier of the SCIM user. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
HTTP response status codes for "Get SCIM provisioning information for an enterprise user"
| Status code | Description | 
|---|---|
| 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 samples for "Get SCIM provisioning information for an enterprise user"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_IDSuccess, a user was found
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "7fce0092-d52e-4f76-b727-3955bd72c939",
  "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
    }
  ],
  "meta": {
    "resourceType": "User",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
  }
}Set SCIM information for a provisioned enterprise user
Replaces an existing provisioned user's information.
You must supply complete user information, just as you would when provisioning them initially. Any previously existing data not provided will be deleted. To update only a specific attribute, refer to the Update an attribute for a SCIM user endpoint.
Warning
Setting active: false will suspend a user, and their handle and email will be obfuscated.
Fine-grained access tokens for "Set SCIM information for a provisioned enterprise user"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Set SCIM information for a provisioned enterprise user"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_user_idstring RequiredThe unique identifier of the SCIM user. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | |||||
|---|---|---|---|---|---|
| schemasarray of strings RequiredThe URIs that are used to indicate the namespaces of the SCIM schemas.
Supported values are:  | |||||
| externalIdstring RequiredA unique identifier for the resource as defined by the provisioning client. | |||||
| activeboolean RequiredWhether the user active in the IdP. | |||||
| userNamestring RequiredThe username for the user. | |||||
| nameobject | |||||
| Properties of  | 
| Name, Type, Description | 
|---|
| formattedstringThe full name, including all middle names, titles, and suffixes as appropriate, formatted for display. | 
| familyNamestring RequiredThe family name of the user. | 
| givenNamestring RequiredThe given name of the user. | 
| middleNamestringThe middle name(s) of the user. | 
displayName string RequiredA human-readable name for the user.
emails array of objects RequiredThe emails for the user.
Properties of emails
| Name, Type, Description | 
|---|
| valuestring RequiredThe email address. | 
| typestring RequiredThe type of email address. | 
| primaryboolean RequiredWhether this email address is the primary address. | 
roles array of objects The roles assigned to the user.
Properties of roles
| Name, Type, Description | 
|---|
| displaystring | 
| typestring | 
| valuestring RequiredThe role value representing a user role in GitHub. Can be one of:  | 
| primarybooleanIs the role a primary role for the user. | 
HTTP response status codes for "Set SCIM information for a provisioned enterprise user"
| Status code | Description | 
|---|---|
| 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 samples for "Set SCIM information for a provisioned enterprise user"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -X PUT \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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}]}'User was updated
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "7fce0092-d52e-4f76-b727-3955bd72c939",
  "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
    }
  ],
  "meta": {
    "resourceType": "User",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
  }
}Update an attribute for a SCIM enterprise user
Update a provisioned user's individual attributes.
To modify a user's attributes, you'll need to provide a Operations JSON formatted request that includes at least one of the following actions: add, remove, or replace. For specific examples and more information on the SCIM operations format, please refer to the SCIM specification.
Note
Complex SCIM path selectors that include filters are not supported. For example, a path selector defined as "path": "emails[type eq \"work\"]" will be ineffective.
Warning
Setting active: false will suspend a user, and their handle and email will be obfuscated.
{
  "Operations":[{
    "op":"replace",
    "value":{
      "active":false
    }
  }]
}
Fine-grained access tokens for "Update an attribute for a SCIM enterprise user"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Update an attribute for a SCIM enterprise user"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_user_idstring RequiredThe unique identifier of the SCIM user. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
| Name, Type, Description | ||||
|---|---|---|---|---|
| Operationsarray of objects Requiredpatch operations list | ||||
| Properties of  | 
| Name, Type, Description | 
|---|
| opstring RequiredCan be one of:  | 
| pathstring | 
| valuestringCorresponding 'value' of that field specified by 'path' | 
schemas array of strings RequiredundefinedSupported values are: urn:ietf:params:scim:api:messages:2.0:PatchOp
HTTP response status codes for "Update an attribute for a SCIM enterprise user"
| Status code | Description | 
|---|---|
| 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 samples for "Update an attribute for a SCIM enterprise user"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request examples
curl -L \
  -X PATCH \
  -H "Accept: application/scim+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/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"}]}'Success, user was updated
Status: 200{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:User"
  ],
  "id": "7fce0092-d52e-4f76-b727-3955bd72c939",
  "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
    }
  ],
  "meta": {
    "resourceType": "User",
    "created": "2012-03-27T19:59:26.000Z",
    "lastModified": "2018-03-27T19:59:26.000Z",
    "location": "https://api.github.localhost/scim/v2/Users/7fce0092-d52e-4f76-b727-3955bd72c939"
  }
}Delete a SCIM user from an enterprise
Suspends a SCIM user permanently from an enterprise. This action will: remove all the user's data, anonymize their login, email, and display name, erase all external identity SCIM attributes, delete the user's emails, avatar, PATs, SSH keys, OAuth authorizations, GPG keys, and SAML mappings. This action is irreversible.
Fine-grained access tokens for "Delete a SCIM user from an enterprise"
This endpoint works with the following fine-grained token types:
The fine-grained token must have the following permission set:
- "Enterprise SCIM" enterprise permissions (write)
Parameters for "Delete a SCIM user from an enterprise"
| Name, Type, Description | 
|---|
| acceptstringSetting to  | 
| Name, Type, Description | 
|---|
| scim_user_idstring RequiredThe unique identifier of the SCIM user. | 
| enterprisestring RequiredThe slug version of the enterprise name. | 
HTTP response status codes for "Delete a SCIM user from an enterprise"
| Status code | Description | 
|---|---|
| 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 samples for "Delete a SCIM user from an enterprise"
If you access GitHub at GHE.com, replace api.github.com with your enterprise's dedicated subdomain at api.SUBDOMAIN.ghe.com.
Request example
curl -L \
  -X DELETE \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_IDUser was deleted, no content
Status: 204