Get the audit log for an enterprise
Gets the audit log for an enterprise. To use this endpoint, you must be an enterprise admin, and you must use an access token with the admin:enterprise scope.
get /enterprises/{enterprise}/audit-logParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
phrase | string | query | A search phrase. For more information, see Searching the audit log. |
include | string | query | The event types to include:
The default is |
after | string | query | A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. |
before | string | query | A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. |
order | string | query | The order of audit log events. To list newest events first, specify The default is |
page | integer | query | Page number of the results to fetch. Default: |
per_page | integer | query | Results per page (max 100) Default: |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/audit-log await octokit.request('GET /enterprises/{enterprise}/audit-log', {
enterprise: 'enterprise'
})Response
Status: 200 OK [
{
"@timestamp": 1606929874512,
"action": "team.add_member",
"actor": "octocat",
"created_at": 1606929874512,
"_document_id": "xJJFlFOhQ6b-5vaAFy9Rjw",
"org": "octo-corp",
"team": "octo-corp/example-team",
"user": "monalisa"
},
{
"@timestamp": 1606507117008,
"action": "org.create",
"actor": "octocat",
"created_at": 1606507117008,
"_document_id": "Vqvg6kZ4MYqwWRKFDzlMoQ",
"org": "octocat-test-org"
},
{
"@timestamp": 1605719148837,
"action": "repo.destroy",
"actor": "monalisa",
"created_at": 1605719148837,
"_document_id": "LwW2vpJZCDS-WUmo9Z-ifw",
"org": "mona-org",
"repo": "mona-org/mona-test-repo",
"visibility": "private"
}
]Get GitHub Actions billing for an enterprise
Gets the summary of the free and paid GitHub Actions minutes used.
Paid minutes only apply to workflows in private repositories that use GitHub-hosted runners. Minutes used is listed for each GitHub-hosted runner operating system. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see "Managing billing for GitHub Actions".
The authenticated user must be an enterprise admin.
get /enterprises/{enterprise}/settings/billing/actionsParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/actions await octokit.request('GET /enterprises/{enterprise}/settings/billing/actions', {
enterprise: 'enterprise'
})Response
Status: 200 OK {
"total_minutes_used": 305,
"total_paid_minutes_used": 0,
"included_minutes": 3000,
"minutes_used_breakdown": {
"UBUNTU": 205,
"MACOS": 10,
"WINDOWS": 90
}
}Get GitHub Advanced Security active committers for an enterprise
Gets the GitHub Advanced Security active committers for an enterprise per repository. Each distinct user login across all repositories is counted as a single Advanced Security seat, so the total_advanced_security_committers is not the sum of active_users for each repository.
get /enterprises/{enterprise}/settings/billing/advanced-securityParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
per_page | integer | query | Results per page (max 100) Default: |
page | integer | query | Page number of the results to fetch. Default: |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/advanced-security await octokit.request('GET /enterprises/{enterprise}/settings/billing/advanced-security', {
enterprise: 'enterprise'
})Success
Status: 200 OK {
"total_advanced_security_committers": 2,
"repositories": [
{
"name": "octocat-org/Hello-World",
"advanced_security_committers": 2,
"advanced_security_committers_breakdown": [
{
"user_login": "octocat",
"last_pushed_date": "2021-11-03"
},
{
"user_login": "octokitten",
"last_pushed_date": "2021-10-25"
}
]
},
{
"name": "octocat-org/server",
"advanced_security_committers": 1,
"advanced_security_committers_breakdown": [
{
"user_login": "octokitten",
"last_pushed_date": "2021-10-26"
}
]
}
]
}Response if GitHub Advanced Security is not enabled for this repository
Status: 403 ForbiddenGet GitHub Packages billing for an enterprise
Gets the free and paid storage used for GitHub Packages in gigabytes.
Paid minutes only apply to packages stored for private repositories. For more information, see "Managing billing for GitHub Packages."
The authenticated user must be an enterprise admin.
get /enterprises/{enterprise}/settings/billing/packagesParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/packages await octokit.request('GET /enterprises/{enterprise}/settings/billing/packages', {
enterprise: 'enterprise'
})Response
Status: 200 OK {
"total_gigabytes_bandwidth_used": 50,
"total_paid_gigabytes_bandwidth_used": 40,
"included_gigabytes_bandwidth": 10
}Get shared storage billing for an enterprise
Gets the estimated paid and estimated total storage used for GitHub Actions and GitHub Packages.
Paid minutes only apply to packages stored for private repositories. For more information, see "Managing billing for GitHub Packages."
The authenticated user must be an enterprise admin.
get /enterprises/{enterprise}/settings/billing/shared-storageParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/enterprises/ENTERPRISE/settings/billing/shared-storage await octokit.request('GET /enterprises/{enterprise}/settings/billing/shared-storage', {
enterprise: 'enterprise'
})Response
Status: 200 OK {
"days_left_in_billing_cycle": 20,
"estimated_paid_storage_for_month": 15,
"estimated_storage_for_month": 40
}List provisioned SCIM groups for an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
get /scim/v2/enterprises/{enterprise}/GroupsParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
startIndex | integer | query | Used for pagination: the index of the first result to return. |
count | integer | query | Used for pagination: the number of results to return. |
filter | string | query | filter results |
excludedAttributes | string | query | attributes to exclude |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups await octokit.request('GET /scim/v2/enterprises/{enterprise}/Groups', {
enterprise: 'enterprise'
})Response
Status: 200 OK {
"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"
}
}
]
}Notes
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.
post /scim/v2/enterprises/{enterprise}/GroupsParameters
| Name | Type | In | Description | ||||
|---|---|---|---|---|---|---|---|
accept | string | header | Setting to | ||||
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. | ||||
schemas | array of strings | body | Required. The SCIM schema URIs. | ||||
displayName | string | body | Required. The name of the SCIM group. This must match the GitHub organization that the group maps to. | ||||
members | array of objects | body | |||||
Properties of the | |||||||
| Name (Type) | Description |
|---|---|
value (string) | Required. The SCIM user ID for a user. |
Code samples
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups \
-d '{"schemas":["schemas"],"displayName":"displayName"}' await octokit.request('POST /scim/v2/enterprises/{enterprise}/Groups', {
enterprise: 'enterprise',
schemas: [
'schemas'
],
displayName: 'displayName'
})Response
Status: 201 Created {
"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"
}
}Notes
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.
get /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
scim_group_id | string | path | Identifier generated by the GitHub SCIM endpoint. |
excludedAttributes | string | query | Attributes to exclude. |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID await octokit.request('GET /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}', {
enterprise: 'enterprise',
scim_group_id: 'scim_group_id'
})Response
Status: 200 OK {
"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"
}
}Notes
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.
put /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}Parameters
| Name | Type | In | Description | ||||
|---|---|---|---|---|---|---|---|
accept | string | header | Setting to | ||||
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. | ||||
scim_group_id | string | path | Identifier generated by the GitHub SCIM endpoint. | ||||
schemas | array of strings | body | Required. The SCIM schema URIs. | ||||
displayName | string | body | Required. The name of the SCIM group. This must match the GitHub organization that the group maps to. | ||||
members | array of objects | body | |||||
Properties of the | |||||||
| Name (Type) | Description |
|---|---|
value (string) | Required. The SCIM user ID for a user. |
Code samples
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
-d '{"schemas":["schemas"],"displayName":"displayName"}' await octokit.request('PUT /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}', {
enterprise: 'enterprise',
scim_group_id: 'scim_group_id',
schemas: [
'schemas'
],
displayName: 'displayName'
})Response
Status: 200 OK {
"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"
}
}Notes
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.
patch /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}Parameters
| Name | Type | In | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
accept | string | header | Setting to | ||||||||
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. | ||||||||
scim_group_id | string | path | Identifier generated by the GitHub SCIM endpoint. | ||||||||
schemas | array of strings | body | Required. The SCIM schema URIs. | ||||||||
Operations | array of objects | body | Required. Array of SCIM operations. | ||||||||
Properties of the | |||||||||||
| Name (Type) | Description |
|---|---|
op (string) | Required. |
path (string) | |
value () | Can be any value - string, number, array or object. |
Code samples
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID \
-d '{"schemas":["schemas"],"Operations":[{"op":"op","path":"path","value":"any"}]}' await octokit.request('PATCH /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}', {
enterprise: 'enterprise',
scim_group_id: 'scim_group_id',
schemas: [
'schemas'
],
Operations: [
{
op: 'op',
path: 'path',
value: 'any'
}
]
})Response
Status: 200 OK {
"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"
}
}Notes
Delete a SCIM group from an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
delete /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
scim_group_id | string | path | Identifier generated by the GitHub SCIM endpoint. |
Code samples
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Groups/SCIM_GROUP_ID await octokit.request('DELETE /scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}', {
enterprise: 'enterprise',
scim_group_id: 'scim_group_id'
})Response
Status: 204 No ContentNotes
List SCIM provisioned identities for an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Retrieves a paginated list of all provisioned enterprise members, including pending invitations.
When a user with a SAML-provisioned external identity leaves (or is removed from) an enterprise, the account's metadata is immediately removed. However, the returned list of user accounts might not always match the organization or enterprise member list you see on GitHub. This can happen in certain cases where an external identity associated with an organization will not match an organization member:
- When a user with a SCIM-provisioned external identity is removed from an enterprise, the account's metadata is preserved to allow the user to re-join the organization in the future.
- When inviting a user to join an organization, you can expect to see their external identity in the results before they accept the invitation, or if the invitation is cancelled (or never accepted).
- When a user is invited over SCIM, an external identity is created that matches with the invitee's email address. However, this identity is only linked to a user account when the user accepts the invitation by going through SAML SSO.
The returned list of external identities can include an entry for a null user. These are unlinked SAML identities that are created when a user goes through the following Single Sign-On (SSO) process but does not sign in to their GitHub account after completing SSO:
-
The user is granted access by the IdP and is not a member of the GitHub enterprise.
-
The user attempts to access the GitHub enterprise and initiates the SAML SSO process, and is not currently signed in to their GitHub account.
-
After successfully authenticating with the SAML SSO IdP, the
nullexternal identity entry is created and the user is prompted to sign in to their GitHub account:- If the user signs in, their GitHub account is linked to this entry.
- If the user does not sign in (or does not create a new account when prompted), they are not added to the GitHub enterprise, and the external identity
nullentry remains in place.
get /scim/v2/enterprises/{enterprise}/UsersParameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
startIndex | integer | query | Used for pagination: the index of the first result to return. |
count | integer | query | Used for pagination: the number of results to return. |
filter | string | query | filter results |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users await octokit.request('GET /scim/v2/enterprises/{enterprise}/Users', {
enterprise: 'enterprise'
})Response
Status: 200 OK {
"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:User"
],
"id": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc",
"externalId": "00dowz5dr9oSfDFRA0h7",
"userName": "octocat@github.com",
"name": {
"givenName": "Mona",
"familyName": "Octocat"
},
"emails": [
{
"value": "octocat@github.com",
"primary": true,
"type": "work"
}
],
"groups": [
{
"value": "468dd3fa-a1d6-11ea-9031-15a1f0d7811d"
}
],
"active": true,
"meta": {
"resourceType": "User",
"created": "2020-05-30T04:02:34.000+10:00",
"lastModified": "2020-05-30T04:05:04.000+10:00",
"location": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"
}
},
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "e18b8c34-a6b2-11ea-9d70-54abbd1c8fd5",
"externalId": "sdfoiausdofiua",
"userName": "hubot@example.com",
"name": {
"givenName": "hu",
"familyName": "bot"
},
"emails": [
{
"value": "hubot@example.com",
"type": "work",
"primary": true
}
],
"groups": [],
"active": true,
"meta": {
"resourceType": "User",
"created": "2020-06-05T08:29:40.000+10:00",
"lastModified": "2020-06-05T08:30:19.000+10:00",
"location": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/e18b8c34-a6b2-11ea-9d70-54abbd1c8fd5"
}
}
]
}Notes
Provision and invite a SCIM enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Provision enterprise membership for a user, and send organization invitation emails to the email address.
You can optionally include the groups a user will be invited to join. If you do not provide a list of groups, the user is provisioned for the enterprise, but no organization invitation emails will be sent.
post /scim/v2/enterprises/{enterprise}/UsersParameters
| Name | Type | In | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
accept | string | header | Setting to | ||||||||
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. | ||||||||
schemas | array of strings | body | Required. The SCIM schema URIs. | ||||||||
userName | string | body | Required. The username for the user. | ||||||||
name | object | body | Required. | ||||||||
Properties of the | |||||||||||
| Name (Type) | Description |
|---|---|
givenName (string) | Required. The first name of the user. |
familyName (string) | Required. The last name of the user. |
emailsRequired. List of user emails.
Properties of theemailsitems
| Name (Type) | Description |
|---|---|
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. |
groupsList of SCIM group IDs the user is a member of.
Properties of thegroupsitems
| Name (Type) | Description |
|---|---|
value (string) |
Code samples
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users \
-d '{"schemas":["schemas"],"userName":"userName","name":{"givenName":"givenName","familyName":"familyName"},"emails":["octocat@github.com"]}' await octokit.request('POST /scim/v2/enterprises/{enterprise}/Users', {
enterprise: 'enterprise',
schemas: [
'schemas'
],
userName: 'userName',
name: {
givenName: 'givenName',
familyName: 'familyName'
},
emails: [
'octocat@github.com'
]
})Response
Status: 201 Created {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc",
"externalId": "00dowz5dr9oSfDFRA0h7",
"userName": "mona.octocat@okta.example.com",
"name": {
"givenName": "Mona",
"familyName": "Octocat"
},
"emails": [
{
"value": "mona.octocat@okta.example.com",
"type": "work",
"primary": true
}
],
"groups": [
{
"value": "468dd3fa-a1d6-11ea-9031-15a1f0d7811d"
}
],
"active": true,
"meta": {
"resourceType": "User",
"created": "2017-03-09T16:11:13-05:00",
"lastModified": "2017-03-09T16:11:13-05:00",
"location": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"
}
}Notes
Get SCIM provisioning information for an enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
get /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
scim_user_id | string | path | scim_user_id parameter |
Code samples
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID await octokit.request('GET /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}', {
enterprise: 'enterprise',
scim_user_id: 'scim_user_id'
})Response
Status: 200 OK {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc",
"externalId": "00dowz5dr9oSfDFRA0h7",
"userName": "mona.octocat@okta.example.com",
"name": {
"givenName": "Mona",
"familyName": "Octocat"
},
"emails": [
{
"value": "mona.octocat@okta.example.com",
"type": "work",
"primary": true
}
],
"groups": [
{
"value": "468dd3fa-a1d6-11ea-9031-15a1f0d7811d"
}
],
"active": true,
"meta": {
"resourceType": "User",
"created": "2017-03-09T16:11:13-05:00",
"lastModified": "2017-03-09T16:11:13-05:00",
"location": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"
}
}Notes
Set SCIM information for a provisioned enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in 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.
You must at least provide the required values for the user: userName, name, and emails.
Warning: Setting active: false removes the user from the enterprise, deletes the external identity, and deletes the associated {scim_user_id}.
put /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}Parameters
| Name | Type | In | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
accept | string | header | Setting to | ||||||||
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. | ||||||||
scim_user_id | string | path | scim_user_id parameter | ||||||||
schemas | array of strings | body | Required. The SCIM schema URIs. | ||||||||
userName | string | body | Required. The username for the user. | ||||||||
name | object | body | Required. | ||||||||
Properties of the | |||||||||||
| Name (Type) | Description |
|---|---|
givenName (string) | Required. The first name of the user. |
familyName (string) | Required. The last name of the user. |
emailsRequired. List of user emails.
Properties of theemailsitems
| Name (Type) | Description |
|---|---|
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. |
groupsList of SCIM group IDs the user is a member of.
Properties of thegroupsitems
| Name (Type) | Description |
|---|---|
value (string) |
Code samples
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
-d '{"schemas":["schemas"],"userName":"userName","name":{"givenName":"givenName","familyName":"familyName"},"emails":["octocat@github.com"]}' await octokit.request('PUT /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}', {
enterprise: 'enterprise',
scim_user_id: 'scim_user_id',
schemas: [
'schemas'
],
userName: 'userName',
name: {
givenName: 'givenName',
familyName: 'familyName'
},
emails: [
'octocat@github.com'
]
})Response
Status: 200 OK {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc",
"externalId": "00dowz5dr9oSfDFRA0h7",
"userName": "mona.octocat@okta.example.com",
"name": {
"givenName": "Mona",
"familyName": "Octocat"
},
"emails": [
{
"value": "mona.octocat@okta.example.com",
"type": "work",
"primary": true
}
],
"groups": [
{
"value": "468dd3fa-a1d6-11ea-9031-15a1f0d7811d"
}
],
"active": true,
"meta": {
"resourceType": "User",
"created": "2017-03-09T16:11:13-05:00",
"lastModified": "2017-03-09T16:11:13-05:00",
"location": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"
}
}Notes
Update an attribute for a SCIM enterprise user
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
Allows you to change 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: If you set active:false using the replace operation (as shown in the JSON example below), it removes the user from the enterprise, deletes the external identity, and deletes the associated :scim_user_id.
{
"Operations":[{
"op":"replace",
"value":{
"active":false
}
}]
}
patch /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
scim_user_id | string | path | scim_user_id parameter |
schemas | array of strings | body | Required. The SCIM schema URIs. |
Operations | array of objects | body | Required. Array of SCIM operations. |
Code samples
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID \
-d '{"schemas":["schemas"],"Operations":[{}]}' await octokit.request('PATCH /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}', {
enterprise: 'enterprise',
scim_user_id: 'scim_user_id',
schemas: [
'schemas'
],
Operations: [
{}
]
})Response
Status: 200 OK {
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"id": "92b58aaa-a1d6-11ea-8227-b9ce9e023ccc",
"externalId": "00dowz5dr9oSfDFRA0h7",
"userName": "mona.octocat@okta.example.com",
"name": {
"givenName": "Monalisa",
"familyName": "Octocat"
},
"emails": [
{
"value": "mona.octocat@okta.example.com",
"type": "work",
"primary": true
},
{
"value": "monalisa@octocat.github.com",
"type": "home"
}
],
"groups": [
{
"value": "468dd3fa-a1d6-11ea-9031-15a1f0d7811d"
}
],
"active": true,
"meta": {
"resourceType": "User",
"created": "2017-03-09T16:11:13-05:00",
"lastModified": "2017-03-09T16:11:13-05:00",
"location": "https://api.github.com/scim/v2/enterprises/octo-corp/Users/92b58aaa-a1d6-11ea-8227-b9ce9e023ccc"
}
}Notes
Delete a SCIM user from an enterprise
Note: The SCIM API endpoints for enterprise accounts are currently in beta and are subject to change.
delete /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}Parameters
| Name | Type | In | Description |
|---|---|---|---|
accept | string | header | Setting to |
enterprise | string | path | The slug version of the enterprise name. You can also substitute this value with the enterprise id. |
scim_user_id | string | path | scim_user_id parameter |
Code samples
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/scim/v2/enterprises/ENTERPRISE/Users/SCIM_USER_ID await octokit.request('DELETE /scim/v2/enterprises/{enterprise}/Users/{scim_user_id}', {
enterprise: 'enterprise',
scim_user_id: 'scim_user_id'
})Response
Status: 204 No Content