Skip to main content
We publish frequent updates to our documentation, and translation of this page may still be in progress. For the most current information, please visit the English documentation.

We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the Actions REST API page.

SCIM

Utilisez l’API REST pour automatiser la création d’utilisateurs et les appartenances aux équipes avec SCIM.

À propos de SCIM

Remarque : SCIM pour GitHub Enterprise Server est en version bêta privée et est susceptible de changer. Pour accéder à la bêta, contactez votre responsable de compte dans l’GitHub's Sales team. Veuillez fournir vos commentaires dans la discussion de GitHub Community.

Avertissement : La bêta est exclusivement destinée aux tests et aux commentaires. Aucun support n’est disponible. GitHub recommande d’effectuer les tests avec une instance de préproduction. Pour plus d’informations, consultez « Configuration d’une instance intermédiaire ».

GitHub Enterprise Server fournit des points de terminaison destinés aux fournisseurs d’identité (IdP) prenant en charge SCIM. Une intégration sur l’IdP peut utiliser l’API REST pour provisionner, gérer ou déprovisionner automatiquement des comptes d’utilisateur sur une instance GitHub Enterprise Server qui utilise l’authentification unique (SSO) SAML pour l’authentification. Pour plus d’informations sur l’authentification unique SAML, consultez « À propos de SAML pour la gestion des identités et des accès d’entreprise ».

Ces points de terminaison sont basés sur SCIM 2.0. Pour en savoir plus, consultez la spécification.

URL racine

Un fournisseur d’identité peut utiliser l’URL racine suivante afin de communiquer avec les points de terminaison pour une instance GitHub Enterprise Server.

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

Les points de terminaison de cette catégorie respectent la casse. Par exemple, la première lettre du point de terminaison Users doit être en majuscule.

GET /scim/v2/Users/{scim_user_id}

Authentification

L’intégration SCIM sur l’idP effectue des actions pour le compte d’un propriétaire d’entreprise pour l’instance GitHub Enterprise Server. Pour plus d’informations, consultez « Rôles dans une entreprise ».

Pour authentifier les demandes adressées à l’API, la personne qui configure SCIM sur l’IdP doit utiliser un personal access token avec l’étendue admin:enterprise, que l’IdP doit fournir dans l’en-tête Authorization de la demande. Pour plus d’informations sur les personal access tokens, consultez « Création d’un personal access token ».

Remarque : Les propriétaires d’entreprise doivent générer et utiliser un personal access token pour l’authentification des demandes adressées aux points de terminaison. Les appelants d’application GitHub ne sont pas pris en charge.

Mappage des données SAML et SCIM

L’instance GitHub Enterprise Server lie chaque utilisateur qui s’authentifie avec succès avec l’authentification unique SAML à une identité SCIM. Pour lier correctement les identités, le fournisseur d’identité SAML et l’intégration SCIM doivent utiliser des valeurs SAML NameID et SCIM userName correspondantes pour chaque utilisateur.

Attributs utilisateur SCIM pris en charge

Les points de terminaison User dans cette catégorie prennent en charge les attributs suivants dans les paramètres d’une demande.

NomTypeDescription
displayNameStringNom lisible pour un utilisateur.
name.formattedStringNom complet de l’utilisateur, y compris tous les prénoms, titres et suffixes, mis en forme pour l’affichage.
name.givenNameStringPrénom de l’utilisateur.
name.familyNameStringNom de l’utilisateur.
userNameStringNom d’utilisateur de l’utilisateur, généré par le fournisseur d’identité. Subit la normalisation avant d’être utilisé.
emailsArrayListe des e-mails de l’utilisateur.
rolesArrayListe des rôles de l’utilisateur.
externalIdStringCet identificateur est généré par un fournisseur d’identité. Vous pouvez trouver l’externalId pour un utilisateur sur l’IdP ou en utilisant le point de terminaison Lister les identités provisionnées SCIM et en filtrant sur d’autres attributs connus, tels que le nom d’utilisateur ou l’adresse e-mail d’un utilisateur sur l’instance GitHub Enterprise Server.
idStringIdentificateur généré par le point de terminaison SCIM de l’instance.
activeBooleanIndique si l’identité est active (true) ou doit être suspendue (false).

List provisioned SCIM groups for an enterprise

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Query parameters
Nom, Type, Description
filterstring

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'".

excludedAttributesstring

Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time.

startIndexinteger

Used for pagination: the starting index of the first result to return when paginating through values.

