Skip to main content

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

List provisioned SCIM groups for an enterprise

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

参数

标头
名称, 类型, 描述
acceptstring

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

路径参数
名称, 类型, 描述
enterprisestring必选

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

查询参数
名称, 类型, 描述
startIndexinteger

Used for pagination: the index of the first result to return.

countinteger

Used for pagination: the number of results to return.

filterstring

filter results

excludedAttributesstring

attributes to exclude

HTTP 响应状态代码

状态代码描述
200

OK

代码示例

get/scim/v2/enterprises/{enterprise}/Groups
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups

Response

Status: 200
{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:ListResponse" ], "totalResults": 2, "itemsPerPage": 2, "startIndex": 1, "Resources": [ { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Group" ], "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc", "externalId": null, "displayName": "octo-org", "members": [ { "value": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "display": "octocat@github.com" }, { "value": "aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "display": "hubot@example.com" } ], "meta": { "resourceType": "Group", "created": "2020-06-09T03:10:17.000+10:00", "lastModified": "2020-06-09T03:10:17.000+10:00", "location": "https://api.github.com/scim/v2/enterprises/octo-corp/Groups/abcd27f8-a9aa-11ea-8221-f59b2be9cccc" } }, { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Group" ], "id": "5e75bbbb-aa1a-11ea-8644-75ff655cdddd", "externalId": null, "displayName": "octo-docs-org", "members": [ { "value": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "display": "octocat@github.com" } ], "meta": { "resourceType": "Group", "created": "2020-06-09T16:28:01.000+10:00", "lastModified": "2020-06-09T16:28:01.000+10:00", "location": "https://api.github.com/scim/v2/enterprises/octo-corp/Groups/5e75bbbb-aa1a-11ea-8644-75ff655cdddd" } } ] }

Provision a SCIM enterprise group and invite users

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

Provision an enterprise group, and invite users to the group. This sends invitation emails to the email address of the invited users to join the GitHub organization that the SCIM group corresponds to.

参数

标头
名称, 类型, 描述
acceptstring

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

路径参数
名称, 类型, 描述
enterprisestring必选

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

正文参数
名称, 类型, 描述
schemasarray of strings必选

The SCIM schema URIs.

displayNamestring必选

The name of the SCIM group. This must match the GitHub organization that the group maps to.

membersarray of objects
名称, 类型, 描述
valuestring必选

The SCIM user ID for a user.

HTTP 响应状态代码

状态代码描述
201

Created

代码示例

post/scim/v2/enterprises/{enterprise}/Groups
curl \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups \ -d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"displayName":"octo-org","members":[{"value":"92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"},{"value":"aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5"}]}'

Response

Status: 201
{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Group" ], "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc", "externalId": null, "displayName": "octo-org", "members": [ { "value": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "display": "octocat@github.com" }, { "value": "aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "display": "hubot@example.com" } ], "meta": { "resourceType": "Group", "created": "2020-06-09T03:10:17.000+10:0", "lastModified": "2020-06-09T03:10:17.000+10:00", "location": "https://api.github.com/scim/v2/enterprises/octo-corp/Groups/abcd27f8-a9aa-11ea-8221-f59b2be9cccc" } }

Get SCIM provisioning information for an enterprise group

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

参数

标头
名称, 类型, 描述
acceptstring

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

路径参数
名称, 类型, 描述
enterprisestring必选

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

scim_group_idstring必选

Identifier generated by the GitHub SCIM endpoint.

查询参数
名称, 类型, 描述
excludedAttributesstring

Attributes to exclude.

HTTP 响应状态代码

状态代码描述
200

OK

代码示例

get/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID

Response

Status: 200
{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Group" ], "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc", "externalId": null, "displayName": "octo-org", "members": [ { "value": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "display": "octocat@github.com" }, { "value": "aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "display": "hubot@example.com" } ], "meta": { "resourceType": "Group", "created": "2020-06-09T03:10:17.000+10:0", "lastModified": "2020-06-09T03:10:17.000+10:00", "location": "https://api.github.com/scim/v2/enterprises/octo-corp/Groups/abcd27f8-a9aa-11ea-8221-f59b2be9cccc" } }

Set SCIM information for a provisioned enterprise group

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

参数

标头
名称, 类型, 描述
acceptstring

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

路径参数
名称, 类型, 描述
enterprisestring必选

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

scim_group_idstring必选

Identifier generated by the GitHub SCIM endpoint.

正文参数
名称, 类型, 描述
schemasarray of strings必选

The SCIM schema URIs.

displayNamestring必选

The name of the SCIM group. This must match the GitHub organization that the group maps to.

membersarray of objects
名称, 类型, 描述
valuestring必选

The SCIM user ID for a user.

HTTP 响应状态代码

状态代码描述
200

OK

代码示例

put/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
curl \ -X PUT \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \ -d '{"schemas":["urn:ietf:params:scim:schemas:core:2.0:Group"],"displayName":"octo-org","members":[{"value":"92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"},{"value":"aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5"}]}'

Response

Status: 200
{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Group" ], "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc", "externalId": null, "displayName": "octo-org", "members": [ { "value": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "display": "octocat@github.com" }, { "value": "aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5", "display": "hubot@example.com" } ], "meta": { "resourceType": "Group", "created": "2020-06-09T03:10:17.000+10:0", "lastModified": "2020-06-09T03:10:17.000+10:00", "location": "https://api.github.com/scim/v2/enterprises/octo-corp/Groups/abcd27f8-a9aa-11ea-8221-f59b2be9cccc" } }

Update an attribute for a SCIM enterprise group

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

Allows you to change 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.

参数

标头
名称, 类型, 描述
acceptstring

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

路径参数
名称, 类型, 描述
enterprisestring必选

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

scim_group_idstring必选

Identifier generated by the GitHub SCIM endpoint.

正文参数
名称, 类型, 描述
schemasarray of strings必选

The SCIM schema URIs.

Operationsarray of objects必选

Array of SCIM operations.

名称, 类型, 描述
opstring必选

可以是以下其中之一: add, Add, remove, Remove, replace, Replace

pathstring
value

Can be any value - string, number, array or object.

HTTP 响应状态代码

状态代码描述
200

OK

代码示例

patch/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \ -d '{"schemas":["urn:ietf:params:scim:api:messages:2.0:PatchOp"],"Operations":[{"op":"remove","path":"members","value":[{"value":"aaaa8c34-a6b2-11ea-9d70-bbbbbd1c8fd5"}]}]}'

Response

Status: 200
{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:Group" ], "id": "abcd27f8-a9aa-11ea-8221-f59b2be9cccc", "externalId": null, "displayName": "octo-org", "members": [ { "value": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "$ref": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc", "display": "octocat@github.com" } ], "meta": { "resourceType": "Group", "created": "2020-06-09T03:10:17.000+10:00", "lastModified": "2020-06-09T03:10:17.000+10:00", "location": "https://api.github.com/scim/v2/enterprises/octo-corp/Groups/abcd27f8-a9aa-11ea-8221-f59b2be9cccc" } }

Delete a SCIM group from an enterprise

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

参数

标头
名称, 类型, 描述
acceptstring

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

路径参数
名称, 类型, 描述
enterprisestring必选

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

scim_group_idstring必选

Identifier generated by the GitHub SCIM endpoint.

HTTP 响应状态代码

状态代码描述
204

No Content

代码示例

delete/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}
curl \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: token <TOKEN>" \ https://HOSTNAME/api/v3/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID

Response

Status: 204