Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

/rest/{version}/users/new

Descriptor

Value

HTTP Method

POST

Description

Adds user to system.

Required Permission

Manage Users

Version Introduced

2.6.2


Request Header Parameters

Parameter

Value

Required

Description

Accept

String

Yes

A value of ‘application/json’ must be provided.

Request POST Data Parameters

Parameter

Value

Required

Description

name

String

Yes

Adds name of the user. Maximum 40 characters.

displayName

String

No

Adds the displayName of the user.

type

String

Yes

"Local" if adding a local user; "LDAP" if adding an LDAP user.

activeDirectoryId

String

Possibly

Required when 'type' value is "LDAP".

password

String

Possibly

Required when 'type' value is 'local'.

confirmPassword

String

No

Must match password if supplied.

globalRoleId

String

No

Updates user's global role. Possible values are 0 for Read Access, -1 for No Global Access, Role ids.

Sample Call:

Code Block
curl -H 'Accept: application/json' -H "Authorization: APIKEY {apiKey}" -X POST --data 'name=testUser3&type=ldap&globalRoleId=2&a
ctiveDirectoryId=2' http://localhost:8080/threadfix/rest/latest/users/new

Sample Output:

Code Block
{
    "message": "",
    "success": true,
    "responseCode": -1,
    "object": {
        "id": 109,
        "name": "testuser",
        "displayName": "Test User",
        "isLdapUser": true,
        "hasGlobalGroupAccess": true,
        "globalRole": {
            "id": 2,
            "displayName": "User"
        },
        "type": "LDAP",
        "activeDirectory": {
            "id": 2,
            "name": "Spencer Davis Group"
        }
    }
}

Page Tree
rootwip - Users, Roles, and Groups API