OBLYTECH Logo
OBLYTECH Logo

SCIM ServiceNow: user and group provisioning through the SCIM API

The ServiceNow SCIM API lets an identity provider create, read, update and delete users and groups over REST. It needs the SCIM v2 plugin active, requires the scim_admin role, and maps SCIM users and groups onto the platform’s user and group tables.

What the SCIM API covers in a ServiceNow instance

SCIM is short for System for Cross-domain Identity Management. It is a REST pattern for keeping identity records in step between two systems, so a person added in the identity provider can appear in the platform, and a change or removal on that side flows through the same way. In ServiceNow the API sits on the receiving end. The identity provider sends the requests and the instance applies them. For the wider pattern behind this kind of integration, see the integration pattern explainer.

The API exposes six resources. User and Group carry the identity data. Company, CostCenter, Department and Location are reference records that a user record can point to. A user record links to these through extension fields, and each link is a sys_id value, so the identity provider needs the sys_id of an existing reference record before it can attach a user to it.

The API needs the SCIM v2 plugin to be active. The plugin is named SCIM v2 – ServiceNow Cross-domain Identity Management, and its identifier is com.snc.integration.scim2. Activate it before you configure either authentication route, because both routes list the SCIM plugin as a prerequisite.

How SCIM resources map to ServiceNow tables

SCIM resources do not line up one-to-one with the platform’s tables, so it helps to know where each one lands.

SCIM resource ServiceNow table
User (core and extension schemas) sys_user
Group (core and extension schemas) sys_user_group
Company core_company
CostCenter cmn_cost_center
Department cmn_department
Location cmn_location

SCIM attributes that have no matching field on the platform table go to two companion tables. The sys_scim_user table holds the extra user attributes and the sys_scim_group table holds the extra group attributes.

That split matters when you troubleshoot. When a SCIM-only attribute is missing from the main record, check the companion table for it.

Endpoints, filters and paging for user and group sync

The SCIM paths sit under an api/now/scim prefix, with one path segment per resource. A versioned prefix is also available, where the version segment goes before scim. The version is optional and defaults to the latest one. Specify a version segment only when you need an endpoint version other than the latest.

Groups support six methods. A GET on the Groups path lists groups, a GET with a group_id reads one, POST creates a group, PUT replaces it, PATCH changes specific fields, and DELETE removes it. The user resource follows the same pattern with the Users path, and for users the path identifier is the sys_id of the record.

Filters use the operators defined in RFC 7644, except NOT, which is not supported. On groups, displayName, id, meta.created and meta.lastModified can be filtered, and externalId supports the equals operator. The user list accepts a wider set, including active, userName, title, timezone and several ServiceNow extension attributes. The address, email and phone number attributes take fixed-format filters.

Paging has its own rules. The count parameter defaults to 10 and has a maximum of 500. A value above 500 returns HTTP 400, and a negative value is treated as zero. The startIndex parameter is one-based, defaults to 1, and values below 1 are treated as 1. The sortBy parameter must be paired with sortOrder, sorting is case-insensitive, and externalId cannot be used for sorting. sortOrder defaults to ascending. Null values sort to the top when ascending and to the bottom when descending. The attributes and excludedAttributes parameters cannot be used together in one request.

Requests and responses accept application/json or application/scim+json, with application/json as the default. Set the Accept and Content-Type headers explicitly when the identity provider sends the SCIM media type.

Creating, updating and patching records

A user is created with POST against the Users path. The userName attribute is required and must be unique. A successful create returns 201. The extension fields company, costCenter, department, location and manager each take a value holding a sys_id.

Updating a user with PUT also requires userName. The user_id in the path is the sys_id of the record being changed. Group PUT behaves differently for omitted fields. A field left out of the body is not changed.

PATCH sends a list of operations. Each operation uses op with the value add, remove or replace. A remove operation must include a path. Fields that sit outside the base schema go inside an object keyed by their schema URN, and the request body has to include the PatchOp schema value in its schemas attribute.

Groups have limits to plan around. A single group request can carry up to 100 members, and that ceiling can be raised through the system property com.snc.integration.scim2.max.member.count. A group PATCH may return 204 instead of 200. That depends on the UI property named Enable Group Patch API response with No Content, which defaults to false, so check the property before writing code that expects a body on each successful patch.

Setting up authentication: OAuth or Basic Auth

There are two authentication routes. Both begin with the same prerequisites: the SCIM plugin is active, and the account doing the setup holds the scim_admin role. Choose one route for each integration and configure it from start to finish. The two routes use different authentication profile records, so mixing steps from both leaves the configuration hard to reason about. For a broader view of where identity integration responsibilities sit, see ServiceNow identity integration boundaries.

The OAuth route has six steps. For background on the profile record this route uses, see the OAuth profile explainer.

  1. Open System OAuth > Application Registry and open the SCIM API record. Open the SCIM API record and verify its details.
  2. Go to System Web Services > REST API Access Policies and open the SCIM API Policy record.
  3. In the Authentication Profiles section, confirm that the SCIMAPIOAuthOnly profile is present.
  4. Confirm that the OAuth Entity field points to the SCIM API application registry record.
  5. Create the matching configuration on the identity provider side.
  6. Test the connection to confirm the provider can reach the instance.

The Basic Auth route is shorter. Basic authentication is being prepared for future deprecation, so from the Brazil release onward plan to move SCIM provisioning to OAuth 2.0, mutual TLS or federated token-based authentication.

  1. Go to System Web Services > REST API Access Policies and open the SCIM API Policy record.
  2. In the Authentication Profiles section, confirm that the SCIM API Basic Auth record is present.
  3. Set the Type field to Basic Auth.
  4. Complete the configuration on the provider side.
  5. Test the connection.

If the connection test fails, confirm that the account in use has admin permissions, then try again.

Access control and the scim_admin role

The scim_admin role is required to access the SCIM-specific tables and the private SCIM endpoints. Four access control rules on sys_scim_user and sys_scim_group, covering create, delete, read and write, map to this role. For the general model behind these rules, see access control lists explained, and for the instance-wide picture, see instance security and access control.

The role carries real weight. It is effectively equivalent to the admin role, and holders can add or update personally identifiable information, so grant it with care. A practical approach is to give the integration its own account rather than reuse an everyday administrator login, keep a written record of who holds the role, and review that list when the integration owner changes.

Status codes and error handling to plan for

Code Meaning in this API
200 Successful read, update or patch
201 Successful user creation
204 Successful group PATCH when the no-content property is enabled
401 Credentials are incorrect or were not passed
404 Record not found
409 Duplicate userName on users, or duplicate displayName on groups
500 Internal server error

Error responses carry an errors object. For large syncs, request up to 500 records per page, and set startIndex to the first record you have not yet read, since startIndex is one-based.

Frequently asked questions

Which role does the SCIM API need?

The scim_admin role. It is required for the SCIM-specific tables and the private SCIM endpoints.

Which table stores a SCIM group?

Groups map to sys_user_group. The companion table sys_scim_group holds the SCIM attributes that have no matching field there.

What happens when a user with an existing userName is created?

The request returns 409, because userName must be unique. A group that duplicates an existing displayName returns 409.

How many records does one list request return?

The default is 10 and the maximum is 500. A count above 500 returns 400. Use startIndex together with count to page through a larger set.

Can a user list be narrowed by userName?

Yes. userName is one of the filterable user attributes, so a list request can filter on it.