Create/Update Admin (upsert)

An overview of the Create/Update Admin endpoint

Endpoint Description

This endpoint allows you to create or update a company users.

HTTP Method

POST /api/v2/admins/{companyId}

Request

Headers:

  • Content-Type: application/json - Specifies that the request body format is JSON.

  • Accept: application/json - Indicates that the client expects a JSON response.

  • Authorization: Bearer {token} - A valid Bearer token must be provided to authenticate the request.

URL Parameters

  • companyId (integer, required): The id of the company (subscription) to create or update Admin data. Example: 1234

Query Parameters:

  • admin_id (string, required): A unique identifier for the admin from the integration partner system. This ID must be unique within R1 Discover. (ex. R1-TechPartnerCode-SharedAdminCode-0001). If it doesn't match it a new admin will be created.

  • admin_email (string, required): The email address of the admin, STRONGLY RECOMMENDED, but not required. System will return a password in the response if an email is not included.

  • admin_username (string, optional): The global username for the admin. This must be unique across the R1 Discover system, see the Check Global Username Availabilityarrow-up-right endpoint. You may also leave this blank and the system will autogenerate a username.

  • first_name (string, optional): The first name of the admin. Example: John

  • last_name (string, optional): The last name of the admin. Example: Doe

  • admin_role (string, optional): The role of the admin, default Admin-Read (See Admin Roles Endpoint). Required for creating a new admin. Example: "Admin-Read" admin_type (string, optional): The admin type of the admin, required for creating a new admin. Required for creating a new admin. Example: Practitioner

  • admin_location (string, optional): The primary location of the admin within the company. Required for creating a new admin. See List Company Locations.

  • admin_program (string, optional): The program to which the admin is aligned. Required for creating a new admin. See List Company Programs.

  • admin_status (string, optional): Indicates whether the user account is active or inactive. Required for creating a new admin.

Request Examples

Response

Data Dictionary:

  • id (integer): The unique id of the admin within the R1 Discover platform.

  • unique_id (string): The unique identifier for the admin from the integration partner system.

  • username (string): The global R1 Discover username for the user.

  • first_name (string): The first name of the user. Example: John

  • last_name (string): The last name of the user. Example: Doe

  • admin_email (string): The email address of the admin.

  • admin_role (string): The permissions role assigned to the admin

  • admin_type (string): The admin type of the admin.

  • location (string): The location where the user is aligned.

  • program (string): The program where the user is aligned.

  • status (string): Indicates the user license status (active/inactive)

  • created_at (date): Indicates when the admin account was created

Response Examples

Link to the endpoint in Postman

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the endpoint.

Last updated