# User Management

The User Management API adheres to the [SCIM 2.0](https://scim.cloud/) protocol unless otherwise stated, and provides management and provisioning of users in a program. <br><br> Managing users requires that the acting user have a role of Program Manager or Administrator, and users can only create or update users with a role less than or equal to their own.

  <b>Resources</b>
        <ul>
    <li>
      <a href="/usermanagementapi/user-management-overview">User Management contextual overview</a>.
    </li>
  </ul>
  <ul>
    <li>
      <a href="/usermanagementapi/user-provisioning">User provisioning use case examples</a>.
    </li>
  </ul>
  <ul>
    <li>
      <a href="/usermanagementapi/scim-patch-operations">SCIM patching and user editing use case examples</a>.</li>
  </ul>
  <ul>
    <li>
      <a href="/usermanagementapi/custom-attributes">Custom user attributes overview</a>.</li>
  </ul>
  <ul>
    <li>
      <a href="/usermanagementapi/user-role-provisioning">User role and access</a>.</li>
  </ul>


## List SCIM schemas

 - [GET /scim/v2/Schemas](https://developers.firstup.io/endpoints/openapi/user-management/listschemas.md): Returns a list of the schemas in use by this SCIM API. Implements SCIM 2.0 Specification.

## Detail a SCIM schema

 - [GET /scim/v2/Schemas/{schema_id}](https://developers.firstup.io/endpoints/openapi/user-management/detailschema.md): Returns the specified schema used by this SCIM API. Implements SCIM 2.0 specification.

## Provides SCIM Schema Provider Configuration

 - [GET /scim/v2/ServiceProviderConfig](https://developers.firstup.io/endpoints/openapi/user-management/detailserviceproviderconfig.md): Returns the Schema Provider configuration as per SCIM 2.0 Specification.
Additional references:

  SCIM 2.0 Spc Section 8.5
  SCIM 2.0 Spec Section 8.7.2

## Provides SCIM Resource Types

 - [GET /scim/v2/ResourceTypes](https://developers.firstup.io/endpoints/openapi/user-management/listresourcetypes.md): Returns available Resource Types configuration as per SCIM 2.0 Specification.
Additional references:

  SCIM 2.0 Protocol Spec Section 4
  SCIM 2.0 Spec Section 8.5

## Detail a SCIM Resource Type

 - [GET /scim/v2/ResourceTypes/{resource_id}](https://developers.firstup.io/endpoints/openapi/user-management/detailresourcetype.md): Returns the requested Resource Type SCIM 2.0 Specification.
Additional references:

  SCIM 2.0 Protocol Spec Section 4
  SCIM 2.0 Spec Section 8.5

## List users in the program

 - [GET /scim/v2/Users](https://developers.firstup.io/endpoints/openapi/user-management/listusers.md): This endpoint allows you to retrieve information about all or some of the
users stored in the Firstup application and adheres to the
SCIM 2.0 Section: 4.1 standard.

&#128218; For more in-depth guidance on using the user interface and
understanding the application's behavior, you can refer to the user
documentation provided
here.
This documentation will help bridge the gap between
the API and the intricacies of Firstup.

## Create a user in the program

 - [POST /scim/v2/Users](https://developers.firstup.io/endpoints/openapi/user-management/createuser.md): Create and provision a new user. The request should include any properties to be set on the user, and leaving any out will leave those values blank, or will use defaults.  New users have a role of "member" by default. New users have an onboarding status of "created" by default.  Setting a user's role requires that the acting user have a role the same or less than the role of the user being created. The role property is also formatted as an array to comply with SCIM protocol though it only accepts a single value. Providing more than one value will result in a 400 response. {% admonition type="info" %} Additional documentation and resources    User roles and access    User provisioning  *  SCIM user provisioning  {% /admonition%}

## Show a single program user by ID

 - [GET /scim/v2/Users/{user_id}](https://developers.firstup.io/endpoints/openapi/user-management/detailuser.md): Returns a User record for specified user in the program.

## Replace a user in the program

 - [PUT /scim/v2/Users/{user_id}](https://developers.firstup.io/endpoints/openapi/user-management/replaceuser.md): To update or replace user information, ensure that your request includes a comprehensive set of user attributes.
{% admonition type="warning" %}Utilize PUT endpoints carefully. Modified data models caused by new features or user-defined fields may lead to data loss. Refer to our  SCIM patching documentation before executing.{% /admonition %}
Quick Guidance
For a seamless process, consider the following:
1.  GET the user record to retrieve all current attributes and objects associated with the user.
2. Modify the values you wish to change within the retrieved user record.
3. Execute the PUT call with the modified user record to ensure no inadvertent data removal from the application.

Alternatively, you can opt for a  PATCH call to selectively modify specific attributes without affecting others.

Keep in mind that when updating a user's role using oath2_as_a_user, the acting user must have a role that's the same as or higher than both the starting and ending roles of the user being updated.

{% admonition type="info" %} We advise refering to our  SCIM patching documentation before executing.
Refer to our  error responses documentation for detail on errors.{% /admonition %}

## Update a user in the program

 - [PATCH /scim/v2/Users/{user_id}](https://developers.firstup.io/endpoints/openapi/user-management/patchuser.md): Update a user in the program with partial changes using SCIM PatchOp. Add, remove, or replace selected fields of the user. Role updates require the acting user's role to be the same or higher role than the user being updated both before and after the role update.
        {% admonition type="info" %} We advise refering to our  SCIM patching documentation before executing.
Refer to our  error responses documentation for detail on errors.{% /admonition %}

## Completely remove a user from the system

 - [DELETE /scim/v2/Users/{user_id}](https://developers.firstup.io/endpoints/openapi/user-management/deleteuser.md): Permanently remove a User and their details from all Programs.
A non-existent user, or a user that's already been forgotten, will return a 204.

## Show information about the current user

 - [GET /scim/v2/Users/me](https://developers.firstup.io/endpoints/openapi/user-management/me.md): Returns a User record for specified user in the program.
 {% admonition type="info"%} This endpoint requires  authentication as a user.{% /admonition %}

## Completely remove a user from the system (Not SCIM compliant)

 - [POST /v2/Users/{user_id}/forget](https://developers.firstup.io/endpoints/openapi/user-management/forgetuser.md): Permanently remove a User and their details from all Programs.
A non-existent user, or a user that's already been forgotten, will return a 202.

