Create User

An overview of the Create User endpoint.

Endpoint Description

The "Create User" endpoint is designed to add new users to the R1 Discover platform. Users created through this endpoint have the capability to participate in activities and access their own performance and data within R1 Discover.

HTTP Method

POST /api/v1/companies/{companyId}/users

Headers

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

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

  • Authorization: Bearer {token} - A valid authorization token is required to authenticate the request.

URL Parameters

  • companyId (integer): The ID of the company under which the user will be registered. This identifier must match an existing company within R1 Discover. See Company List endpoint.

Body Parameters

  • client_id (string): A unique identifier for the user from the integration partner system. This ID must be unique within R1 Discover. (ex. R1-TechPartnerCode-SharedClientCode-0001)

  • username (string): The username for the user. This must be unique across the R1 Discover system, see the Check Global Username Availability endpoint.

  • company_username (string, optional): A specific username tied to this company, if different from the general username. If a company wants their users to a have speciic username. Must be unique within the company account, see Check Company Username Availability endpoint.

  • initial_password (string, optional): The initial password for the user account. It should meet the system's security requirements for complexity (Number, Upper/Lower Case, Special Character, 8+ Characters). System will auto-generate if left blank.

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

  • client_location (string): The primary location of the user within the company. See View Company Locations.

  • client_program (string): The program to which the user is assigned. See View Company Programs.

  • client_practitioner (string): The email address of the practitioner aligned to the user, overseeing their activities and progress. See View Company Practitioners.

  • client_status (string): Indicates whether the user account is active or inactive.

Request Examples

curl -X POST 'https://api.r1learning.com/api/v1/companies/1/users' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
-d '{
  "client_id": "abcxyz123456",
  "username": "newuser123",
  "company_username": "newuser123_comp",
  "initial_password": "P@ssw0rd!",
  "client_email": "[email protected]",
  "client_location": "Main Office",
  "client_program": "Welcome Program",
  "client_practitioner": "[email protected]",
  "client_status": "active"

Response Examples

{
  "error": 0,
  "message": "User created successfully",
  "data": {
    "username": "newuser123",
    "email": "[email protected]"
  }
}

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to create an admin.

  • Data Validation: All body parameters must be correctly formatted and complete. The system will validate these parameters and reject requests with missing or invalid data.

  • Uniqueness Required: The unique_id, username and email must be unique within the system to prevent conflicts.

  • Security Considerations: Handle initial passwords securely, users will be required to change upon first login.

  • Location, Program, and Practitioner Alignments: Verify that the location name, program name, and practitioner email provided corresponds to registered values within the system, see View Company Locations, View Company Programs, and View Company Practitioners.

Last updated