openapi: 3.1.0 info: title: SCIM 2.0 Users API description: | This document specifies **SCIM 2.0 User Management RESTful API** for **WSO2 Identity Server**. version: 1.0.0 servers: - url: https://{serverUrl}/t/{tenantDomain}/scim2 variables: serverUrl: default: localhost:9443 tenantDomain: default: carbon.super security: - OAuth2: [] - BasicAuth: [] paths: /Users: get: tags: - Users Endpoint summary: Filter users description: "This API returns users according to the filter, sort and pagination\ \ parameters. Pagination is not supported across user stores and LDAP multi-attribute\ \ group filtering. However, filtering is supported across multiple user stores.\n\ By default, duplicate user entries in the SCIM2 users response are persisted.\ \ To remove the duplicate user entries, add the following configuration to\ \ the deployment.toml file.

\n\n** Note\nAccording to the SCIM\ \ specification, the `totalResutls` attribute should return total number of\ \ results returned by the list or query operation. But due to the limitation\ \ of the LDAP user store, when we use the pagination paramters, we cannot\ \ get total number of users in the database. So, we are returning the total\ \ number of users per page as the `totalResults`. This is only applicable\ \ for the LDAP user store. The JDBC user store is working according to the\ \ specification.\n\n[scim2]\nremove_duplicate_users_in_users_response = true\n\ \nScope(Permission) required:`internal_user_mgt_list`\n \n" operationId: getUser parameters: - name: attributes in: query description: SCIM defined attributes parameter. schema: type: string - name: excludedAttributes in: query description: SCIM defined excludedAttribute parameter. schema: type: string - name: filter in: query description: | Filter expression for filtering. Supported filters are ‘Ew’, ‘Eq’, ‘Co’, ‘Sw’, ‘Ne’, ‘and’. schema: type: string - name: startIndex in: query description: The 1-based index of the first query result schema: type: integer format: int32 - name: count in: query description: Specifies the desired maximum number of query results per page. schema: type: integer format: int32 - name: domain in: query description: The name of the user store where filtering needs to be applied. schema: type: string responses: 200: description: Valid users are found content: application/scim+json: schema: $ref: '#/components/schemas/UserObjectListResponseObject' 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' x-codeSamples: - lang: Curl source: | curl -X 'GET' \ 'https://localhost:9443/scim2/Users' \ -H 'accept: application/scim+json' post: tags: - Users Endpoint summary: Create user description: "This API creates a user and returns the user details along with\ \ the user's unique ID.\n\n\ You can create a user in two ways:\n\ 1. **Set a password for the user**: Include the `password` parameter in the request body to set an initial password for the user.\n\ 2. **Invite the user to set their own password**: Set the `askPassword` parameter to `true` in the `urn:scim:wso2:schema` extension. An email will be sent to the user with instructions to set their password and confirm their account.\n\n \nScope(Permission) required:`internal_user_mgt_create`\n \n" operationId: createUser parameters: - name: attributes in: query description: SCIM defined attributes parameter. schema: type: string - name: excludedAttributes in: query description: SCIM defined excludedAttribute parameter. schema: type: string requestBody: content: application/scim+json: schema: oneOf: - $ref: '#/components/schemas/UserObject' - $ref: '#/components/schemas/UserObjectPassInvite' required: false responses: 201: description: User is created. content: application/scim+json: schema: $ref: '#/components/schemas/UserResponseObject' 400: description: Invalid Input content: application/scim+json: schema: $ref: '#/components/schemas/ErrorInvalidInput' 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' 409: description: User attribute value already exists content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserConflict' 500: description: Internal Server Error content: application/scim+json: schema: $ref: '#/components/schemas/ErrorInternalServerError' x-codeSamples: - lang: Curl source: | curl -X 'POST' \ 'https://localhost:9443/scim2/Users' \ -H 'accept: application/scim+json' \ -H 'Content-Type: application/scim+json' \ -d '{ "schemas": [], "name": { "givenName": "Kim", "familyName": "Berry" }, "userName": "kim", "password": "MyPa33w@rd", "emails": [ { "value": "kim@gmail.com", }, { "type": "work", "value": "kim@wso2.com" } ], "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "employeeNumber": "1234A", "manager": { "value": "Taylor" } } }' x-codegen-request-body-name: body /Users/.search: post: tags: - Users Endpoint summary: Search users description: "This API returns users according to the filter, sort and pagination\ \ parameters.\n\n Scope(Permission) required:`internal_user_mgt_list`\n \n" operationId: getUsersByPost requestBody: content: application/scim+json: schema: $ref: '#/components/schemas/UserSearchRequestObject' required: false responses: 200: description: Valid users are found content: application/scim+json: schema: $ref: '#/components/schemas/UserObjectListResponseObject' 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' x-codeSamples: - lang: Curl source: | curl -X 'POST' \ 'https://localhost:9443/scim2/Users/.search' \ -H 'accept: application/scim+json' \ -H 'Content-Type: application/scim+json' \ -d '{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:SearchRequest" ], "attributes": [ "name.familyName", "userName" ], "filter": "userName sw ki and name.familyName co err", "domain": "PRIMARY", "startIndex": 1, "count": 10 }' x-codegen-request-body-name: body /Users/{id}: get: tags: - Users Endpoint summary: Get user by ID description: "Return user details if a user found.\n\n Scope(Permission) required:`internal_user_mgt_view`\n \n" operationId: getUser by id parameters: - name: id in: path description: Unique ID of the resource type. required: true schema: type: string - name: attributes in: query description: SCIM defined attributes parameter. schema: type: string - name: excludedAttributes in: query description: SCIM defined excludedAttribute parameter. schema: type: string responses: 200: description: Valid user is found content: application/scim+json: schema: $ref: '#/components/schemas/UserResponseObject' 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' x-codeSamples: - lang: Curl source: | curl -X 'GET' \ 'https://localhost:9443/scim2/Users/{user-id}' \ -H 'accept: application/scim+json' put: tags: - Users Endpoint summary: Update user - PUT description: "This API updates user details and returns the updated user details\ \ using a PUT operation.\n\n Scope(Permission) required:`internal_user_mgt_update`\n \n" operationId: updateUser parameters: - name: id in: path description: Unique ID of the resource type. required: true schema: type: string - name: attributes in: query description: SCIM defined attributes parameter. schema: type: string - name: excludedAttributes in: query description: SCIM defined excludedAttribute parameter. schema: type: string requestBody: content: application/scim+json: schema: $ref: '#/components/schemas/UserUpdateObject' required: false responses: 200: description: Valid user is found content: application/scim+json: schema: $ref: '#/components/schemas/UserResponseObject' 400: description: Invalid Input content: application/scim+json: schema: $ref: '#/components/schemas/ErrorInvalidInput' 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' 409: description: User attribute value already exists content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserConflict' x-codeSamples: - lang: Curl source: | curl -X 'PUT' \ 'https://localhost:9443/scim2/Users/{user-id}' \ -H 'accept: application/scim+json' \ -H 'Content-Type: application/scim+json' \ -d '{ "schemas": [], "name": { "givenName": "Kim", "familyName": "Berry" }, "userName": "kim", "emails": [ { "value": "kim@gmail.com", }, { "type": "work", "value": "kim@wso2.com" } ], "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "employeeNumber": "1234A", "manager": { "value": "Taylor" } } }' x-codegen-request-body-name: body delete: tags: - Users Endpoint summary: Delete user by ID description: "This API deletes a user using the user's unique ID.\n\n \ Scope(Permission) required:`internal_user_mgt_delete`\n" operationId: deleteUser parameters: - name: id in: path description: Unique ID of the resource type. required: true schema: type: string responses: 204: description: User is deleted content: {} 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' x-codeSamples: - lang: Curl source: | curl -X 'DELETE' \ 'https://localhost:9443/scim2/Users/{user-id}' \ -H 'accept: */*' patch: tags: - Users Endpoint summary: Update user - PATCH description: "This API updates user details and returns the updated user details\ \ using a PATCH operation.\n\n \ \n Scope(Permission) required:`internal_user_mgt_update`\n\nSupported\ \ Operations: `add`, `replace`, `remove`\n \n" operationId: patchUser parameters: - name: id in: path description: Unique id of the resource type. required: true schema: type: string - name: attributes in: query description: SCIM defined attributes parameter. schema: type: string - name: excludedAttributes in: query description: SCIM defined excludedAttribute parameter. schema: type: string requestBody: content: application/scim+json: schema: $ref: '#/components/schemas/PatchOpperationInput' required: false responses: 200: description: Valid user is found content: application/scim+json: schema: $ref: '#/components/schemas/UserResponseObject' 400: description: Invalid Input content: application/scim+json: schema: $ref: '#/components/schemas/ErrorInvalidInput' 401: description: Unauthorized content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUnauthorized' 403: description: Forbidden content: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' 409: description: User attribute value already exists content: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserConflict' x-codeSamples: - lang: Curl source: | curl -X 'PATCH' \ 'https://localhost:9443/scim2/Users/user-id' \ -H 'accept: application/scim+json' \ -H 'Content-Type: application/scim+json' \ -d '{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:PatchOp" ], "Operations": [ { "op": "add", "value": { "nickName": "shaggy" } } ] }' x-codegen-request-body-name: body components: schemas: UserObject: title: Set a password for the user required: - password type: object properties: schemas: type: object properties: {} examples: - [] name: type: object properties: givenName: type: string description: The `givenName` you specify will be entered for the First Name attribute in the user's profile. examples: - Kim familyName: type: string description: The `familyName` you specify will be entered for the Last Name attribute in the user's profile. examples: - Berry userName: type: string description: The `username` you specify will be used by the user for log in. examples: - kim password: type: string description: Use this parameter to set a password for the user account. The user will be able to reset this password later. When setting the password, be sure to follow the password-validation rules configured for your organization. examples: - aBcd!23# emails: type: array description: Currently, the first email of the array (without a specified type) is treated as the primary email and assigning a type to this email is not supported. examples: - - value: kim@gmail.com primary: true - type: work value: kim@wso2.com items: type: object properties: {} urn:ietf:params:scim:schemas:extension:enterprise:2.0:User: type: object properties: employeeNumber: type: string examples: - 1234A manager: type: object properties: value: type: string examples: - Taylor UserObjectPassInvite: title: Invite the user to set their own password type: object properties: schemas: type: object properties: {} examples: - [] name: type: object properties: givenName: type: string description: The `givenName` you specify will be entered for the First Name attribute in the user's profile. examples: - Kim familyName: type: string description: The `familyName` you specify will be entered for the Last Name attribute in the user's profile. examples: - Berry userName: type: string description: The `username` you specify will be used by the user for log in. examples: - kim emails: type: array description: Currently, the first email (without a specified type) is treated as the primary email and assigning a type to this email is not supported. examples: - - value: kim@gmail.com primary: true items: type: object properties: {} urn:ietf:params:scim:schemas:extension:enterprise:2.0:User: type: object properties: manager: type: object properties: value: type: string examples: - Taylor urn:scim:wso2:schema: type: object required: - askPassword properties: askPassword: type: boolean description: If this parameter is set to `true`, users will be allowed configure their own password. An email is sent to the specified email address, which will have instructions for the user to set the password and confirm the new user account. examples: - true UserResponseObject: required: - meta type: object properties: meta: type: object properties: created: type: string examples: - 2018-08-17T10:34:29Z location: type: string examples: - https://localhost:9443/scim2/Users/008bba85-451d-414b-87de-c03b5a1f4217 lastModified: type: string examples: - 2018-08-17T10:34:29Z resourceType: type: string examples: - User schemas: type: object properties: {} examples: - - urn:ietf:params:scim:schemas:core:2.0:User - urn:ietf:params:scim:schemas:extension:enterprise:2.0:User userName: type: string examples: - PRIMARY/kim id: type: string examples: - 008bba85-451d-414b-87de-c03b5a1f4217 name: type: object properties: givenName: type: string examples: - Kim familyName: type: string examples: - Berry emails: type: array examples: - - value: kim@gmail.com - type: work value: kim@wso2.com items: type: object properties: {} urn:ietf:params:scim:schemas:extension:enterprise:2.0:User: type: object properties: employeeNumber: type: string examples: - 1234A manager: type: object properties: value: type: string examples: - Taylor roles: type: object properties: {} examples: - - type: default value: Internal/everyone UserUpdateObject: type: object properties: schemas: type: object properties: {} examples: - [] name: type: object properties: givenName: type: string examples: - Kim familyName: type: string examples: - Berry userName: type: string examples: - kim emails: type: array examples: - - value: kim@gmail.com - type: work value: kim@wso2.com items: type: object properties: {} urn:ietf:params:scim:schemas:extension:enterprise:2.0:User: type: object properties: employeeNumber: type: string examples: - 1234A manager: type: object properties: value: type: string examples: - Taylor PatchOpperationInput: type: object properties: schemas: type: array items: type: object examples: - urn:ietf:params:scim:api:messages:2.0:PatchOp Operations: type: array items: $ref: '#/components/schemas/OperationMeItem' OperationMeItem: type: object properties: op: type: string enum: - add - remove - replace value: type: object properties: nickName: type: string examples: - shaggy UserObjectListResponseObject: type: object properties: totalResults: type: integer examples: - 1 startIndex: type: integer examples: - 1 itemsPerPage: type: integer examples: - 1 schemas: type: object properties: {} examples: - - urn:ietf:params:scim:api:messages:2.0:ListResponse Resources: type: array items: $ref: '#/components/schemas/UserResponseObject' UserSearchRequestObject: type: object properties: schemas: type: object properties: {} examples: - - urn:ietf:params:scim:api:messages:2.0:SearchRequest attributes: type: object description: SCIM defined attributes parameter. properties: {} examples: - - name.familyName - userName filter: type: string description: The expression used for filtering. Supported filters are ew, eq, co, sw, and and. examples: - userName sw ki and name.familyName co err domain: type: string description: The name of the user store where filtering needs to be applied. examples: - PRIMARY startIndex: type: integer format: int32 description: The 1-based index of the first query result examples: - 1 count: type: integer format: int32 description: Specifies the desired maximum number of query results per page. examples: - 10 ErrorInvalidInput: required: - detail - status type: object properties: status: type: string examples: - "400" schemas: type: string examples: - urn:ietf:params:scim:api:messages:2.0:Error scimType: type: string examples: - invalidSyntax detail: type: string examples: - Request is unparsable, syntactically incorrect, or violates schema. ErrorUnauthorized: required: - status type: object properties: status: type: string examples: - "401" schemas: type: string examples: - urn:ietf:params:scim:api:messages:2.0:Error scimType: type: string examples: - Unauthorized ErrorForbidden: required: - status type: object properties: status: type: string examples: - "403" schemas: type: string examples: - urn:ietf:params:scim:api:messages:2.0:Error scimType: type: string examples: - Forbidden ErrorInternalServerError: required: - detail - status type: object properties: status: type: string examples: - "500" schemas: type: string examples: - urn:ietf:params:scim:api:messages:2.0:Error detail: type: string examples: - Internal Server Error. ErrorUserConflict: required: - detail - status type: object properties: status: type: string examples: - "409" schemas: type: array examples: - urn:ietf:params:scim:api:messages:2.0:Error detail: type: string examples: - User attribute value already exists securitySchemes: BasicAuth: type: http scheme: basic OAuth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://localhost:9443/oauth/authorize tokenUrl: https://localhost:9443/oauth/token scopes: read: Grants read access write: Grants write access admin: Grants read and write access to administrative information