Default: 1

countinteger

Used for pagination: the number of results to return per page.

Default: 30

HTTP response status codes

Status codeDescription
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

get/scim/v2/Groups
curl \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Groups

Success, 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": "927fa2c08dcb4a7fae9e", "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/927fa2c08dcb4a7fae9e" } } ], "startIndex": 1, "itemsPerPage": 20 }

Provision a SCIM enterprise group

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Body parameters
Nom, Type, Description
schemasarray of stringsRequired

The URIs that are used to indicate the namespaces of the SCIM schemas.

externalIdstringRequired

A unique identifier for the resource as defined by the provisioning client.

displayNamestringRequired

A human-readable name for a security group.

membersarray of objectsRequired

The group members.

Nom, Type, Description
valuestringRequired

The local unique identifier for the member

displayNamestringRequired

The display name associated with the member

HTTP response status codes

Status codeDescription
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

post/scim/v2/Groups
curl \ -X POST \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Groups \ -d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"externalId":"8aa1a0c0-c4c3-4bc0-b4a5-2ef676900159","displayName":"Engineering"}'

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/927fa2c08dcb4a7fae9e" } }

Get SCIM provisioning information for an enterprise group

Works with GitHub Apps

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

Gets information about a SCIM group.

Parameters

Headers
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_group_idstringRequired

A unique identifier of the SCIM group.

Query parameters
Nom, Type, Description
excludedAttributesstring

Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time.

HTTP response status codes

Status codeDescription
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

get/scim/v2/Groups/{scim_group_id}
curl \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Groups/SCIM_GROUP_ID

Success, 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/927fa2c08dcb4a7fae9e" } }

Set SCIM information for a provisioned enterprise group

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_group_idstringRequired

A unique identifier of the SCIM group.

Body parameters
Nom, Type, Description
schemasarray of stringsRequired

The URIs that are used to indicate the namespaces of the SCIM schemas.

externalIdstringRequired

A unique identifier for the resource as defined by the provisioning client.

displayNamestringRequired

A human-readable name for a security group.

membersarray of objectsRequired

The group members.

Nom, Type, Description
valuestringRequired

The local unique identifier for the member

displayNamestringRequired

The display name associated with the member

HTTP response status codes

Status codeDescription
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

put/scim/v2/Groups/{scim_group_id}
curl \ -X PUT \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/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/927fa2c08dcb4a7fae9e" } }

Update an attribute for a SCIM enterprise group

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_group_idstringRequired

A unique identifier of the SCIM group.

Body parameters
Nom, Type, Description
Operationsarray of objectsRequired

patch operations list

Nom, Type, Description
opstringRequired

Can be one of: add, replace, remove

pathstring
valuestring

Corresponding 'value' of that field specified by 'path'

schemasarray of stringsRequired

HTTP response status codes

Status codeDescription
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

patch/scim/v2/Groups/{scim_group_id}
curl \ -X PATCH \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/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/927fa2c08dcb4a7fae9e" } }

Delete a SCIM group from an enterprise

Works with GitHub Apps

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

Deletes a SCIM group from an enterprise.

Parameters

Headers
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_group_idstringRequired

A unique identifier of the SCIM group.

HTTP response status codes

Status codeDescription
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

