PUT/directory/user-types/{userTypeId}/orgunit-access-restrict

Updates team information access restrictions for a user type.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

directory

HTTP Request

PUThttps://www.worksapis.com/v1.0/directory/user-types/{userTypeId}/orgunit-access-restrict

Path Parameters

ParameterTypeDescription
userTypeId string 

User type ID
- Resource ID
- External key in 'externalKey:{externalKey}' format


required
example : employ2c-f321-47a6-ac11-e81fcc23a8c3 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
accessRestrictType string 

Restriction type

  • ONLY_ME: View only my information.
  • ONLY_MY_ORGUNIT: View only my team.
  • ONLY_MY_AND_SPECIFIED_ORGUNIT: View my team and specified teams.

required
Allowed values : ONLY_ME, ONLY_MY_ORGUNIT, ONLY_MY_AND_SPECIFIED_ORGUNIT 
specifiedOrgUnits array (orgUnit) 

List of specified teams that can be viewed if accessRestrictType is ONLY_MY_AND_SPECIFIED_ORGUNIT.


minItems : 0
maxItems : 200 

orgUnit

PropertyTypeDescription
orgUnitId string 

Team ID

You need to use the customer's external key in externalKey:{externalKey} format to update access restrictions.


required 
includeSubOrgUnits boolean 

Indicates whether to view child teams of a specified team.


default : false 

Request Example

example

1{2  "accessRestrictType": "ONLY_MY_AND_SPECIFIED_ORGUNIT",3  "specifiedOrgUnits": [4    {5      "orgUnitId": "orgunitf-f27f-4af8-27e1-03817a911417",6      "includeSubOrgUnits": true7    }8  ]9}

Response

HTTP 200

OK

PropertyTypeDescription
accessRestrictType string 

Restriction type

  • ONLY_ME: View only my information.
  • ONLY_MY_ORGUNIT: View only my team.
  • ONLY_MY_AND_SPECIFIED_ORGUNIT: View my team and specified teams.

required
Allowed values : ONLY_ME, ONLY_MY_ORGUNIT, ONLY_MY_AND_SPECIFIED_ORGUNIT 
specifiedOrgUnits array (orgUnit) 

List of specified teams that can be viewed if accessRestrictType is ONLY_MY_AND_SPECIFIED_ORGUNIT.


minItems : 0
maxItems : 200 

orgUnit

PropertyTypeDescription
orgUnitId string 

Team ID

You need to use the customer's external key in externalKey:{externalKey} format to update access restrictions.


required 
includeSubOrgUnits boolean 

Indicates whether to view child teams of a specified team.


default : false 
orgUnitExternalKey string 

Customer's external key


readOnly : true 

Response Example

example

1{2  "accessRestrictType": "ONLY_MY_AND_SPECIFIED_ORGUNIT",3  "specifiedOrgUnits": [4    {5      "orgUnitId": "orgunitf-f27f-4af8-27e1-03817a911417",6      "includeSubOrgUnits": false,7      "orgUnitExternalKey": "ORGUNIT_EXT_01"8    }9  ]10}

HTTP 400

Bad Request

HTTP 404

Not Found