SalesHood’s SCIM API

The base URL for all calls to the SCIM API is https://{yourdomain}.saleshood.com/scim/v2/. All SCIM methods are branches of this base URL.

A SCIM token is required to access the SCIM API. This token can be acquired in your company settings page: https://{yourdomain}.saleshood.com/settings/integrations

SCIM API endpoints

Service Provider Configuration

GET /scim/v2/ServiceProviderConfig

Returns SalesHood’s configuration details for our SCIM API, including which operations are supported.

ResourceTypes

GET /scim/v2/ResourceTypes

Return the types of resources available on SalesHood’s SCIM service. Each resource type defines the endpoints, the core schema URI that defines the resource, and any supported schema extensions.

GET /scim/v2/ResourceTypes/User

Return the User resource type.

Schemas

SalesHood currently supports schemas for users. Querying the schemas will provide the most up-to-date rendering of the supported SCIM attributes.

GET /scim/v2/Schemas

Returns all configuration details

GET /scim/v2/Schemas/urn:ietf:params:scim:schemas:core:2.0:User

Returns SalesHood’s configuration details for how users are formatted.

GET /scim/v2/Schemas/urn:ietf:params:scim:schemas:core:2.0:ResourceType

Specifies the schema that describes a SCIM resource type.

GET /scim/v2/Schemas/urn:ietf:params:scim:schemas:core:2.0:Schema

Specifies the schema that describes a SCIM schema.

Users

User attributes

Attributes are the details associated with a user’s account. These are the details that someone would typically set in their profile.

The following tables map SCIM attributes to the profile fields that SalesHood uses:

SalesHood Profile FieldSCIM AttributeRequired
Data type
Email
userName
True
string
Active
active
False
boolean
Title
title
False
string
First Name
name[‘givenName’]
False
string
Last Name
name[‘familyName’]
False
string
Managerurn:ietf:params:scim:schemas:extension:enterprise:2.0:User[‘manager’][‘managerId’]

False

integer

or urn:ietf:params:scim:schemas:extension:enterprise:2.0:User[‘manager’][‘value’]
False

string
Segment

urn:ietf:params:scim:schemas:extension:enterprise:2.0:User[‘department’]

False


string



or
urn:ietf:params:scim:schemas:extension:enterprise:2.0:User[‘departmentId’]
False

integer
Groupurn:ietf:params:scim:schemas:extension:enterprise:2.0:User[‘division’]False
string

Manager Rules

  • managerId: Id of a user who would be manager of the newly created user. This can be retrieved by hover over a user’s name in user management page.  The Id of a user can also be found in the URL of a user’s profile page in SalesHood.
  • value: Email of a user who would be manager of the newly created user.

You only need to provide either a managerId or a value

If the passed value does not match a current manager, then the user’s manager will be the default manager on the instance (This is usually the first Coach user assigned on the instance).

If the passed value matches an individual user, then the individual will be promoted to manager.

Segment Rules

  • department: The segment name which the newly created user will be assigned to.
  • departmentId: The segment id which the newly created user will be assigned to. Segment id can be retrieved by opening Groups/Segments management in User Management page.

You only need to provide either a department or a departmentId

If the segment name is passed and it does not exist, a new segment will be created.

Group Rules

  • division: The group name which the newly created user will be assigned to.

Currently, only one group can be assigned per call.  

Groups cannot be removed or changed. They can only be added to a user’s assignments. If you need to remove an assignment this would need to be done in through the Manage Users page in Saleshood.

Groups cannot currently be provisioned by Group ID.

If the group does not already exist in SalesHood, then the group will not be created.  The user will not be added to a group.

User methods

GET /scim/v2/Users

GET /scim/v2/Users
GET /scim/v2/Users/?startIndex=4&count=500 HTTP/1.1
Host: saleshood.saleshood.com
Accept: application/json
Authorization: Bearer QvpuCY1bYYUF5Na5lCrrGrCIDkmh4pXj

GET /scim/v2/Users/:id

Retrieves a single user resource. The value of the :id should be the user’s corresponding SalesHood ID.

 
GET /scim/v2/Users/709 HTTP/1.1et
Host: saleshood.saleshood.com
Accept: application/json
Authorization: Bearer QvpuCY1bYYUF5Na5lCrrGrCIDkmh4pXj

POST /scim/v2/Users

Creates a user. Must include the userName attribute.

This example request body provides a detailed example of which attributes SalesHood uses

 
{
  "schemas": ["urn:scim:schemas:core:2.0", "urn:scim:schemas:extension:enterprise:2.0"],
  "userName": "firstnam_lastname@email.com",
  "active": true,
  "name": {
  "givenName": "First Name",
  "familyName": "Last Name"
  },
  "title": "Manager",
  "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{
    "manager":{
      "managerId": 1234
    },
    "department": "My Segment Name",
    "departmentId": 8888,
    "division": "My Group Name"
  }
}

PATCH /scim/v2/Users/:id

Updates an existing user resource, overwriting values for specified attributes.email Attributes that are not provided will remain unchanged.