delete/scim/v2/Groups/{scim_group_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Groups/SCIM_GROUP_ID

Group was deleted, no content

Status: 204

List SCIM provisioned identities for an enterprise

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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.

You can improve query search time by using the excludedAttributes query parameter with a value of groups to exclude groups from the response.

Parameters

Headers
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Query parameters
Nom, Type, Description
filterstring

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'".

excludedAttributesstring

Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time.

startIndexinteger

Used for pagination: the starting index of the first result to return when paginating through values.

Default: 1

countinteger

Used for pagination: the number of results to return per page.

Default: 30

HTTP response status codes

Status codeDescription
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

get/scim/v2/Users
curl \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Users

Success, 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

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Body parameters
Nom, Type, Description
schemasarray of stringsRequired

The URIs that are used to indicate the namespaces of the SCIM schemas.

externalIdstringRequired

A unique identifier for the resource as defined by the provisioning client.

activebooleanRequired

Whether the user active in the IdP.

userNamestringRequired

The username for the user.

nameobject
Nom, Type, Description
formattedstring

The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.

familyNamestringRequired

The family name of the user.

givenNamestringRequired

The given name of the user.

middleNamestring

The middle name(s) of the user.

displayNamestringRequired

A human-readable name for the user.

emailsarray of objectsRequired

The emails for the user.

Nom, Type, Description
valuestringRequired

The email address.

typestringRequired

The type of email address.

primarybooleanRequired

Whether this email address is the primary address.

rolesarray of objects

The roles assigned to the user.

Nom, Type, Description
displaystring
typestring
valuestringRequired

The role value representing a user role in GitHub.

Can be one of: User, user, 27d9891d-2c17-4f45-a262-781a0e55c80a, Restricted User, restricted_user, 1ebc4a02-e56c-43a6-92a5-02ee09b90824, Enterprise Owner, enterprise_owner, 981df190-8801-4618-a08a-d91f6206c954, ba4987ab-a1c3-412a-b58c-360fc407cb10, Billing Manager, billing_manager, 0e338b8c-cc7f-498a-928d-ea3470d7e7e3, e6be2762-e4ad-4108-b72d-1bbe884a0f91

primaryboolean

Is the role a primary role for the user.

HTTP response status codes

Status codeDescription
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

post/scim/v2/Users
curl \ -X POST \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/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

Works with GitHub Apps

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

Gets information about a SCIM user.

Parameters

Headers
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_user_idstringRequired

The unique identifier of the SCIM user.

HTTP response status codes

Status codeDescription
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

get/scim/v2/Users/{scim_user_id}
curl \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Users/SCIM_USER_ID

Success, 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

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_user_idstringRequired

The unique identifier of the SCIM user.

Body parameters
Nom, Type, Description
schemasarray of stringsRequired

The URIs that are used to indicate the namespaces of the SCIM schemas.

externalIdstringRequired

A unique identifier for the resource as defined by the provisioning client.

activebooleanRequired

Whether the user active in the IdP.

userNamestringRequired

The username for the user.

nameobject
Nom, Type, Description
formattedstring

The full name, including all middle names, titles, and suffixes as appropriate, formatted for display.

familyNamestringRequired

The family name of the user.

givenNamestringRequired

The given name of the user.

middleNamestring

The middle name(s) of the user.

displayNamestringRequired

A human-readable name for the user.

emailsarray of objectsRequired

The emails for the user.

Nom, Type, Description
valuestringRequired

The email address.

typestringRequired

The type of email address.

primarybooleanRequired

Whether this email address is the primary address.

rolesarray of objects

The roles assigned to the user.

Nom, Type, Description
displaystring
typestring
valuestringRequired

The role value representing a user role in GitHub.

Can be one of: User, user, 27d9891d-2c17-4f45-a262-781a0e55c80a, Restricted User, restricted_user, 1ebc4a02-e56c-43a6-92a5-02ee09b90824, Enterprise Owner, enterprise_owner, 981df190-8801-4618-a08a-d91f6206c954, ba4987ab-a1c3-412a-b58c-360fc407cb10, Billing Manager, billing_manager, 0e338b8c-cc7f-498a-928d-ea3470d7e7e3, e6be2762-e4ad-4108-b72d-1bbe884a0f91

primaryboolean

Is the role a primary role for the user.

HTTP response status codes

Status codeDescription
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

put/scim/v2/Users/{scim_user_id}
curl \ -X PUT \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/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

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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, for Okta, the user GDPR data will not be purged and the credentials will not be removed.

{
  "Operations":[{
    "op":"replace",
    "value":{
      "active":false
    }
  }]
}

Parameters

Headers
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_user_idstringRequired

The unique identifier of the SCIM user.

Body parameters
Nom, Type, Description
Operationsarray of objectsRequired

patch operations list

Nom, Type, Description
opstringRequired

Can be one of: add, replace, remove

pathstring
valuestring

Corresponding 'value' of that field specified by 'path'

schemasarray of stringsRequired

HTTP response status codes

Status codeDescription
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

patch/scim/v2/Users/{scim_user_id}
curl \ -X PATCH \ -H "Accept: application/scim+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/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

Works with GitHub Apps

Note: The SCIM API endpoints for enterprise accounts are currently in private beta 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
Nom, Type, Description
acceptstring

Setting to application/vnd.github+json is recommended.

Path parameters
Nom, Type, Description
scim_user_idstringRequired

The unique identifier of the SCIM user.

HTTP response status codes

Status codeDescription
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

delete/scim/v2/Users/{scim_user_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/scim/v2/Users/SCIM_USER_ID

User was deleted, no content

Status: 204