Create Users

POST /users

This API call is used to create new users.

Note: A limit of 1000 user records are allowed per request to allow processing within request timeout value.

Username and Email Collisions

If you try to create a user with a username or email that is already associated with another user, the operation will fail and return an HTTP status code 400 (Bad Request).

application/json

Body Required

  • userName string Required

    The username must be unique within the system and adhere to the specified format requirements.

    Minimum length is 2, maximum length is 60. Format should match the following pattern: ^(?=.{2,60}$)(?![.])(?!.*[.]{2})[a-zA-Z0-9._#@-]+(?<![.])$.

  • password string Required

    The password must adhere to the password complexity rule.

    Minimum length is 8, maximum length is 255. Format should match the following pattern: ^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]{8,}$.

  • name object Required
    Hide name attributes Show name attributes object
    • firstName string Required

      The first name of the user.

      Minimum length is 1, maximum length is 32. Format should match the following pattern: ^(\w|\s|'|-)+$.

    • The middle name of the user.

      Maximum length is 32.

    • lastName string Required

      The last name of the user.

      Minimum length is 1, maximum length is 32. Format should match the following pattern: ^(\w|\s|\'|-)+$.

    • displayName string Required

      The display name of the user.

      Minimum length is 1, maximum length is 50.

  • email string Required

    The email address must be unique within the system and adhere to the email format requirements.

    Maximum length is 128. Format should match the following pattern: ^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(\.[A-Za-z]{2,})$.

  • Maximum length is 20.

  • roles array[object]
    One of:
  • Hide userAccess attributes Show userAccess attributes object
    • Specifies whether the user has read only access to R2R Console. Value must be JSON boolean and not string.

    • r2RAdmin boolean

      Specifies whether the user has admin access to R2R Console. Value must be JSON boolean and not string.

    • r2rEnabled boolean

      Specifies whether the user has access to R2R Console. Value must be JSON boolean and not string.

    • Specifies whether the user has access to Close. Value must be JSON boolean and not string.

    • Specifies whether the user has access to Compliance. Value must be JSON boolean and not string.

  • This value must be a department code configured in Certification.

    Maximum length is 15.

  • This value must be a location code configured in Certification.

    Maximum length is 15.

  • This value must be a program admin role configured in Certification.

    Maximum length is 15.

  • lockedOut boolean

    The user locked out status for accessing the system.

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • Number of users processed from request.

    • Number of users successfully processed.

    • Number of users failed to process.

    • successResults array[object]

      Success result details.

      Hide successResults attributes Show successResults attributes object
    • failedResults array[object]

      Failed result details.

      Hide failedResults attributes Show failedResults attributes object
  • 400 application/json

    Failed Response

    Hide response attributes Show response attributes object
    • Number of users processed from request.

    • Number of users successfully processed.

    • Number of users failed to process.

    • successResults array[object]

      Success result details.

      Hide successResults attributes Show successResults attributes object
    • failedResults array[object]

      Failed result details.

      Hide failedResults attributes Show failedResults attributes object
  • 401 application/json

    Authentication Error. Invalid credentials.

    Hide response attributes Show response attributes object
  • Authorization Error. Invalid role for request.

POST /users
curl \
 --request POST 'https://localhost:8080/users' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '[{"name":{"lastName":"User1","firstName":"Test","middleName":"A","displayName":"Test User1"},"email":"testuser1@localhost.local","roles":[{"type":"Close","value":"CloseAdmin"},{"type":"Certification","value":"Reconciler"},{"type":"Certification","value":"ProgramAdmin"},{"type":"JournalEntry","value":"Preparer"}],"password":"Password123!","userName":"testuser1","locationId":"Americas","userAccess":{"r2RAdmin":false,"r2REnabled":true,"accessClose":true,"r2RReadOnly":true,"accessCompliance":true},"phoneNumber":"555-555-5555","departmentId":"SALES","programAdminId":"Admin"},{"name":{"lastName":"User2","firstName":"Test","middleName":"A","displayName":"Test User2"},"email":"testuser2@localhost.local","password":"Password345!","userName":"testuser2"}]'
Request example
[
  {
    "name": {
      "lastName": "User1",
      "firstName": "Test",
      "middleName": "A",
      "displayName": "Test User1"
    },
    "email": "testuser1@localhost.local",
    "roles": [
      {
        "type": "Close",
        "value": "CloseAdmin"
      },
      {
        "type": "Certification",
        "value": "Reconciler"
      },
      {
        "type": "Certification",
        "value": "ProgramAdmin"
      },
      {
        "type": "JournalEntry",
        "value": "Preparer"
      }
    ],
    "password": "Password123!",
    "userName": "testuser1",
    "locationId": "Americas",
    "userAccess": {
      "r2RAdmin": false,
      "r2REnabled": true,
      "accessClose": true,
      "r2RReadOnly": true,
      "accessCompliance": true
    },
    "phoneNumber": "555-555-5555",
    "departmentId": "SALES",
    "programAdminId": "Admin"
  },
  {
    "name": {
      "lastName": "User2",
      "firstName": "Test",
      "middleName": "A",
      "displayName": "Test User2"
    },
    "email": "testuser2@localhost.local",
    "password": "Password345!",
    "userName": "testuser2"
  }
]
Response examples (200)
{
  "sucessCount": 2,
  "failureCount": 0,
  "failureResults": [],
  "successResults": [
    {
      "id": "f1666d0e-b1ff-4367-b678-ca711623715c",
      "action": "Created",
      "username": "testuser1"
    },
    {
      "id": "b8c7fd11-10b5-454d-93a4-c854fcdaae81",
      "action": "Created",
      "username": "testuser2"
    }
  ],
  "totalProcessed": 2
}
Response examples (400)
{
  "sucessCount": 0,
  "failureCount": 2,
  "failureResults": [
    {
      "messages": [
        "A user with the given username was found.",
        "A user with the given email address was found."
      ],
      "username": "testuser1"
    },
    {
      "messages": [
        "A user with the given username was found.",
        "A user with the given email address was found."
      ],
      "username": "testuser2"
    }
  ],
  "successResults": [],
  "totalProcessed": 2
}
Response examples (401)
{
  "code": "900901",
  "message": "Invalid Credentials",
  "description": "Access failure for API: /api/admin/v1.1.0, version: v1.1.0 status: (900901) - Invalid Credentials. Make sure you have provided the correct security credentials"
}