Disabled users can be re-enabled by sending active attribute equal to true. The value of the :id should be the user’s corresponding SalesHood ID

 
{
"schemas" : ["urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],
"Operations":[
{
"op":"replace",
"path":"title",
"value":"new Title"
},
{
"op":"replace",
"path":"name.givenName",
"value":"New first name"
},
{
"op":"replace",
"path":"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department",
"value":"new segment name"
}
]
}

Here is a table that shows the path of all supported attributes.

SalesHood Profile FieldPathValue Type
Email“userName”string
Active“active”boolean
Title
"title"

string
First Name“name.givenName”
string
Manager“urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager”integer
Segment“urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department”string
or“urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:departmentId”integer
Group“urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:division”string

PUT /scim/v2/Users/:id

Updates an existing user resource, overwriting all values for a user even if an attribute is empty or not provided.

Deactivated users can be re-enabled by setting the active attribute to true. The value of the :id should be the user’s corresponding SalesHood ID.

{{
  "schemas": ["urn:scim:schemas:core:2.0"],
  "active": false,
  "userName": "other_username",
  "name": {
    "givenName": "a new first name",
    "familyName": "a new last name"
  },
  "title": "Manager"
}

DELETE /scim/v2/Users/:id

Sets a SalesHood user to deactivated and hides this user from all future requests. The value of the :id should be the user’s corresponding SalesHood ID

DELETE /scim/v2/Users/42 HTTP/1.1
Host: saleshood.saleshood.com
Accept: application/json
Authorization: Bearer QvpuCY1bYYUF5Na5lCrrGrCIDkmh4pXj

Groups

Group attributes

Attributes are the details associated with a group. These are the details that someone would typically set in their profile.

The following tables map SCIM attributes to the profile fields that SalesHood uses:

SalesHood Profile FieldSCIM AttributeRequiredData type
NamedisplayNameTruestring
MembersmembersFalseArray

Group methods

GET /scim/v2/Groups

GET /scim/v2/Groups/?startIndex=4&count=500 HTTP/1.1
Host: saleshood.saleshood.com
Accept: application/json
Authorization: Bearer QvpuCY1bYYUF5Na5lCrrGrCIDkmh4pXj

GET /scim/v2/Groups/:id

Retrieves a single group resource. The value of the :id should be the group’s corresponding SalesHood ID.

GET /scim/v2/Groups/3 HTTP/1.1et
Host: saleshood.saleshood.com
Accept: application/json
Authorization: Bearer QvpuCY1bYYUF5Na5lCrrGrCIDkmh4pXj

POST /scim/v2/Groups

Creates a group and add some members at the begining. Must include the displayName attribute.

This example request body provides a detailed example of which attributes SalesHood uses

{
	"schemas": [
		"urn:ietf:params:scim:schemas:core:2.0:Group"
	],
	"displayName": "scimGroup-Test000",
	"members": [
		{
			"display": "An Le",
			"$ref": "https://saleshood.lvh.me/scim/v2/Users/19885",
			"value": "19885"
		}
	]
}

PUT /scim/v2/Groups/:id

Updates an existing group resource, overwriting all values for a group even if an attribute is empty or not provided.

Currently the Saleshood only support update the displayName field for update SCIM API

This example request body provides a detailed example of which attributes SalesHood uses for Update method

{
	"schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group"],
	"displayName" : "scimGroup Test10"
}

PATCH /scim/v2/Groups/:id

Updates an existing group resource, overwriting values for specified attributes.

Patch function can be use in many case in SCIM. Specially in Okta, they use patch to do some actions like: remove or add members, replace any attribute of Group (displayName, members), change detail attribute of Group

This is the expample of request body of PATCH action

AttributeRequiredData typeDescription
OperationsTrueArrayList all the operations will be handled in the patch request
opTruestringName of the operation will execute. The SCIM op can be replace, remove, add
pathFalsestringName of the attribute will be taken action on. path attribute can have many format. In Saleshood we only support some case:
path: "field_name" : The action will be take on the field_name
path: "members[value eq "56360"]": This will match RegularExpression to take action
– Missing of path : The action would take the value, use the value.key is the name of attribute and the value.value is the value of the action
valueFalsestring / Array / ObjectValue of the attribute that was taken on the action. Value can be missing in some caseIn case :
{"op": "remove", "path": "members"}
All members will be removed

This is the example of request body of PATCH action

{
	"schemas": [
		"urn:ietf:params:scim:api:messages:2.0:PatchOp"
	],
	"Operations": [
		{
			"op": "replace",
			"path": "displayName",
			"value": {
				"id": "3",
				"displayName": "Group BBB"
			}
		},
		{
			"op": "replace",
			"value": "Group AAA"
		},
		{
			"op": "replace",
			"path": "members",
			"value": [
				{
					"display": "Ban Nguy",
					"value": "48842"
				},
				{
					"display": "Ban Nguy",
					"value": "56360"
				},
				{
					"display": "Ban Nguy",
					"value": "56361"
				}
			]
		},
		{
			"op": "add",
			"path": "members",
			"value": [
				{
					"display": "Ban Nguy",
					"value": "48842"
				},
				{
					"display": "Ban Nguy",
					"value": "56360"
				},
				{
					"display": "Ban Nguy",
					"value": "56361"
				}
			]
		},
		{
			"op": "remove",
			"path": "members",
			"value": [
				{
					"display": "Ban Nguy",
					"$ref": "https://saleshood.lvh.me/scim/v2/Users/48842",
					"value": "48842"
				}
			]
		},
		{
			"op": "remove",
			"path": "members[value eq \"56360\"]"
		},
		{
			"op": "remove",
			"path": "members"
		}
	]
}

DELETE /scim/v2/Groups/:id

Sets a SalesHood Groups to soft deleted and remove all of its members. The value of the :id should be the group’s corresponding SalesHood ID

DELETE /scim/v2/Groups/42 HTTP/1.1
Host: saleshood.saleshood.com
Accept: application/json
Authorization: Bearer QvpuCY1bYYUF5Na5lCrrGrCIDkmh4pXj

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.