System for Cross-domain Identity Management (SCIM) API
The System for Cross-domain Identity Management (SCIM) API provides endpoints to create, read, update, and delete operations on users and groups using the SCIM protocol.
The SCIM protocol is an application-level HTTP-based protocol based on the HTTP [RFC7230] standard. Use this API for provisioning and managing identity data, such as users and groups, on the web and in cross-domain environments, such as enterprise-to-cloud service providers or inter-cloud scenarios.
To access this API, you must activate the SCIM v2 - ServiceNow® Cross-domain Identity Management (com.snc.integration.scim2) plugin.
Resource mapping
The SCIM service has six resources:
User (core and extension)
Group (core and extension)
Company
CostCenter
Department
Location
Most of the attributes in these SCIM resources map to corresponding fields in an existing ServiceNow table. The following tables define these mappings. Attributes that do not correspond to fields in existing ServiceNow tables map to two SCIM-specific tables. For additional information on these tables, see SCIM-specific tables.
The SCIM User resource has both core (schema: urn:ietf:params:scim:schemas:core:2.0:User) and extension (urn:ietf:params:scim:schemas:extension:servicenow:2.0:User) schemas. Most of the User core and extension schema attributes map to the User [sys_user] table.
SCIM attribute name
User field name
active
active
addresses.country
country
addresses.default.country
country
addresses.home.country
country
addresses.locality
city
addresses.default.locality
city
addresses.home.locality
city
addresses.postalCode
zip
addresses.default.postalCode
zip
addresses.home.postalCode
zip
addresses.region
state
addresses.default.region
state
addresses.home.region
state
addresses.streetAddress
street
addresses.default.streetAddress
street
addresses.home.streetAddress
street
displayName
name
emails.value
email
emails.default.value
email
emails.work.value
email
id
sys_id
meta.created
sys_created_on
meta.lastModified
sys_updated_on
name.familyName
last_name
name.givenName
first_name
name.honorificPrefix
introduction
name.middleName
middle_name
phoneNumbers.value
phone
phoneNumbers.home.value
home_phone
phoneNumbers.mobile.value
mobile_phone
phoneNumbers.work.value
phone
preferredLanguage
preferred_language
timezone
time_zone
title
title
userName
user_name
SCIM attribute name
Sys Scim User field name
externalId
external_id
The SCIM User extended schema (urn:ietf:params:scim:schemas:extension:servicenow:2.0:User) maps to the User [sys_user] table.
SCIM attribute name
User field name
company.name
company.name
company.value
company.sys_id
costCenter.name
cost_center.name
costCenter.value
cost_center.sys_id
department.name
department.name
department.value
department.sys_id
employeeNumber
employee_number
gender
gender
location.name
location.name
location.value
location.sys_id
manager.displayName
manager.name
manager.value
manager.sys_id
The SCIM Group resource schema (urn:ietf:params:scim:schemas:core:2.0:Group) maps to the Group [sys_user_group] table.
SCIM attribute name
Group field name
displayName
name
id
sys_id
meta.created
sys_created_on
meta.lastModified
sys_updated_on
The SCIM Group externalId parameter maps to the Sys Scim Group [sys_scim_group] table.
SCIM attribute name
Sys Scim Group field name
externalId
external_id
The SCIM Group ServiceNow extension schema (urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group) maps to the Group [sys_user_group] table.
SCIM attribute name
Group field name
company.value
company.sys_id
company.name
company.name
The SCIM Company resource schema (urn:ietf:params:scim:schemas:custom:servicenow:2.0:Company) maps to the Company [core_company] table.
SCIM attribute name
Company field name
id
sys_id
meta.created
sys_created_on
meta.lastModified
sys_updated_on
name
name
The SCIM CostCenter resource schema (urn:ietf:params:scim:schemas:custom:servicenow:2.0:CostCenter) maps to the Cost Center [cmn_cost_center] table.
SCIM attribute name
Cost Center field name
id
sys_id
meta.created
sys_created_on
meta.lastModified
sys_updated_on
name
name
The SCIM Department resource schema (urn:ietf:params:scim:schemas:custom:servicenow:2.0:Department) maps to the Department [cmn_department] table.
SCIM attribute name
Department field name
id
sys_id
meta.created
sys_created_on
meta.lastModified
sys_updated_on
name
name
The SCIM Location resource schema (urn:ietf:params:scim:schemas:custom:servicenow:2.0:Location) maps to the Location [cmn_location] table.
SCIM attribute name
Location field name
id
sys_id
meta.created
sys_created_on
meta.lastModified
sys_updated_on
name
name
SCIM-specific tables
Two tables, Sys Scim User [sys_scim_user] and Sys Scim Group [sys_scim_group], contain the SCIM attributes that do not map to existing ServiceNow tables. The following define the contents of these tables.
Field name
Description
Created
Date and time that the associated record was created.Data type: String Maximum length: 40
Created by
Name of the entity that created the record.Data type: String Maximum length: 40
External ID
External ID used by the entity that created this user record to reference the user in their system.Data type: String Maximum length: 255
Sys ID
Unique identifier for the record within a ServiceNow instance.Data type: String Maximum length: 32
Updated
Date and time that the associated record was last updated.Data type: String Maximum length: 40
Updated by
Name of the entity that last updated the associated record.Data type: String Maximum length: 40
Updates
Number of times that the record has been updated.Data type: Number \(Integer\) Maximum length: 40
User
Reference to the user associated with this recordReference: User \[sys\_user\] table Maximum length: 32
User type
Type of user record. This value is used to identify the organization to user relationship.This can be any value, but typical values might include: - Contractor - Employee - External - Intern - Temp - Unknown Data type: String Maximum length: 40
Field name
Description
Created
Date and time that the associated record was created.Data type: String Maximum length: 40
Created by
Name of the entity that created the record.Data type: String Maximum length: 40
External ID
External ID used by the entity that created this group record to reference the group in their system.Data type: String Maximum length: 255
Group
Reference to the group associated with this record.Reference: Group \[sys\_user\_group\] table Maximum length: 32
Sys ID
Unique identifier for the record within a ServiceNow instance.Data type: String Maximum length: 32
Updated
Date and time that the associated record was last updated.Data type: String Maximum length: 40
Updated by
Name of the entity that last updated the associated record.Data type: String Maximum length: 40
Updates
Number of times that the record has been updated.Data type: Number \(Integer\) Maximum length: 40
Roles and access control lists
The scim_admin role is required to access the SCIM-specific tables and the private SCIM endpoints and enables access to the User [sys_user] and Group [sys_user_group] tables.
The SCIM service has four ACLs for accessing the Sys Scim User [sys_scim_user] table and the Sys Scim Group [sys_scim_group] table that enable create, delete, read, and write. These ACLs are only mapped to the scim_admin role.
Deletes the specified group record from the Group [sys_user_group] table of a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
group\_id
Sys\_id of the group record to delete. Data type: String Table: Group \[sys\_user\_group\]
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
204
No Content. The request was successfully processed.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
errors
Response that describes any errors that may have occurred during processing the request.Data type: Object
Returns one or more group records from the Group [sys_user_group] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Note: A query that does not return any matches returns success (HTTP status code 200) with totalResults set to 0.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
count
Number of records to return. A negative value is interpreted as zero.Data type: Number Maximum: 500 - A value greater than this results in a bad request error. Default: 10
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
filter
Filter expression to apply to the return results. Field filters are expressed as <field_name> <operator> <"value">. Refer to RFC7644 for a list of the valid operators. Note: The NOT operator is not supported by this method.
For example, to filter for all groups whose name starts with "HR", enter displayName SW "HR".
To specify more than one field filter, concatenate the filters using the AND operand. For example, to filter for all groups whose name starts with "HR" and were last modified before October 3, 2021, enter displayName SW "HR" AND meta.lastModified lt "2021-10-33T00:00:00Z". Use dot-walking to specify nested attributes.
Only the following SCIM group fields are available for use in filters:
displayName
externalId: Only supports EQ operator.
id
meta.created
meta.lastModified
Data type: String
Default: No filtering
sortBy
Must be specified with the sortOrder parameter. Field by which to sort the return results. Sorting is case-insensitive. You can only use those parameters available for filtering for the sortBy parameter, except that externalId is not allowed.
For values that are null:
sorted by ascending: Null values are sorted to the top.
sorted by descending: Null values are sorted to the bottom.
Data type: String
Default: No sort
sortOrder
Must be specified with the sortBy parameter. Order in which the sortBy parameter is applied to the return results. Valid values:
ascending
descending
Data type: String
Default: ascending
startIndex
One-based index into the table at which to start retrieving records. For example, if you set this parameter to 100, and the count parameter to 20, the endpoint returns records 100 through 119. Note: Any value that is set to less than one is interpreted as one.
Data type: String
Default: 1
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
401
Unauthorized. The user credentials are incorrect or have not been passed.
Response body parameters (JSON)
Name
Description
itemsPerPage
Number of records returned in the return results.Data type: Number
Resources
List of group records.Data type: Array of Objects ``` "Resources": [ { "company": {Object}, "displayName": "String", "externalId": "String", "id": "String", "meta": [Array] } ]
</td></tr><tr><td>
Resources.company
</td><td>
Details about the group's company or organization.Data type: Object
```
"company": {
"display": "String",
"$ref": "String",
"value": "String"
}
Resources.company.display
Name of the company.Data type: String
Resources.company.$ref
Reference URI of the company.Format: `/Companies/`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`. Data type: String
Resources.company.value
Sys\_id of the associated company.Data type: String
Resources.displayName
Human-readable name of the group, such as HR Team.Data type: String
Resources.externalId
Unique identifier assigned to the group by the entity provisioning it.Data type: String
Resources.id
Sys\_id of the group.Data type: String
Resources.meta
Metadata pertaining to the group.Data type: Object
Name of the associated group member.Data type: String
Resources.members.value
Sys\_id of the associated user or group record.Data type: String
Resources.members.$ref
URI of the associated group member.Data type: String
Resources.schemas
List of URIs of the SCIM Group schemas used to process the request. Supported group schemas: - urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2\) - urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema. - urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response. Data type: Array of Strings
schemas
List of URIs of the SCIM List Response schemas used to process the request.Data type: Array
startIndex
One-based index into the Group \[sys\_user\_group\] table at which the endpoint started retrieving records.Data type: Number
totalResults
Total number of records that match the request.Data type: Number
cURL request for multiple groups
This example shows how to request multiple groups (four in this case), using the count parameter.
curl "https://instance-sevicenow.com/api/now/scim/Groups?count=4" \
--request GET \
--header "Accept:application/scim+json" \
Returns the specified group record from the Group [sys_user_group] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
group\_id
Sys\_id of the group record to return.
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
company
Details about the group's company or organization.Data type: Object
Reference URI of the company.Format: `/Companies/`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`. Data type: String
company.value
Sys\_id of the associated company.Data type: String
displayName
Human-readable name of the group, such as HR Team.Data type: String
externalId
Unique identifier assigned to the group by the entity provisioning it.Data type: String
id
Sys\_id of the group.Data type: String
meta
Metadata pertaining to the group.Data type: Object
Name of the associated group member.Data type: String
members.value
Sys\_id of the associated user or group record.Data type: String
members.$ref
URI of the associated group member.Data type: String
schemas
List of URIs of the SCIM Group schemas used to process the request. Supported group schemas: - urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2\) - urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema. - urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response. Data type: Array of Strings
cURL request for specific group
This example shows how to retrieve a specific group record.
curl "https://instance-servicenow.com/api/now/scim/Groups/e0140d671bbe3010593876a61a4bcb11" \
--request GET \
--header "Accept:application/scim+json" \
Enables you to add, update, and delete specified fields in a group record in the Group [sys_user_group] table of a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
For additional information, refer to the Modifying with PATCH section of RFC 7644.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
group\_id
Sys\_id of the group record to update.Data type: String Table: Group \[sys\_user\_group\]
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
Operations
Required. List of operation objects to patch the specified Group record with.Data type: Array of Objects ``` "Operations": [ { "op": "String", "path": "String", "value": Any } ]
</td></tr><tr><td>
Operations.op
</td><td>
Required. Operation to perform.Valid values:
- add: Add the specified field and value to the Group record.
- remove: Remove the value from the specified field. Replaced with data type "null".
- replace: Replace the value of the specified field.
Data type: String
</td></tr><tr><td>
Operations.path
</td><td><p>Required for <code>remove</code> operations, optional for others. Name/path of the field to modify.The <strong>path</strong> parameter can have one of the following formats:</p>
<ul>
<li>A direct field, such as <code>displayName</code></li>
<li>In case of complex array, a pointer to a specific element with a filter, such as: <code>emails[type eq "work"]</code></li>
</ul>
<div class="highlight"><pre><span></span><code>{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:PatchOp"
],
"Operations": [
{
"op": "add",
"path": "displayName",
"value": "HR Group"
},
{
"op": "replace",
"path": "members[value eq \"sysid1\"]",
"value": {
"value": "sysid2"
}
}
]
}
</code></pre></div>
<p>Data type: String</p>
<p>Default: Considers the field to be a resource.</p></td></tr><tr><td>
Operations.value
</td><td><p>Value of the field specified in the <strong>Operations.path</strong> parameter. The format of this parameter depends on the data-type of the associated field. For example, if updating a simple string, such as the title, the <strong>value</strong> field is expressed as a string.</p>
<p>
If the field being updated is not in the base-schema, you must enclose the name-value pair in an object that specifies the URN of the associated schema.
```
"value": {
"<schema_urn>": {
"<field_name>": "<new_value>"
},
}
Required. SCIM Schema URI of the Patch Operation: "urn:ietf:params:scim:api:messages:2.0:PatchOp”Data type: String
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Content-Type
Data format of the request body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
204
`Successful. No Content (Applicable only for SCIM Group Patch API)` - This 204 status is dependent on the state of the SCIM UI property, `Enable Group Patch API response with No Content`, and is subject to the attribute parameter passed as per RFC: https://www.rfc-editor.org/rfc/rfc7644\#page-35. Default property value: false The `Enable Group Patch API response with No Content` property can be used to get additional response execution performance gains if the client does not plan to consume any response resources.
400
Bad Request. A bad request type or malformed request was detected.- Check for invalid values: - Malformed request body. - Required field is not provided or empty. - Invalid user or group sys_id is provided. - Check if a read-only or immutable field is trying to be modified. - Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request or that the request does not exceed the maximum number of members.
404
Not found. The requested item wasn't found.
409
Group already exists. The displayName parameter must be unique.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON)
Name
Description
company
Details about the group's company or organization.Data type: Object
Reference URI of the company.Format: `/Companies/`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`. Data type: String
company.value
Sys\_id of the associated company.Data type: String
displayName
Human-readable name of the group, such as HR Team.Data type: String
externalId
Unique identifier assigned to the group by the entity provisioning it.Data type: String
errors
Response that describes any errors that may have occurred during processing the request.Data type: Object
Date and time when the group record was created.Data type: String
meta.lastModified
Date and time when the group record was last modified.Data type: String
meta.location
URI of the group being retrieved.Data type: String
meta.resourceType
SCIM Groups' resource type.Data type: String
schemas
List of URIs of the SCIM Group schemas used to process the request. Supported group schemas: - urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2\) - urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema. - urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response. Data type: Array of Strings
cURL request
This example shows how to add an external ID to a group record and replace the current list of associated members (users).
Creates a group record in the Group [sys_user_group] table of a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
You can define the display name of the group, an external ID used to correlate this group to an external system, and add members (users/groups) to the group.
Note: The search and bulk modifications functionality as noted in the RFC7643 specification are not supported by this endpoint.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
company
Details about the group's company or organization.Data type: Object
Reference URI of the company.Format: `/Companies/`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`. Data type: String
company.value
Sys\_id of the associated company.Data type: String
displayName
Required. Human-readable name of the group, such as HR Team.Data type: String
externalId
Unique identifier assigned to the group by the entity provisioning it.Data type: String
members
List of users or other groups to associate with the group.Data type: Array of Objects ``` "members:" [ { "value": "String" } ]
Maximum size: 100 - You can modify this maximum size by updating the system property com.snc.interation.scim2.max.member.count.
</td></tr><tr><td>
members.value
</td><td>
Sys\_id of the associated user or group record.Data type: String
</td></tr><tr><td>
schemas
</td><td id="group_request_schema-SCIM-entry">
Required.List of URIs of the SCIM Group schemas used to process the request.
Supported group schemas:
- urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(<a href="https://datatracker.ietf.org/doc/html/rfc7643#section-4.2">https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2</a>\)
- urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema.
- urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response.
Data type: Array of Strings
</td></tr></tbody>
</table>
### Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="Accept-SCIM-entry">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr><tr><td>
Content-Type
</td><td id="Content_Type-SCIM-entry">Data format of the request body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr></tbody>
</table>
|Header|Description|
|------|-----------|
|None| |
### Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](../rest-api-explorer/c_RESTAPI.md).
<table><thead><tr><th>
Status code
</th><th>
Description
</th></tr></thead><tbody><tr><td>
201
</td><td>
Successful. The request was successfully processed.
</td></tr><tr><td>
400
</td><td>Bad Request. A bad request type or malformed request was detected.- Check for invalid values:
- Malformed request body.
- Required field is not provided or empty.
- Invalid user or group sys_id is provided.
- Check if a read-only or immutable field is trying to be modified.
- Ensure that both the <strong>attributes</strong> and <strong>excludedAttributes</strong> query parameters have not been passed in the request or that the request does not exceed the maximum number of members.</td></tr><tr><td>
409
</td><td id="status_409-SCIM-entry">Group already exists. The <strong>displayName</strong> parameter must be unique.</td></tr><tr><td>
500
</td><td id="entry-500-status-code">
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
</td></tr></tbody>
</table>
### Response body parameters \(JSON\)
<table id="id_uwk_c5c_grb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr id="group_company-SCIM-row"><td>
company
</td><td id="d3412e808">
Details about the group's company or organization.Data type: Object
</td></tr><tr id="group_company_display-SCIM-row"><td>
company.display
</td><td id="d3412e821">
Name of the company.Data type: String
</td></tr><tr id="group_company_ref-SCIM-row"><td>
company.$ref
</td><td id="d3412e832">
Reference URI of the company.Format: `<host>/Companies/<company sys_id>`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`.
Data type: String
</td></tr><tr id="group_company_value-SCIM-row"><td>
company.value
</td><td id="d3412e851">
Sys\_id of the associated company.Data type: String
</td></tr><tr id="group_displayName-SCIM-row"><td>
displayName
</td><td id="group_displayName-SCIM-entry">
Human-readable name of the group, such as HR Team.Data type: String
</td></tr><tr id="group_externalId-SCIM-row"><td>
externalId
</td><td id="d3412e874">
Unique identifier assigned to the group by the entity provisioning it.Data type: String
</td></tr><tr id="group_id-SCIM-row"><td>
id
</td><td id="group_id-SCIM-entry">
Sys\_id of the group.Data type: String
</td></tr><tr id="group_meta-SCIM-row"><td>
meta
</td><td id="group_meta-SCIM-entry">
Metadata pertaining to the group.Data type: Object
</td></tr><tr id="group_meta_created-SCIM-row"><td>
meta.created
</td><td id="group_meta_created-SCIM-entry">
Date and time when the group record was created.Data type: String
</td></tr><tr id="group_meta_lastModified-SCIM-row"><td>
meta.lastModified
</td><td id="group_meta_lastModified-SCIM-entry">
Date and time when the group record was last modified.Data type: String
</td></tr><tr id="group_meta_location-SCIM-row"><td>
meta.location
</td><td id="group_meta_location-SCIM-entry">
URI of the group being retrieved.Data type: String
</td></tr><tr id="group_meta_resourceType-SCIM-row"><td>
meta.resourceType
</td><td id="group_meta_resourceType-SCIM-entry">
SCIM Groups' resource type.Data type: String
</td></tr><tr id="group_members-SCIM-row"><td>
members
</td><td id="group_members-SCIM-entry">
List of the users and groups associated with the group.Data type: Array of Objects
</td></tr><tr id="group_members_display-SCIM-row"><td>
members.display
</td><td id="group_members_display-SCIM-entry">
Name of the associated group member.Data type: String
</td></tr><tr id="group_members_value-SCIM-row"><td>
members.value
</td><td id="group_members_value-SCIM-entry">
Sys\_id of the associated user or group record.Data type: String
</td></tr><tr id="group_members_ref-SCIM-row"><td>
members.$ref
</td><td id="group_members_ref-SCIM-entry">
URI of the associated group member.Data type: String
</td></tr><tr id="group_schemas-SCIM-row"><td>
schemas
</td><td id="group_schemas-SCIM-entry">
List of URIs of the SCIM Group schemas used to process the request.
Supported group schemas:
- urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(<a href="https://datatracker.ietf.org/doc/html/rfc7643#section-4.2">https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2</a>\)
- urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema.
- urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response.
Data type: Array of Strings
</td></tr></tbody>
</table>
### cURL request POST a new group and add member
This example creates group51 and adds the user Abel Tutor as a member.
## SCIM - PUT /scim/Groups/\{group\_id\}
Updates the specified group record in the Group \[sys\_user\_group\] table of a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
Fields that are omitted in the request are not updated. You can explicitly clear a field by setting its value to null for a single valued field and to an empty array for array type fields such as **members**.
### URL format
Versioned URL: `/api/now/{api_version}/scim/Groups/{group_id}`
Default URL: `/api/now/scim/Groups/{group_id}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr><tr><td>
group\_id
</td><td>
Sys\_id of the group record to update.Data type: String
Table: Group \[sys\_user\_group\]
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr></tbody>
</table>
<table class="rest_api_request_body"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
company
</td><td id="group_company-SCIM-entry">
Details about the group's company or organization.Data type: Object
</td></tr><tr><td>
company.display
</td><td id="group_company_display-SCIM-entry">
Name of the company.Data type: String
</td></tr><tr><td>
company.$ref
</td><td id="group_company_ref-SCIM-entry">
Reference URI of the company.Format: `<host>/Companies/<company sys_id>`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`.
Data type: String
</td></tr><tr><td>
company.value
</td><td id="group_company_value-SCIM-entry">
Sys\_id of the associated company.Data type: String
</td></tr><tr><td>
displayName
</td><td id="group_displayName-SCIM-entry">
Human-readable name of the group, such as HR Team.Data type: String
</td></tr><tr><td>
externalId
</td><td id="group_externalId-SCIM-entry">
Unique identifier assigned to the group by the entity provisioning it.Data type: String
</td></tr><tr><td>
members
</td><td>
List of users to replace the current list of members with.Data type: Array of Objects
```
"members:" [
{
"value": "String"
}
]
Maximum size: 100 - You can modify this maximum size by updating the system property com.snc.interation.scim2.max.member.count.
members.value
Sys\_id of the associated user or group record.Data type: String
schemas
Required.List of URIs of the SCIM Group schemas used to process the request. Supported group schemas: - urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2\) - urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema. - urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response. Data type: Array of Strings
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Content-Type
Data format of the request body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Check for invalid values: - Malformed request body. - Required field is not provided or empty. - Invalid user or group sys_id is provided. - Check if a read-only or immutable field is trying to be modified. - Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request or that the request does not exceed the maximum number of members.
404
Not found. The requested item wasn't found.
409
Group already exists. The displayName parameter must be unique.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON)
Name
Description
company
Details about the group's company or organization.Data type: Object
Reference URI of the company.Format: `/Companies/`, such as: `http://instance-servicenow.com/api/now/scim/Companies/81fd65ecac1d55eb42a426568fc87a63`. Data type: String
company.value
Sys\_id of the associated company.Data type: String
displayName
Human-readable name of the group, such as HR Team.Data type: String
errors
Response that describes any errors that may have occurred during processing the request.Data type: Object
Date and time when the group record was created.Data type: String
meta.lastModified
Date and time when the group record was last modified.Data type: String
meta.location
URI of the group being retrieved.Data type: String
meta.resourceType
SCIM Groups' resource type.Data type: String
schemas
List of URIs of the SCIM Group schemas used to process the request. Supported group schemas: - urn:ietf:params:scim:schemas:core:2.0:Group - Core schema specified in the Internet Engineering Task Force System for Cross-domain Identity Management: Core Schema document \(https://datatracker.ietf.org/doc/html/rfc7643\#section-4.2\) - urn:ietf:params:scim:schemas:extension:servicenow:2.0:Group - ServiceNow extension schema. This schema contains attributes that are present in the Groups \[sys\_user\_group\] table in a base ServiceNow system, but are not part of the core schema. - urn:ietf:params:scim:schemas:extension:servicenow:custom:2.0:Group” - Custom extension schema. This schema is part of “Group” resourceType in the sys\_scim\_schema\_extension table. If the schema is not active, the schema URN is not returned in the response. Data type: Array of Strings
cURL request updating group members using PUT
The following example changes the member associated with the group to Abraham Lincoln instead of Abel Tutor and changes the name of the group to HR Team.
Deletes the specified user record from the User [sys_user] table of a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
user\_id
Sys\_id of the user record to delete.Data type: String Table: User \[sys\_user\]
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
204
No Content. The request was successfully processed.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
errors
Response that describes any errors that may have occurred during processing the request.Data type: Object
Returns one or more user records from the User [sys_user] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Note: A query that does not return any matches returns success (HTTP status code 200) with totalResults set to 0.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
count
Number of records to return. A negative value is interpreted as zero.Data type: Number Maximum: 500 - A value greater than this results in a bad request error. Default: 10
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
filter
Filter expression to apply to the return results. Field filters are expressed as <field_name> <operator> <"value">. Refer to RFC7644 for a list of the valid operators. Note: The NOT operator is not supported.
For example, to filter for all users whose name starts with "Jo", enter userName SW "jo" (case-insensitive).
To specify more than one field filter, concatenate the filters using the AND operand. For example, to filter for all users whose name starts with "Jo" and whose last name contains "smi", enter userName SW "john" AND name.familyName CO "smi". Use dot-walking to specify nested attributes.
Only the following SCIM user fields are available for use in filters and some, as noted, only support fixed format:
active
addresses - Fixed format only, such as:
[type eq "home" and streetAddress eq "xxxx"]
[type eq "home" and locality eq "xxxx"]
[type eq "home" and region eq "xxxx"]
[type eq "home" and postalCode eq "xxxx"]
[type eq "home" and country eq "xxxx"]
displayName
emails - Fixed format only, such as: [type eq "work" and value eq "emailValue"]
Must be specified with the sortOrder parameter. Field by which to sort the return results. Sorting is case-insensitive. You can only use the parameters available for filtering for the sortBy parameter, with the exception of externalId, which is not allowed.
Also, only the following dot-walked parameters are supported:
addressess - Only the following values are allowed:
addresses.streetAddress - Maps to home street address.
addresses.home.streetAddress
addresses.locality - Maps to home locality.
addresses.home.locality
addresses.region - Maps to home region.
addresses.home.region
addresses.postalCode - Maps to home postal code.
addresses.home.postalCode
addresses.country - Maps to home country.
addresses.home.country
emails - Only the following values are allowed:
emails.value - Maps to the email type work.
emails.work.value
phoneNumbers - Only the following values are allowed:
phoneNumbers.value - Maps to the phone number type work.
phoneNumbers.home.value
phoneNumbers.mobile.value
phoneNumbers.work.value
For values that are null:
sorted by ascending - Null values are sorted to the top.
sorted by descending - Null values are sorted to the bottom.
Data type: String
Default: No sort performed
sortOrder
Must be specified with the sortBy parameter. Order in which the sortBy parameter is applied to the return results. Valid values:
ascending
descending
Data type: String
Default: ascending
startIndex
One-based index into the User [sys_user] table at which to start retrieving records. For example, if you set this parameter to 100, and the count parameter to 20, the endpoint returns records 100 through 119. Note: Any value that is set to less than one is interpreted as one.
Not valid with the id path parameter.
Data type: String
Default: 1
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
Response body parameters (JSON)
Name
Description
itemsPerPage
Number of records returned in the return results.Data type: Number
</td></tr><tr><td>
Resources.active
</td><td>
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values:
- true: User is active.
- false: User is inactive.
Data type: Boolean
</td></tr><tr><td>
Resources.adresses
</td><td>
Details of the user's current mailing address.Data type: Object
</td></tr><tr><td>
Resources.addresses.country
</td><td>
Country name.Data type: String
</td></tr><tr><td>
Resources.addresses.locality
</td><td>
City or locality name.Data type: String
</td></tr><tr><td>
Resources.addresses.postalCode
</td><td>
Zip or postal code.Data type: String
</td></tr><tr><td>
Resources.addresses.region
</td><td>
State or region.Data type: String
</td></tr><tr><td>
Resources.addresses.streetAddress
</td><td>
Full street address. This can include the house number, street name, PO Box, and multi-line extended street address information.Data type: String
</td></tr><tr><td>
Resources.addresses.type
</td><td>
Type of address. Currently only supports `home`.Data type: String
</td></tr><tr><td>
Resources.displayName
</td><td>User display name. This value is auto-generated by concatenating the <strong>name</strong> fields. Data type: String</td></tr><tr><td>
Resources.emails
</td><td>
List of email accounts associated with the user.Data type: Array of Objects
</td></tr><tr><td>
Resources.emails.type
</td><td>
User email type. Currently only supports type of "work".Data type: String
</td></tr><tr><td>
Resources.emails.value
</td><td>
User's email address. This is a unique key for the associated user.Data type: String
</td></tr><tr><td>
Resources.externalId
</td><td>
Unique identifier assigned to the user by the entity provisioning it.Data type: String
</td></tr><tr><td>
Resources.groups
</td><td>
List of groups to which the user belongs, either through direct membership, nested groups, or dynamically calculated.Data type: Array of Objects
</td></tr><tr><td>
Resources.groups.display
</td><td>
Name of the associated group.Data type: String
</td></tr><tr><td>
Resources.groups.type
</td><td>
Type of group association, such as direct or indirect.Data type: String
</td></tr><tr><td>
Resources.groups.value
</td><td>
Sys\_id of an associated group record.Data type: String
</td></tr><tr><td>
Resources.groups.ref
</td><td>
URI of the associated group.Data type: String
</td></tr><tr><td>
Resources.id
</td><td>
Sys\_id of the associated User record.Data type: String
</td></tr><tr><td>
Resources.meta
</td><td>
Metadata pertaining to the user.Data type: Object
</td></tr><tr><td>
Resources.meta.created
</td><td>
Date and time when the user record was created.Data type: String
</td></tr><tr><td>
Resources.meta.lastModified
</td><td>
Date and time when the user record was last modified.Data type: String
</td></tr><tr><td>
Resources.meta.location
</td><td>
URI of the user being retrieved.Data type: String
</td></tr><tr><td>
Resources.meta.resourceType
</td><td>
SCIM Users' resource type.Data type: String
</td></tr><tr><td>
Resources.name
</td><td>
User's name information.Data type: Object
</td></tr><tr><td>
Resources.name.familyName
</td><td>
User's family or last name.Data type: String
</td></tr><tr><td>
Resources.name.givenName
</td><td>
User's given or first name.Data type: String
</td></tr><tr><td>
Resources.name.honorificPrefix
</td><td>
User's honorific name or title, such as Dr., Bishop, or Baron.Data type: String
</td></tr><tr><td>
Resources.name.middle
</td><td>
User's middle name.Data type: String
</td></tr><tr><td>
Resources.phoneNumbers
</td><td>
List of phone numbers associated with the user.Data type: Array of Objects
</td></tr><tr><td>
Resources.phoneNumbers.type
</td><td>
Type of phone number.Possible values:
- home
- mobile
- work
Data type: String
</td></tr><tr><td>
Resources.phoneNumbers.value
</td><td>
User's phone number.Data type: String
</td></tr><tr><td>
Resources.preferredLanguage
</td><td>
User's preferred spoken and written language.Data type: String
</td></tr><tr><td>
Resources.schemas
</td><td>
List of URIs of the SCIM User schemas used to process the request.Data type: Array of Strings
</td></tr><tr><td>
Resources.timezone
</td><td>
User's time zone.Data type: String
</td></tr><tr><td>
Resources.title
</td><td>
User's title, such as CEO or President.Data type: String
</td></tr><tr><td>
Resources.userName
</td><td>
Unique user name for the associated user. Data type: String
</td></tr><tr><td>
Resources.userType
</td><td>
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include:
- Contractor
- Employee
- Intern
- Temp
- External
- Unknown
Data type: String
</td></tr><tr><td>
schemas
</td><td id="user_schemas-SCIM-entry">
List of URIs of the SCIM ListResponse schemas used to process the request.Data type: Array of Strings
</td></tr><tr><td>
startIndex
</td><td>
One-based index into the User \[sys\_user\] table at which the records were returned.Data type: String
</td></tr><tr><td>
totalResults
</td><td id="totalResults-SCIM-entry">
Total number of records that match the request.Data type: Number
</td></tr></tbody>
</table>
### Extension parameters returned
<table id="id_hmw_fjk_grb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr id="user_company-SCIM-row"><td>
company
</td><td id="user_company-SCIM-entry">
Details about the user's associated company.Data type: Object
</td></tr><tr id="user_company_display-SCIM-row"><td>
company.display
</td><td id="user_company_display-SCIM-entry">
Name of the company.Data type: String
</td></tr><tr id="user_company_value-SCIM-row"><td>
company.value
</td><td id="user_company_value-SCIM-entry">
Sys\_id of the company record.Data type: String
</td></tr><tr id="user_company_ref-SCIM-row"><td>
company.$ref
</td><td id="user_company_ref-SCIM-entry">
Reference URI for the company.Data type: String
</td></tr><tr id="user_costCenter-SCIM-row"><td>
costCenter
</td><td id="user_costCenter-SCIM-entry">
Details about the user's associated cost center.Data type: Object
</td></tr><tr id="user_costCenter_display-SCIM-row"><td>
costCenter.display
</td><td id="user_costCenter_display-SCIM-entry">
Name of the cost center.Data type: String
</td></tr><tr id="user_costCenter_value-SCIM-row"><td>
costCenter.value
</td><td id="user_costCenter_value-SCIM-entry">
Sys\_id of the cost center record. Data type: String
</td></tr><tr id="user_costCenter_ref-SCIM-row"><td>
costCenter.$ref
</td><td id="user_costCenter_ref-SCIM-entry">
Reference URI for the cost center.Data type: String
</td></tr><tr id="user_department-SCIM-row"><td>
department
</td><td id="user_department-SCIM-entry">
Details about the user's associated department.Data type: Object
</td></tr><tr id="user_department_display-SCIM-row"><td>
department.display
</td><td id="user_department_display-SCIM-entry">
Name of the department.Data type: String
</td></tr><tr id="user_department_value-SCIM-row"><td>
department.value
</td><td id="user_department_value-SCIM-entry">
Sys\_id of the department record. Data type: String
</td></tr><tr id="user_department_ref-SCIM-row"><td>
department.$ref
</td><td id="user_department_ref-SCIM-entry">
Reference URI for the department.Data type: String
</td></tr><tr id="user_employeeNumber-SCIM-row"><td>
employeeNumber
</td><td id="user_employeeNumber-SCIM-entry">
Numeric or alphanumeric employee number.Data type: String
</td></tr><tr id="user_gender-SCIM-row"><td>
gender
</td><td id="user_gender-SCIM-entry">
Gender of the user, such as male or female.Data type: String
</td></tr><tr id="user_location-SCIM-row"><td>
location
</td><td id="user_location-SCIM-entry">
Details about the user's associated location.Data type: Object
</td></tr><tr id="user_location_display-SCIM-row"><td>
location.display
</td><td id="user_location_display-SCIM-entry">
Name of the location.Data type: String
</td></tr><tr id="user_location_value-SCIM-row"><td>
location.value
</td><td id="user_location_value-SCIM-entry">
Sys\_id of the location record. Data type: String
</td></tr><tr id="user_location_ref-SCIM-row"><td>
location.$ref
</td><td id="user_location_ref-SCIM-entry">
Reference URI for the location.Data type: String
</td></tr><tr id="user_manager-SCIM-row"><td>
manager
</td><td id="user_manager-SCIM-entry">
Details about the user's associated manager.Data type: Object
</td></tr><tr id="user_manager_display-SCIM-row"><td>
manager.display
</td><td id="user_manager_display-SCIM-entry">
Name of the manager.Data type: String
</td></tr><tr id="user_manager_value-SCIM-row"><td>
manager.value
</td><td id="user_manager_value-SCIM-entry">
Sys\_id of the manager record. Data type: String
</td></tr><tr id="user_manager_ref-SCIM-row"><td>
manager.$ref
</td><td id="user_manager_ref-SCIM-entry">
Reference URI for the manager.Data type: String
</td></tr></tbody>
</table>
### cURL request using attributes
The following example shows how to obtain two users starting at the sixth record and only returning the display name.
curl "https://instance-servicenow.com/api/now/scim/Users?attributes=displayName&startIndex=6&count=2" \ --request GET \ --header "Accept:application/scim+json" \
### cURL request using a filter
The following example shows how to use the **filter** parameter to return the first two user records whose given name starts with "a".
curl "https://instance-servicenow.com/api/now/scim/Users?filter=name.givenName%20SW%20%22a%22&count=2" \ --request GET \ --header "Accept:application/scim+json" \
## SCIM - GET /scim/Users/\{user\_id\}
Returns the specified user record from the User \[sys\_user\] table within a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
### URL format
Versioned URL: `/api/now/{api_version}/scim/Users/{user_id}`
Default URL: `/api/now/scim/Users/{user_id}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr><tr><td>
user\_id
</td><td>
Sys\_id of the user record to return.Data type: String
Table: User \[sys\_user\]
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None| |
### Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="Accept-SCIM-entry">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr></tbody>
</table>
|Header|Description|
|------|-----------|
|None| |
### Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](../rest-api-explorer/c_RESTAPI.md).
<table><thead><tr><th>
Status code
</th><th>
Description
</th></tr></thead><tbody><tr><td>
200
</td><td id="entry-200-status-code">
Successful. The request was successfully processed.
</td></tr><tr><td>
400
</td><td id="status_400-SCIM-entry">Bad Request. A bad request type or malformed request was detected.- Ensure that both the <strong>attributes</strong> and <strong>excludedAttributes</strong> query parameters have not been passed in the request.
- Ensure that the <strong>count</strong> parameter is not greater than 500.
- Ensure that all <strong>filter</strong> parameters are valid.</td></tr><tr><td>
404
</td><td id="entry-404-status-code">
Not found. The requested item wasn't found.
</td></tr></tbody>
</table>
### Response body parameters \(JSON\)
<table id="id_x11_hyj_grb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr id="user_active-SCIM-row"><td>
active
</td><td id="user_active-SCIM-entry">
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values:
- true: User is active.
- false: User is inactive.
Data type: Boolean
</td></tr><tr id="user_addresses-SCIM-row"><td>
addresses
</td><td id="user_addresses-SCIM-entry">
Details of the user's current mailing address.Data type: Object
</td></tr><tr id="user_addresses_country-SCIM-row"><td>
addresses.country
</td><td id="user_addresses_country-SCIM-entry">
Country name.Data type: String
</td></tr><tr id="user_addresses_locality-SCIM-row"><td>
addresses.locality
</td><td id="user_addresses_locality-SCIM-entry">
City or locality name.Data type: String
</td></tr><tr id="user_addresses_postalCode-SCIM-row"><td>
addresses.postalCode
</td><td id="user_addresses_postalCode-SCIM-entry">
Zip or postal code.Data type: String
</td></tr><tr id="user_addresses_region-SCIM-row"><td>
addresses.region
</td><td id="user_addresses_region-SCIM-entry">
State or region.Data type: String
</td></tr><tr id="user_addresses_streetAddress-SCIM-row"><td>
addresses.streetAddress
</td><td id="user_addresses_streetAddress-SCIM-entry">
Full street address. This can include the house number, street name, PO Box, and multi-line extended street address information.Data type: String
</td></tr><tr id="user_addresses_type-SCIM-row"><td>
addresses.type
</td><td id="user_addresses_type-SCIM-entry">
Type of address. Currently only supports `home`.Data type: String
</td></tr><tr id="user_displayName-SCIM-row"><td>
displayName
</td><td id="user_displayName-SCIM-entry">User display name. This value is auto-generated by concatenating the <strong>name</strong> fields. Data type: String</td></tr><tr id="user_emails-SCIM-row"><td>
emails
</td><td id="user_emails-SCIM-entry">
List of email accounts associated with the user.Data type: Array of Objects
</td></tr><tr id="user_emails_type-SCIM-row"><td>
emails.type
</td><td id="user_emails_type-SCIM-entry">
User email type. Currently only supports type of "work".Data type: String
</td></tr><tr id="user_emails_value-SCIM-row"><td>
emails.value
</td><td id="user_emails_value-SCIM-entry">
User's email address. This is a unique key for the associated user.Data type: String
</td></tr><tr id="user_emails_externalId-SCIM-row"><td>
externalId
</td><td id="user_emails_externalId-SCIM-entry">
Unique identifier assigned to the user by the entity provisioning it.Data type: String
</td></tr><tr id="user_groups-SCIM-row"><td>
groups
</td><td id="user_groups-SCIM-entry">
List of groups to which the user belongs, either through direct membership, nested groups, or dynamically calculated.Data type: Array of Objects
</td></tr><tr id="user_groups_display-SCIM-row"><td>
groups.display
</td><td id="user_groups_display-SCIM-entry">
Name of the associated group.Data type: String
</td></tr><tr id="user_groups_type-SCIM-row"><td>
groups.type
</td><td id="user_groups_type-SCIM-entry">
Type of group association, such as direct or indirect.Data type: String
</td></tr><tr id="user_groups_value-SCIM-row"><td>
groups.value
</td><td id="user_groups_value-SCIM-entry">
Sys\_id of an associated group record.Data type: String
</td></tr><tr id="user_groups_ref-SCIM-row"><td>
groups.$ref
</td><td id="user_groups_ref-SCIM-entry">
URI of the associated group.Data type: String
</td></tr><tr id="user_id-SCIM-row"><td>
id
</td><td id="user_id-SCIM-entry">
Sys\_id of the associated User record.Data type: String
</td></tr><tr id="user_meta-SCIM-row"><td>
meta
</td><td id="user_meta-SCIM-entry">
Metadata pertaining to the user.Data type: Object
</td></tr><tr id="user_meta_created-SCIM-row"><td>
meta.created
</td><td id="user_meta_created-SCIM-entry">
Date and time when the user record was created.Data type: String
</td></tr><tr id="user_meta_lastModified-SCIM-row"><td>
meta.lastModified
</td><td id="user_meta_lastModified-SCIM-entry">
Date and time when the user record was last modified.Data type: String
</td></tr><tr id="user_meta_location-SCIM-row"><td>
meta.location
</td><td id="user_meta_location-SCIM-entry">
URI of the user being retrieved.Data type: String
</td></tr><tr id="user_meta_resourceType-SCIM-row"><td>
meta.resourceType
</td><td id="user_meta_resourceType-SCIM-entry">
SCIM Users' resource type.Data type: String
</td></tr><tr id="user_name-SCIM-row"><td>
name
</td><td id="user_name-SCIM-entry">
User's name information.Data type: Object
</td></tr><tr id="user_name_familyName-SCIM-row"><td>
name.familyName
</td><td id="user_name_familyName-SCIM-entry">
User's family or last name.Data type: String
</td></tr><tr id="user_name_givenName-SCIM-row"><td>
name.givenName
</td><td id="user_name_givenName-SCIM-entry">
User's given or first name.Data type: String
</td></tr><tr id="user_name_honorificPrefix-SCIM-row"><td>
name.honorificPrefix
</td><td id="user_name_honorificPrefix-SCIM-entry">
User's honorific name or title, such as Dr., Bishop, or Baron.Data type: String
</td></tr><tr id="user_name_middle-SCIM-row"><td>
name.middle
</td><td id="user_name_middle-SCIM-entry">
User's middle name.Data type: String
</td></tr><tr id="user_phoneNumbers-SCIM-row"><td>
phoneNumbers
</td><td id="user_phoneNumbers-SCIM-entry">
List of phone numbers associated with the user.Data type: Array of Objects
</td></tr><tr id="user_phoneNumbers_type-SCIM-row"><td>
phoneNumbers.type
</td><td id="user_phoneNumbers_type-SCIM-entry">
Type of phone number.Possible values:
- home
- mobile
- work
Data type: String
</td></tr><tr id="user_phoneNumbers_value-SCIM-row"><td>
phoneNumbers.value
</td><td id="user_phoneNumbers_value-SCIM-entry">
User's phone number.Data type: String
</td></tr><tr id="user_preferredLanguage-SCIM-row"><td>
preferredLanguage
</td><td id="user_preferredLanguage-SCIM-entry">
User's preferred spoken and written language.Data type: String
</td></tr><tr id="user_schemas-SCIM-row"><td>
schemas
</td><td id="user_schemas-SCIM-entry">
List of URIs of the SCIM User schemas used to process the request.Data type: Array of Strings
</td></tr><tr id="user_timezone-SCIM-row"><td>
timezone
</td><td id="user_timezone-SCIM-entry">
User's time zone.Data type: String
</td></tr><tr id="user_title-SCIM-row"><td>
title
</td><td id="user_title-SCIM-entry">
User's title, such as CEO or President.Data type: String
</td></tr><tr id="user_userName-SCIM-row"><td>
userName
</td><td id="user_userName-SCIM-entry">
Unique user name for the associated user. Data type: String
</td></tr><tr id="user_userType-SCIM-row"><td>
userType
</td><td id="user_userType-SCIM-entry">
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include:
- Contractor
- Employee
- Intern
- Temp
- External
- Unknown
Data type: String
</td></tr></tbody>
</table>
### Extension parameters returned
<table id="id_hmw_fjk_grb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr id="user_company-SCIM-row"><td>
company
</td><td id="user_company-SCIM-entry">
Details about the user's associated company.Data type: Object
</td></tr><tr id="user_company_display-SCIM-row"><td>
company.display
</td><td id="user_company_display-SCIM-entry">
Name of the company.Data type: String
</td></tr><tr id="user_company_value-SCIM-row"><td>
company.value
</td><td id="user_company_value-SCIM-entry">
Sys\_id of the company record.Data type: String
</td></tr><tr id="user_company_ref-SCIM-row"><td>
company.$ref
</td><td id="user_company_ref-SCIM-entry">
Reference URI for the company.Data type: String
</td></tr><tr id="user_costCenter-SCIM-row"><td>
costCenter
</td><td id="user_costCenter-SCIM-entry">
Details about the user's associated cost center.Data type: Object
</td></tr><tr id="user_costCenter_display-SCIM-row"><td>
costCenter.display
</td><td id="user_costCenter_display-SCIM-entry">
Name of the cost center.Data type: String
</td></tr><tr id="user_costCenter_value-SCIM-row"><td>
costCenter.value
</td><td id="user_costCenter_value-SCIM-entry">
Sys\_id of the cost center record. Data type: String
</td></tr><tr id="user_costCenter_ref-SCIM-row"><td>
costCenter.$ref
</td><td id="user_costCenter_ref-SCIM-entry">
Reference URI for the cost center.Data type: String
</td></tr><tr id="user_department-SCIM-row"><td>
department
</td><td id="user_department-SCIM-entry">
Details about the user's associated department.Data type: Object
</td></tr><tr id="user_department_display-SCIM-row"><td>
department.display
</td><td id="user_department_display-SCIM-entry">
Name of the department.Data type: String
</td></tr><tr id="user_department_value-SCIM-row"><td>
department.value
</td><td id="user_department_value-SCIM-entry">
Sys\_id of the department record. Data type: String
</td></tr><tr id="user_department_ref-SCIM-row"><td>
department.$ref
</td><td id="user_department_ref-SCIM-entry">
Reference URI for the department.Data type: String
</td></tr><tr id="user_employeeNumber-SCIM-row"><td>
employeeNumber
</td><td id="user_employeeNumber-SCIM-entry">
Numeric or alphanumeric employee number.Data type: String
</td></tr><tr id="user_gender-SCIM-row"><td>
gender
</td><td id="user_gender-SCIM-entry">
Gender of the user, such as male or female.Data type: String
</td></tr><tr id="user_location-SCIM-row"><td>
location
</td><td id="user_location-SCIM-entry">
Details about the user's associated location.Data type: Object
</td></tr><tr id="user_location_display-SCIM-row"><td>
location.display
</td><td id="user_location_display-SCIM-entry">
Name of the location.Data type: String
</td></tr><tr id="user_location_value-SCIM-row"><td>
location.value
</td><td id="user_location_value-SCIM-entry">
Sys\_id of the location record. Data type: String
</td></tr><tr id="user_location_ref-SCIM-row"><td>
location.$ref
</td><td id="user_location_ref-SCIM-entry">
Reference URI for the location.Data type: String
</td></tr><tr id="user_manager-SCIM-row"><td>
manager
</td><td id="user_manager-SCIM-entry">
Details about the user's associated manager.Data type: Object
</td></tr><tr id="user_manager_display-SCIM-row"><td>
manager.display
</td><td id="user_manager_display-SCIM-entry">
Name of the manager.Data type: String
</td></tr><tr id="user_manager_value-SCIM-row"><td>
manager.value
</td><td id="user_manager_value-SCIM-entry">
Sys\_id of the manager record. Data type: String
</td></tr><tr id="user_manager_ref-SCIM-row"><td>
manager.$ref
</td><td id="user_manager_ref-SCIM-entry">
Reference URI for the manager.Data type: String
</td></tr></tbody>
</table>
### cURL request using user sys\_id
The following example shows how to obtain a specific user record by passing their sys\_id.
curl "https://instance-servicenow.com/api/now/scim/Users/62826bf03710200044e0bfc8bcbe5df1" \ --request GET \ --header "Accept:application/scim+json" \
## SCIM - PATCH /scim/Users/\{user\_id\}
Enables you to add, replace, and remove specified fields in a user record in the User \[sys\_user\] table of a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
### URL format
Versioned URL: `/api/now/{api_version}/scim/Users/{user_id}`
Default URL: `/api/now/scim/Users/{user_id}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr><tr><td>
user\_id
</td><td>
Sys\_id of the user record to modify.Data type: String
Table: User \[sys\_user\]
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr></tbody>
</table>
<table class="rest_api_request_body"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Operations
</td><td>
Required. List of operation objects to patch the specified user record with.Data type: Array
```
"Operations": [
{
"op": "String",
"path": "String",
"value": Any
}
]
Operations.op
Required. Operation to perform.Valid values: - add: Add the specified field and value to the user record. - remove: Remove the value from the specified field. - replace: Replace the value of the specified field. Data type: String
Operations.path
Required for remove operations. Name/path of the field to modify.The path parameter can have one of the following formats:
A direct field, such as title
A nested fields, such as name.givenName
In case of complex array, it can point to a specific element with a filter, such as: emails[type eq "work"]
Default: Considers the field to be a user resource.
Operations.value
Value of the field specified in the Operations.path parameter. The format of this parameter depends on the data-type of the associated field. For example, if updating a simple string, such as the title, the value field is expressed as a string.
"Operations": [
{
"op": "add",
"path": "title",
"value": "xyz"
}
]
<div class="highlight"><pre><span></span><code> You can also declare simple string values without using **value** or **path** parameters, such as:
</code></pre></div>
"Operations": [
{
"op": "add",
"title": "xyz"
}
]
<div class="highlight"><pre><span></span><code> However, when updating a phone number, which is an array that contains objects that define additional fields to add to the user record and their associated values, the **value** field is expressed as an array of objects.
```
"Operations": [
{
"op": "add",
"path": "phoneNumbers",
"value": [
{
"type": "work",
"value": "9876543210"
},
{
"type": "home",
"value": "9876783216"
}
]
}
]
</code></pre></div></p>
<p>When specifying attribute nodes, the entry can include the nesting as follows:</p>
<div class="highlight"><pre><span></span><code>{
"op": "replace",
"value": {
"name": {
"familyName": "Jones",
"givenName": "Jennifer"
}
}
}
</code></pre></div>
<p>Or you can specify the nesting in the <strong>Operations.path</strong>:</p>
<p>
If the field being updated is not in the base-schema, you must enclose the name-value pair in an object that specifies the URN of the associated schema.
```
"value": {
"<schema_urn>": {
"<field_name>": "<new_value>"
},
}
Required. SCIM Schema URI of Patch Operation `urn:ietf:params:scim:api:messages:2.0:PatchOp`.Data type: String
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Content-Type
Data format of the request body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Check for invalid values: - Malformed request body. - Required field is not provided or empty. - Invalid user or group sys_id is provided. - Check if a read-only or immutable field is trying to be modified. - Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request or that the request does not exceed the maximum number of members.
404
Not found. The requested item wasn't found.
409
User already exists. The userName parameter must be unique.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON)
Name
Description
active
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values: - true: User is active. - false: User is inactive. Data type: Boolean
addresses
Details of the user's current mailing address.Data type: Object
Type of phone number.Possible values: - home - mobile - work Data type: String
phoneNumbers.value
User's phone number.Data type: String
preferredLanguage
User's preferred spoken and written language.Data type: String
schemas
List of URIs of the SCIM User schemas used to process the request.Data type: Array of Strings
timezone
User's time zone.Data type: String
title
User's title, such as CEO or President.Data type: String
userName
Unique user name for the associated user. Data type: String
userType
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include: - Contractor - Employee - Intern - Temp - External - Unknown Data type: String
Extension parameters returned
Name
Description
company
Details about the user's associated company.Data type: Object
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
active
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values: - true: User is active. - false: User is inactive. Data type: Boolean
addresses
Details of the user's current mailing address.Data type: Object
Type of phone number.Possible values: - home - mobile - work Data type: String
phoneNumbers.value
User's phone number.Data type: String
preferredLanguage
User's preferred spoken and written language.Data type: String
timezone
User's time zone.Data type: String
title
User's title, such as CEO or President.Data type: String
userName
Required. Unique user name for the associated user. Data type: String
userType
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include: - Contractor - Employee - Intern - Temp - External - Unknown Data type: String
Extended Schema
company
Details about the user's associated company.Data type: Object
"company": {
"value": "String"
}
company.value
Required if company is included in post. Sys\_id of the company record. Data type: String
costCenter
Details about the user's associated cost center.Data type: Object
"costCenter": {
"value": "String"
}
costCenter.value
Required if costCenter is included in post. Sys\_id of the cost center record. Data type: String
department
Details about the user's associated department.Data type: Object
"department": {
"value": "String"
}
department.value
Required if department is included in post. Sys\_id of the department record. Data type: String
employeeNumber
Numeric or alphanumeric employee number.Data type: String
gender
Gender of the user, such as male or female.Data type: String
location
Details about the user's associated location.Data type: Object
"location": {
"value": "String"
}
location.value
Required if location is included in post. Sys\_id of the location record. Data type: String
manager
Details about the user's associated manager.Data type: Object
"manager": {
"value": "String"
}
manager.value
Required if manager is included in post. Sys\_id of the manager record. Data type: String
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Content-Type
Data format of the request body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
201
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.
409
User already exists. The userName parameter must be unique.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON or XML)
Name
Description
active
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values: - true: User is active. - false: User is inactive. Data type: Boolean
addresses
Details of the user's current mailing address.Data type: Object
Type of phone number.Possible values: - home - mobile - work Data type: String
phoneNumbers.value
User's phone number.Data type: String
preferredLanguage
User's preferred spoken and written language.Data type: String
schemas
List of URIs of the SCIM User schemas used to process the request.Data type: Array of Strings
timezone
User's time zone.Data type: String
title
User's title, such as CEO or President.Data type: String
userName
Unique user name for the associated user. Data type: String
userType
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include: - Contractor - Employee - Intern - Temp - External - Unknown Data type: String
cURL request to POST user
This example shows how to POST the user Jack Sparrow to the User [sys_user] table.
Updates the specified user record in the User [sys_user] table of a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
user\_id
Sys\_id of the user record to update.Data type: String Table: User \[sys\_user\]
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
active
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values: - true: User is active. - false: User is inactive. Data type: Boolean
addresses
Details of the user's current mailing address.Data type: Object
Type of phone number.Possible values: - home - mobile - work Data type: String
phoneNumbers.value
User's phone number.Data type: String
preferredLanguage
User's preferred spoken and written language.Data type: String
timezone
User's time zone.Data type: String
title
User's title, such as CEO or President.Data type: String
userName
Required. Unique user name for the associated user. Data type: String
userType
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include: - Contractor - Employee - Intern - Temp - External - Unknown Data type: String
Extended Schema
company
Details about the user's associated company.Data type: Object
"company": {
"value": "String"
}
company.value
Required if company is included in post. Sys\_id of the company record. Data type: String
costCenter
Details about the user's associated cost center.Data type: Object
"costCenter": {
"value": "String"
}
costCenter.value
Required if costCenter is included in post. Sys\_id of the cost center record. Data type: String
department
Details about the user's associated department.Data type: Object
"department": {
"value": "String"
}
department.value
Required if department is included in post. Sys\_id of the department record. Data type: String
employeeNumber
Numeric or alphanumeric employee number.Data type: String
gender
Gender of the user, such as male or female.Data type: String
location
Details about the user's associated location.Data type: Object
"location": {
"value": "String"
}
location.value
Required if location is included in post. Sys\_id of the location record. Data type: String
manager
Details about the user's associated manager.Data type: Object
"manager": {
"value": "String"
}
manager.value
Required if manager is included in post. Sys\_id of the manager record. Data type: String
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Content-Type
Data format of the request body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
404
Not found. The requested item wasn't found.
409
User already exists. The userName parameter must be unique.
500
Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.
Response body parameters (JSON)
Name
Description
active
Flag that indicates whether the associated user is active within the ServiceNow instance.Possible values: - true: User is active. - false: User is inactive. Data type: Boolean
addresses
Details of the user's current mailing address.Data type: Object
Type of phone number.Possible values: - home - mobile - work Data type: String
phoneNumbers.value
User's phone number.Data type: String
preferredLanguage
User's preferred spoken and written language.Data type: String
schemas
List of URIs of the SCIM User schemas used to process the request.Data type: Array of Strings
timezone
User's time zone.Data type: String
title
User's title, such as CEO or President.Data type: String
userName
Unique user name for the associated user. Data type: String
userType
User type. This value is used to identify the organization to user relationship.This can be any value, but typical values might include: - Contractor - Employee - Intern - Temp - External - Unknown Data type: String
Extension parameters returned
Name
Description
company
Details about the user's associated company.Data type: Object
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
Response body parameters (JSON)
Name
Description
itemsPerPage
Number of records returned in the return results.Data type: Number
Resources
List of available resource types.Data type: Array of Objects
URI of the associated resource type on the associated ServiceNow instance.Data type: String
Resources.meta.resourceType
Always "ResourceType".Data type: String
Resources.name
Name of the resource type, such as User or Group.Data type: String
Resources.schema
Resource type's primary/base schema URI. For example: `"urn:ietf:params:scim:schemas:core:2.0:User"`.Data type: String
Resources.schemas
Schema used to process the `/ResourceType` request. For example: `"urn:ietf:params:scim:schemas:core:2.0:ResourceType"`.Data type: String
Resources.schemaExtensions
List of schema extensions that apply to the associated resource type. For example: `"urn:ietf:params:scim:schemas:extension: servicenow:2.0:User"`.Data type: Array of Object
Flag that indicates whether the schema extension is required for the resource type.Possible values: - true: A resource of this type must include this schema extension and also include any attributes declared as required in this schema extension. - false: A resource of this type may omit this schema extension. Data type: Boolean
Resources.schemaExtensions.schema
URI of an extended schema. For example: `"urn:ietf:params:scim:schemas:extension:servicenow: 2.0:User"`.Data type: String
schemas
Schema used to process the list response to the request. For example: `"urn:ietf:params:scim:api:messages:2.0:ListResponse"` Data type: String
startIndex
One-based index into the Resource table at which records were retrieved. Data type: String
totalResults
Total number of records that match the request.Data type: Number
cURL request
The following example shows how to obtain the SCIM resource types supported by a ServiceNow instance.
curl "https://instance-servicenow.com/api/now/scim/ResourceTypes \
--request GET \
--header "Accept:application/scim+json" \
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
ResourceName
Unique ID of the resource type to retrieve.Valid values: - Company - CostCenter - Department - Group - Location - User Data type: String
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
description
Brief description of the resource type.Data type: String
endpoint
Name of the HTTP-addressable endpoint relative to the Base URL of the service provider, for example "Companies".Data type: String
id
Unique identifier for the resource. Use this attribute when calling GET /scim/ResourceType/\{resource\_id\} endpoint.Data type: String
meta
Information that further describes the associated resource.Data type: Object
URI of the associated resource type on the associated ServiceNow instance.Data type: String
meta.resourceType
Always "ResourceType".Data type: String
name
Name of the resource type, such as User or Group.Data type: String
schema
Resource type's primary/base schema URI. For example: `"urn:ietf:params:scim:schemas:core:2.0:User"`.Data type: String
schemas
Schema used to process the `/ResourceType` request. For example: `"urn:ietf:params:scim:schemas:core:2.0:ResourceType"`.Data type: String
schemaExtensions
List of schema extensions that apply to the associated resource type. For example: `"urn:ietf:params:scim:schemas:extension: servicenow:2.0:User"`.Data type: Array of Object
Flag that indicates whether the schema extension is required for the resource type.Possible values: - true: A resource of this type must include this schema extension and also include any attributes declared as required in this schema extension. - false: A resource of this type may omit this schema extension. Data type: Boolean
schemaExtensions.schema
URI of an extended schema. For example: `"urn:ietf:params:scim:schemas:extension:servicenow: 2.0:User"`.Data type: String
schemas
Schema used to process the list response to the request. For example: `"urn:ietf:params:scim:api:messages:2.0:ListResponse"` Data type: String
cURL request
The following example shows how to obtain the User SCIM resource type from a ServiceNow instance.
curl "https://instance-servicenow.com/api/now/scim/ResourceTypes/"User" \
--request GET \
--header "Accept:application/scim+json" \
Retrieves information about all System for Cross-domain Identity Management (SCIM) resource schemas supported by a ServiceNow instance. These schemas define the attributes available for each resource type.
This is a public endpoint and does not require any roles to access.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
Response body parameters (JSON)
Name
Description
Standard RFC7643 return results
Method returns results in compliance with the RFC7643 standard. For details see Schema Definition in the RFC7643 specification.
cURL request
The following example shows how to obtain the SCIM schemas supported by a ServiceNow instance.
curl "https://instance-servicenow.com/api/now/scim/Schemas \
--request GET \
--header "Accept:application/scim+json" \
Response:
{
"schemas":[
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults":8,
"Resources":[
{
"schemas":[
"urn:ietf:params:scim:schemas:core:2.0:Schema"
],
"id":"urn:ietf:params:scim:schemas:core:2.0:User",
"name":"User",
"description":"User Account",
"attributes":[
{
"name":"active",
"type":"boolean",
"multiValued":false,
"description":"A Boolean value indicating the User's administrative status.",
"required":false,
"caseExact":true,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"addresses",
"type":"complex",
"subAttributes":[
{
"name":"country",
"type":"string",
"multiValued":false,
"description":"The country name component.",
"required":false,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"formatted",
"type":"string",
"multiValued":false,
"description":"The full mailing address, formatted for display or use with a mailing label. This attribute MAY contain newlines.",
"required":false,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"locality",
"type":"string",
"multiValued":false,
"description":"The city or locality component.",
"required":false,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"postalCode",
"type":"string",
"multiValued":false,
"description":"The zipcode or postal code component.",
"required":false,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"primary",
"type":"boolean",
"multiValued":false,
"description":"A Boolean value indicating the 'primary' or
preferred attribute value for this attribute, e.g., the preferred address.
The primary attribute value 'true' MUST appear no more than once.",
"required":false,
"caseExact":true,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"region",
"type":"string",
"multiValued":false,
"description":"The state or region component.",
"required":false,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"streetAddress",
"type":"string",
"multiValued":false,
"description":"The full street address component, which may include house number,
street name, PO BOX, and multi-line extended street address information. This
attribute MAY contain newlines.",
"required":false,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"type",
"type":"string",
"multiValued":false,
"description":"A label indicating the attribute's function; e.g., 'work' or 'home'.",
"required":false,
"canonicalValues":["other","work","home"],
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
}
],
"multiValued":true,
"description":"Physical mailing addresses for this User.",
"required":false,
"caseExact":true,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
.
.
.
{
"schemas":[
"urn:ietf:params:scim:schemas:core:2.0:Schema"
],
"id":"urn:ietf:params:scim:schemas:custom:servicenow:2.0:Department",
"name":"Department",
"description":"Department",
"attributes":[
{
"name":"name",
"type":"string",
"multiValued":false,
"description":"The name of the department.",
"required":false,
"caseExact":false,
"mutability":"readOnly",
"returned":"default",
"uniqueness":"none"
}
],
"meta":{
"resourceType":"Schema",
"location":"https://instance-servicenow.com/api/now/scim/Schemas/urn:ietf:params:scim:schemas:custom:servicenow:2.0:Department"
}
},
{
"schemas":[
"urn:ietf:params:scim:schemas:core:2.0:Schema"
],
"id":"urn:ietf:params:scim:schemas:custom:servicenow:2.0:CostCenter",
"name":"CostCenter",
"description":"CostCenter",
"attributes":[
{
"name":"name",
"type":"string",
"multiValued":false,
"description":"The name of the cost center.",
"required":false,
"caseExact":false,
"mutability":"readOnly",
"returned":"default",
"uniqueness":"none"
}
],
"meta":
{
"resourceType":"Schema",
"location":"https://instance.servicenow.com/api/now/scim/Schemas/urn:ietf:params:scim:schemas:custom:servicenow:2.0:CostCenter"
}
},
{
"schemas":[
"urn:ietf:params:scim:schemas:core:2.0:Schema"
],
"id":"urn:ietf:params:scim:schemas:custom:servicenow:2.0:Location",
"name":"Location",
"description":"Location",
"attributes":[
{
"name":"name",
"type":"string",
"multiValued":false,
"description":"The location name.",
"required":false,
"caseExact":false,
"mutability":"readOnly",
"returned":"default",
"uniqueness":"none"
}
],
"meta":{
"resourceType":"Schema",
"location":"https://instance.servicenow.com/api/now/scim/Schemas/urn:ietf:params:scim:schemas:custom:servicenow:2.0:Location"
}
}
],
"startIndex":1,
"itemsPerPage":8
}
SCIM - GET /scim/Schemas/{SchemaName}
Retrieves information about the specified System for Cross-domain Identity Management (SCIM) resource schemas supported by a ServiceNow instance. These schemas define the attributes available for each resource type.
This is a public endpoint and does not require any roles to access.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
SchemaName
URI of the resource schema to return.Valid values: - urn:ietf:params:scim:schemas:core:2.0:User - urn:ietf:params:scim:schemas:extension: enterprise:2.0:User - urn:ietf:params:scim:schemas:extension: servicenow:2.0:User - urn:ietf:params:scim:schemas:core:2.0:Group - urn:ietf:params:scim:schemas:custom: servicenow:2.0:Company - urn:ietf:params:scim:schemas:custom: servicenow:2.0:Department - urn:ietf:params:scim:schemas:custom: servicenow:2.0:CostCenter - urn:ietf:params:scim:schemas:custom: servicenow:2.0:Location Data type: String
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
Standard RFC7643 return results
Method returns results in compliance with the RFC7643 standard. For details see Schema Definition in the RFC7643 specification.
cURL request
The following example shows how to obtain the core Group SCIM schema from a ServiceNow instance.
curl "https://instance-servicenow.com/api/now/scim/Schemas/"urn:ietf:params:scim:schemas:core:2.0:Group" \
--request GET \
--header "Accept:application/scim+json" \
Response:
{
"schemas":[
"urn:ietf:params:scim:schemas:core:2.0:Schema"
],
"id":"urn:ietf:params:scim:schemas:core:2.0:Group",
"name":"Group",
"description":"Group",
"attributes":[
{
"name":"displayName",
"type":"string",
"multiValued":false,
"description":"A human-readable name for the Group.",
"required":true,
"caseExact":false,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
},
{
"name":"members",
"type":"complex",
"subAttributes":[
{
"name":"display",
"type":"string",
"multiValued":false,
"description":"A human readable name, primarily used for display purposes.",
"required":false,
"caseExact":false,
"mutability":"immutable",
"returned":"default",
"uniqueness":"none"
},
{
"name":"value",
"type":"string",
"multiValued":false,
"description":"The identifier of a group member.",
"required":true,
"caseExact":false,
"mutability":"immutable",
"returned":"default",
"uniqueness":"none"
},
{
"name":"$ref",
"type":"reference",
"multiValued":false,
"description":"The URI of the member resource.",
"required":false,
"caseExact":true,
"mutability":"immutable",
"returned":"default",
"uniqueness":"none",
"referenceTypes":["Group","User"]
}
],
"multiValued":true,
"description":"A list of members of the Group.",
"required":false,
"caseExact":true,
"mutability":"readWrite",
"returned":"default",
"uniqueness":"none"
}
],
"meta":{
"resourceType":"Schema",
"location":"https://instance-servicenow.com/api/now/scim/Schemas/urn:ietf:params:scim:schemas:core:2.0:Group"
}
}
SCIM - GET /scim/ServiceProviderConfig
Returns the configuration metadata to use to obtain information about the service capabilities, configurations, schemas, and resource types for the System for Cross-domain Identity Management (SCIM) endpoints available within a ServiceNow instance.
This is a public endpoint and does not require any roles to access.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
None
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
The following example shows how to obtain the SCIM configuration metadata for a ServiceNow instance.
curl "https://instance-servicenow.com/api/now/scim/ServiceProviderConfig \
--request GET \
--header "Accept:application/scim+json" \
Response:
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"
],
"patch": {
"supported": true
},
"bulk": {
"supported": false,
"maxOperations": 0,
"maxPayloadSize": 1000000
},
"filter": {
"supported": true,
"maxResults": 500
},
"changePassword": {
"supported": false
},
"sort": {
"supported": false
},
"etag": {
"supported": false
},
"authenticationSchemes": [
{
"name": "OAuth 2.0 Bearer Token",
"description": "The OAuth 2.0 Bearer Token Authentication scheme. OAuth
enables clients to access protected resources by obtaining an access token, which is
defined in RFC 6750 as \"a string representing an access authorization issued to the
client\", rather than using the resource owner's credentials directly.",
"specUri": "http://tools.ietf.org/html/rfc6750",
"type": "oauthbearertoken",
"primary": true
}
]
}
SCIM - GET /scim/Companies
Returns one or more company records from the Company [core_company] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Note: A query that does not return any matches returns success (HTTP status code 200) with totalResults set to 0.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
count
Number of records to return. A negative value is interpreted as zero.Data type: Number Maximum: 500 - A value greater than this results in a bad request error. Default: 10
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
filter
Filter expression to apply to the return results. Field filters are expressed as <field_name> <operator> <"value">. Refer to RFC7644 for a list of the valid operators. Note: The NOT operator is not supported by this method.
For example, to filter for all companies whose name starts with "Acme", enter displayName SW "Acme".
To specify more than one field filter, concatenate the filters using the AND operand. For example, to filter for all companies whose name starts with "Acme" and were last modified before October 3, 2021, enter displayName SW "Acme" AND meta.lastModified lt "2021-10-03T00:00:00Z". Use dot-walking to specify nested attributes.
Data type: String
Default: No filtering
sortBy
Must be specified with the sortOrder parameter. Field by which to sort the return results. Sorting is case-insensitive. You can only use those parameters available for filtering for the sortBy parameter, except that externalId is not allowed.
For values that are null:
sorted by ascending: Null values are sorted to the top.
sorted by descending: Null values are sorted to the bottom.
Data type: String
Default: No sort
sortOrder
Must be specified with the sortBy parameter. Order in which the sortBy parameter is applied to the return results. Valid values:
ascending
descending
Data type: String
Default: ascending
startIndex
One-based index into the table at which to start retrieving records. For example, if you set this parameter to 100, and the count parameter to 20, the endpoint returns records 100 through 119. Note: Any value that is set to less than one is interpreted as one.
Data type: String
Default: 1
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
401
Unauthorized. The user credentials are incorrect or have not been passed.
Response body parameters (JSON)
Name
Description
itemsPerPage
Number of records returned in the return results.Data type: Number
Resources
List of returned cost center records.Data type: Object ``` "Resources": { "id": "String", "meta": {Object}, "name": "String", "schemas": "String" }
</td></tr><tr><td>
Resources.id
</td><td>
Sys\_id of the company record.Data type: String
</td></tr><tr><td>
Resources.meta
</td><td>
Information pertaining to the company record.Data type: Object
</td></tr><tr><td>
Resources.meta.created
</td><td>
Date and time the associated company record was created.Data type: String
</td></tr><tr><td>
Resources.meta.lastModified
</td><td>
Date and time the associated company record was last modified.Data type: String
</td></tr><tr><td>
Resources.meta.location
</td><td>
URI of the associated company record.Data type: String
</td></tr><tr><td>
Resources.meta.resourceType
</td><td>
SCIM resource type; always Company.Data type: String
</td></tr><tr><td>
Resources.name
</td><td>
Company name.Data type: String
</td></tr><tr><td>
Resources.schemas
</td><td>
Schema used when processing the request.Data type: String
</td></tr><tr><td>
schemas
</td><td>
Schema used to process the list response to the request. For example: `"urn:ietf:params:scim:api:messages:2.0:ListResponse"` Data type: String
</td></tr><tr><td>
startIndex
</td><td>
One-based index into the Company \[core\_company\] table at which the records were returned.Data type: String
</td></tr><tr><td>
totalResults
</td><td id="totalResults-SCIM-entry">
Total number of records that match the request.Data type: Number
</td></tr></tbody>
</table>
### cURL request
This example shows how to retrieve the first two company records.
curl "https://instance-servicenow.com/api/now/scim/Companies?count=2" \ --request GET \ --header "Accept:application/scim+json" \
## SCIM - GET /scim/Companies/\{company\_id\}
Returns the specified company record from the Company \[core\_company\] table within a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
### URL format
Versioned URL: `/api/now/{api_version}/scim/Companies/{company_id}`
Default URL: `/api/now/scim/Groups/{company_id}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr><tr><td>
company\_id
</td><td>
Sys\_id of the company record to return.Data type: String
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None| |
### Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="Accept-SCIM-entry">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr></tbody>
</table>
|Header|Description|
|------|-----------|
|None| |
### Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](../rest-api-explorer/c_RESTAPI.md).
<table><thead><tr><th>
Status code
</th><th>
Description
</th></tr></thead><tbody><tr><td>
200
</td><td id="entry-200-status-code">
Successful. The request was successfully processed.
</td></tr><tr><td>
400
</td><td id="status_400-SCIM-entry">Bad Request. A bad request type or malformed request was detected.- Ensure that both the <strong>attributes</strong> and <strong>excludedAttributes</strong> query parameters have not been passed in the request.
- Ensure that the <strong>count</strong> parameter is not greater than 500.
- Ensure that all <strong>filter</strong> parameters are valid.</td></tr><tr><td>
401
</td><td id="entry-401-status-code">
Unauthorized. The user credentials are incorrect or have not been passed.
</td></tr><tr><td>
404
</td><td id="entry-404-status-code">
Not found. The requested item wasn't found.
</td></tr></tbody>
</table>
### Response body parameters \(JSON\)
<table id="id_mvt_mbq_3rb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
id
</td><td id="id-company-SCIM-entry">
Sys\_id of the company record.Data type: String
</td></tr><tr><td>
meta
</td><td id="meta-company-SCIM-entry">
Information pertaining to the company record.Data type: Object
</td></tr><tr><td>
meta.created
</td><td id="meta_created-company-SCIM-entry">
Date and time the associated company record was created.Data type: String
</td></tr><tr><td>
meta.lastModified
</td><td id="meta_lastModified-company-SCIM-entry">
Date and time the associated company record was last modified.Data type: String
</td></tr><tr><td>
meta.location
</td><td id="meta_location-company-SCIM-entry">
URI of the associated company record.Data type: String
</td></tr><tr><td>
meta.resourceType
</td><td id="meta_resourceType-company-SCIM-entry">
SCIM resource type; always Company.Data type: String
</td></tr><tr><td>
name
</td><td id="name-company-SCIM-entry">
Company name.Data type: String
</td></tr><tr><td>
schemas
</td><td id="schemas-company-SCIM-entry">
Schema used when processing the request.Data type: String
</td></tr></tbody>
</table>
### cURL request
This example shows how to retrieve a specific company record.
curl "https://instance-servicenow.com/api/now/scim/Companies/0c43af40c6112275011a4bd4c0143fbf" \ --request GET \ --header "Accept:application/scim+json" \
## SCIM - GET /scim/CostCenters
Returns one or more cost center records from the Cost Center \[cmn\_cost\_center\] table within a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
**Note:** A query that does not return any matches returns success \(HTTP status code 200\) with **totalResults** set to 0.
### URL format
Versioned URL: `/api/now/{api_version}/scim/CostCenters`
Default URL: `/api/now/scim/CostCenters`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
count
</td><td id="count-SCIM-entry">
Number of records to return. A negative value is interpreted as zero.Data type: Number
Maximum: 500 - A value greater than this results in a bad request error.
Default: 10
</td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr><tr><td>
filter
</td><td><p>Filter expression to apply to the return results. Field filters are expressed as <code><field_name> <operator> <"value"></code>. Refer to <a href="https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2">RFC7644</a> for a list of the valid operators. <strong>Note:</strong> The <code>NOT</code> operator is not supported by this method.</p>
<p>For example, to filter for all cost center whose name starts with "HR", enter <code>displayName SW "HR"</code>.</p>
<p>To specify more than one field filter, concatenate the filters using the <code>AND</code> operand. For example, to filter for all cost center whose name starts with "HR" and were last modified before October 3, 2021, enter <code>displayName SW "HR" AND meta.lastModified lt "2021-10-03T00:00:00Z"</code>. Use dot-walking to specify nested attributes.</p>
<p>Data type: String</p>
<p>Default: No filtering</p></td></tr><tr><td>
sortBy
</td><td id="group_sortBy-SCIM-entry"><p>Must be specified with the <strong>sortOrder</strong> parameter. Field by which to sort the return results. Sorting is case-insensitive. You can only use those parameters available for filtering for the <strong>sortBy</strong> parameter, except that <strong>externalId</strong> is not allowed.</p>
<p>For values that are null:</p>
<ul>
<li>sorted by ascending: Null values are sorted to the top.</li>
<li>sorted by descending: Null values are sorted to the bottom.</li>
</ul>
<p>Data type: String</p>
<p>Default: No sort</p></td></tr><tr><td>
sortOrder
</td><td id="sortOrder-SCIM-entry"><p>Must be specified with the <strong>sortBy</strong> parameter. Order in which the <strong>sortBy</strong> parameter is applied to the return results. Valid values:</p>
<ul>
<li>ascending</li>
<li>descending</li>
</ul>
<p>Data type: String</p>
<p>Default: ascending</p></td></tr><tr><td>
startIndex
</td><td id="group_startIndex-SCIM-entry"><p>One-based index into the table at which to start retrieving records. For example, if you set this parameter to 100, and the <strong>count</strong> parameter to 20, the endpoint returns records 100 through 119. <strong>Note:</strong> Any value that is set to less than one is interpreted as one.</p>
<p>Data type: String</p>
<p>Default: 1</p></td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None| |
### Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="Accept-SCIM-entry">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr></tbody>
</table>
|Header|Description|
|------|-----------|
|None| |
### Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](../rest-api-explorer/c_RESTAPI.md).
<table><thead><tr><th>
Status code
</th><th>
Description
</th></tr></thead><tbody><tr><td>
200
</td><td id="entry-200-status-code">
Successful. The request was successfully processed.
</td></tr><tr><td>
400
</td><td id="status_400-SCIM-entry">Bad Request. A bad request type or malformed request was detected.- Ensure that both the <strong>attributes</strong> and <strong>excludedAttributes</strong> query parameters have not been passed in the request.
- Ensure that the <strong>count</strong> parameter is not greater than 500.
- Ensure that all <strong>filter</strong> parameters are valid.</td></tr><tr><td>
401
</td><td id="entry-401-status-code">
Unauthorized. The user credentials are incorrect or have not been passed.
</td></tr></tbody>
</table>
### Response body parameters \(JSON\)
<table id="id_tld_hxq_3rb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
itemsPerPage
</td><td id="itemsPerPage-SCIM-entry">
Number of records returned in the return results.Data type: Number
</td></tr><tr><td>
Resources
</td><td>
List of returned cost center records.Data type: Object
```
"Resources": {
"id": "String",
"meta": {Object},
"name": "String",
"schemas": "String"
}
Resources.id
Sys\_id of the cost center record.Data type: String
Resources.meta
Information pertaining to the cost center record.Data type: Object
Returns the specified cost center record from the Cost Center [cmn_cost_center] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Note: A query that does not return any matches returns success (HTTP status code 200) with totalResults set to 0.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
cost\_center\_id
Sys\_id of the cost center record to return.Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
401
Unauthorized. The user credentials are incorrect or have not been passed.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
id
Sys\_id of the cost center record.Data type: String
meta
Information pertaining to the cost center record.Data type: Object
Returns one or more department records from the Department [cmn_department] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Note: A query that does not return any matches returns success (HTTP status code 200) with totalResults set to 0.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
count
Number of records to return. A negative value is interpreted as zero.Data type: Number Maximum: 500 - A value greater than this results in a bad request error. Default: 10
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
filter
Filter expression to apply to the return results. Field filters are expressed as <field_name> <operator> <"value">. Refer to RFC7644 for a list of the valid operators. Note: The NOT operator is not supported by this method.
For example, to filter for all departments whose name starts with "Engineer", enter displayName SW "Engineer".
To specify more than one field filter, concatenate the filters using the AND operand. For example, to filter for all departments whose name starts with "Engineer" and were last modified before October 3, 2021, enter displayName SW "Engineer" AND meta.lastModified lt "2021-10-03T00:00:00Z". Use dot-walking to specify nested attributes.
Data type: String
Default: No filtering
sortBy
Must be specified with the sortOrder parameter. Field by which to sort the return results. Sorting is case-insensitive. You can only use those parameters available for filtering for the sortBy parameter, except that externalId is not allowed.
For values that are null:
sorted by ascending: Null values are sorted to the top.
sorted by descending: Null values are sorted to the bottom.
Data type: String
Default: No sort
sortOrder
Must be specified with the sortBy parameter. Order in which the sortBy parameter is applied to the return results. Valid values:
ascending
descending
Data type: String
Default: ascending
startIndex
One-based index into the table at which to start retrieving records. For example, if you set this parameter to 100, and the count parameter to 20, the endpoint returns records 100 through 119. Note: Any value that is set to less than one is interpreted as one.
Data type: String
Default: 1
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
401
Unauthorized. The user credentials are incorrect or have not been passed.
Response body parameters (JSON)
Name
Description
itemsPerPage
Number of records returned in the return results.Data type: Number
Resources
List of returned department records.Data type: Object ``` "Resources": { "id": "String", "meta": {Object}, "name": "String", "schemas": "String" }
</td></tr><tr><td>
Resources.id
</td><td>
Sys\_id of the department record.Data type: String
</td></tr><tr><td>
Resources.meta
</td><td>
Information pertaining to the department record.Data type: Object
</td></tr><tr><td>
Resources.meta.created
</td><td>
Date and time the associated department record was created.Data type: String
</td></tr><tr><td>
Resources.meta.lastModified
</td><td>
Date and time the associated department record was last modified.Data type: String
</td></tr><tr><td>
Resources.meta.location
</td><td>
URI of the associated department record.Data type: String
</td></tr><tr><td>
Resources.meta.resourceType
</td><td>
SCIM resource type; always Department.Data type: String
</td></tr><tr><td>
Resources.name
</td><td>
Department name.Data type: String
</td></tr><tr><td>
Resources.schemas
</td><td>
</td></tr><tr><td>
schemas
</td><td>
</td></tr><tr><td>
startIndex
</td><td>
One-based index into the Department \[cmn\_department\] table at which the records were returned.Data type: String
</td></tr><tr><td>
totalResults
</td><td id="totalResults-SCIM-entry">
Total number of records that match the request.Data type: Number
</td></tr></tbody>
</table>
### cURL request
This example shows how to retrieve the first two department records.
curl "https://instance-servicenow.com/api/now/scim/Departments?count=2" \ --request GET \ --header "Accept:application/scim+json" \
## SCIM - GET /scim/Departments/\{deparment\_id\}
Returns the specified department record from the Department \[cmn\_department\] table within a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
### URL format
Versioned URL: `/api/now/{api_version}/scim/Departments/{department_id}`
Default URL: `/api/now/scim/Departments/{department_id}`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr><tr><td>
department\_id
</td><td>
Sys\_id of the department record to return.Data type: String
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None| |
### Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="Accept-SCIM-entry">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr></tbody>
</table>
|Header|Description|
|------|-----------|
|None| |
### Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](../rest-api-explorer/c_RESTAPI.md).
<table><thead><tr><th>
Status code
</th><th>
Description
</th></tr></thead><tbody><tr><td>
200
</td><td id="entry-200-status-code">
Successful. The request was successfully processed.
</td></tr><tr><td>
400
</td><td id="status_400-SCIM-entry">Bad Request. A bad request type or malformed request was detected.- Ensure that both the <strong>attributes</strong> and <strong>excludedAttributes</strong> query parameters have not been passed in the request.
- Ensure that the <strong>count</strong> parameter is not greater than 500.
- Ensure that all <strong>filter</strong> parameters are valid.</td></tr><tr><td>
401
</td><td id="entry-401-status-code">
Unauthorized. The user credentials are incorrect or have not been passed.
</td></tr><tr><td>
404
</td><td id="entry-404-status-code">
Not found. The requested item wasn't found.
</td></tr></tbody>
</table>
### Response body parameters \(JSON\)
<table id="id_g3b_jdr_3rb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
id
</td><td id="id-dept-SCIM-entry">
Sys\_id of the department record.Data type: String
</td></tr><tr><td>
meta
</td><td id="meta-dept-SCIM-entry">
Information pertaining to the department record.Data type: Object
</td></tr><tr><td>
meta.created
</td><td id="meta_created-dept-SCIM-entry">
Date and time the associated department record was created.Data type: String
</td></tr><tr><td>
meta.lastModified
</td><td id="meta_lastModified-dept-SCIM-entry">
Date and time the associated department record was last modified.Data type: String
</td></tr><tr><td>
meta.location
</td><td id="meta_location-dept-SCIM-entry">
URI of the associated department record.Data type: String
</td></tr><tr><td>
meta.resourceType
</td><td id="meta_resourceType-dept-SCIM-entry">
SCIM resource type; always Department.Data type: String
</td></tr><tr><td>
name
</td><td id="name-dept-SCIM-entry">
Department name.Data type: String
</td></tr><tr><td>
schemas
</td><td id="schemas-dept-SCIM-entry">
Schema used when processing the request.Data type: String
</td></tr></tbody>
</table>
### cURL request
This example shows how to retrieve a specific department record.
curl "https://instance-servicenow.com/api/now/scim/Departments/221db0edc611228401760aec06c9d929" \ --request GET \ --header "Accept:application/scim+json" \
## SCIM - GET /scim/Locations
Returns one or more location records from the Location \[cmn\_location\] table within a ServiceNow instance using the System for Cross-domain Identity Management \(SCIM\) protocol.
**Note:** A query that does not return any matches returns success \(HTTP status code 200\) with **totalResults** set to 0.
### URL format
Versioned URL: `/api/now/{api_version}/scim/Locations`
Default URL: `/api/now/scim/Locations`
**Note:** Available versions are specified in the [REST API Explorer](../rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](../rest-api-explorer/c_CustomWebServices.md).
### Supported request parameters
<table class="rest_api_path_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
api\_version
</td><td id="version-entry-RESTAPI">
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
</td></tr></tbody>
</table>
<table class="rest_api_query_parameters"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
attributes
</td><td id="attributes-SCIM-entry"><p>Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the <strong>excludedAttributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Return all fields unless <strong>excludedAttributes</strong> is specified.</p></td></tr><tr><td>
count
</td><td id="count-SCIM-entry">
Number of records to return. A negative value is interpreted as zero.Data type: Number
Maximum: 500 - A value greater than this results in a bad request error.
Default: 10
</td></tr><tr><td>
excludedAttributes
</td><td id="excludedAttributes-SCIM-entry"><p>Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the <strong>attributes</strong> parameter.</p>
<p>Data type: String</p>
<p>Default: Do not exclude any fields.</p></td></tr><tr><td>
filter
</td><td><p>Filter expression to apply to the return results. Field filters are expressed as <code><field_name> <operator> <"value"></code>. Refer to <a href="https://datatracker.ietf.org/doc/html/rfc7644#section-3.4.2">RFC7644</a> for a list of the valid operators. <strong>Note:</strong> The <code>NOT</code> operator is not supported by this method.</p>
<p>For example, to filter for all locations whose name starts with "Ch", enter <code>displayName SW "Ch"</code>.</p>
<p>To specify more than one field filter, concatenate the filters using the <code>AND</code> operand. For example, to filter for all locations whose name starts with "Ch" and were last modified before October 3, 2021, enter <code>displayName SW "Ch" AND meta.lastModified lt "2021-10-03T00:00:00Z"</code>. Use dot-walking to specify nested attributes.</p>
<p>Data type: String</p>
<p>Default: No filtering</p></td></tr><tr><td>
sortBy
</td><td id="group_sortBy-SCIM-entry"><p>Must be specified with the <strong>sortOrder</strong> parameter. Field by which to sort the return results. Sorting is case-insensitive. You can only use those parameters available for filtering for the <strong>sortBy</strong> parameter, except that <strong>externalId</strong> is not allowed.</p>
<p>For values that are null:</p>
<ul>
<li>sorted by ascending: Null values are sorted to the top.</li>
<li>sorted by descending: Null values are sorted to the bottom.</li>
</ul>
<p>Data type: String</p>
<p>Default: No sort</p></td></tr><tr><td>
sortOrder
</td><td id="sortOrder-SCIM-entry"><p>Must be specified with the <strong>sortBy</strong> parameter. Order in which the <strong>sortBy</strong> parameter is applied to the return results. Valid values:</p>
<ul>
<li>ascending</li>
<li>descending</li>
</ul>
<p>Data type: String</p>
<p>Default: ascending</p></td></tr><tr><td>
startIndex
</td><td id="group_startIndex-SCIM-entry"><p>One-based index into the table at which to start retrieving records. For example, if you set this parameter to 100, and the <strong>count</strong> parameter to 20, the endpoint returns records 100 through 119. <strong>Note:</strong> Any value that is set to less than one is interpreted as one.</p>
<p>Data type: String</p>
<p>Default: 1</p></td></tr></tbody>
</table>
|Name|Description|
|----|-----------|
|None| |
### Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](../rest-api-explorer/c_RESTAPI.md).
<table class="rest_api_request_headers"><thead><tr><th>
Header
</th><th>
Description
</th></tr></thead><tbody><tr><td>
Accept
</td><td id="Accept-SCIM-entry">Data format of the response body. Supported types: <strong>application/json</strong> or <strong>application/scim+json</strong>.Default: <strong>application/json</strong></td></tr></tbody>
</table>
|Header|Description|
|------|-----------|
|None| |
### Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](../rest-api-explorer/c_RESTAPI.md).
<table><thead><tr><th>
Status code
</th><th>
Description
</th></tr></thead><tbody><tr><td>
200
</td><td id="entry-200-status-code">
Successful. The request was successfully processed.
</td></tr><tr><td>
400
</td><td id="status_400-SCIM-entry">Bad Request. A bad request type or malformed request was detected.- Ensure that both the <strong>attributes</strong> and <strong>excludedAttributes</strong> query parameters have not been passed in the request.
- Ensure that the <strong>count</strong> parameter is not greater than 500.
- Ensure that all <strong>filter</strong> parameters are valid.</td></tr><tr><td>
401
</td><td id="entry-401-status-code">
Unauthorized. The user credentials are incorrect or have not been passed.
</td></tr></tbody>
</table>
### Response body parameters \(JSON\)
<table id="id_qt1_xfr_3rb"><thead><tr><th>
Name
</th><th>
Description
</th></tr></thead><tbody><tr><td>
itemsPerPage
</td><td id="itemsPerPage-SCIM-entry">
Number of records returned in the return results.Data type: Number
</td></tr><tr><td>
Resources
</td><td>
List of returned location records.Data type: Object
```
"Resources": {
"id": "String",
"meta": {Object},
"name": "String",
"schemas": "String"
}
Resources.id
Sys\_id of the location record.Data type: String
Resources.meta
Information pertaining to the location record.Data type: Object
Returns the specified location record from the Location [cmn_location] table within a ServiceNow instance using the System for Cross-domain Identity Management (SCIM) protocol.
Optional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String
location\_id
Sys\_id of the location record to return.Data type: String
Name
Description
attributes
Comma-separated list of fields to return in the response. No other fields are returned.Can't be used with the excludedAttributes parameter.
Data type: String
Default: Return all fields unless excludedAttributes is specified.
excludedAttributes
Comma-separated list of fields to exclude from the records returned in the response. All other fields are returned.Can't be used with the attributes parameter.
Data type: String
Default: Do not exclude any fields.
Name
Description
None
Headers
The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.
Header
Description
Accept
Data format of the response body. Supported types: application/json or application/scim+json.Default: application/json
Header
Description
None
Status codes
The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.
Status code
Description
200
Successful. The request was successfully processed.
400
Bad Request. A bad request type or malformed request was detected.- Ensure that both the attributes and excludedAttributes query parameters have not been passed in the request. - Ensure that the count parameter is not greater than 500. - Ensure that all filter parameters are valid.
401
Unauthorized. The user credentials are incorrect or have not been passed.
404
Not found. The requested item wasn't found.
Response body parameters (JSON)
Name
Description
id
Sys\_id of the location record.Data type: String
meta
Information pertaining to the location record.Data type: Object