As of December 31st, 2023 ThreadFix 2.X has reached End of Life and is no longer supported. For any further information please contact the Success and Implementation team.

Create User - API

/rest/{version}/users/new


Descriptor

Value

HTTP Method

POST

Description

Adds user to system.

Required Permission

Manage Users

Version Introduced2.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.

typeStringYes"Local" if adding a local user; "LDAP" if adding an LDAP user.
activeDirectoryIdStringPossiblyRequired when 'type' value is "LDAP".
passwordStringPossiblyRequired when 'type' value is 'local'.
confirmPasswordStringNoMust match password if supplied.
globalRoleIdStringNoUpdates user's global role. Possible values are 0 for Read Access, -1 for No Global Access, Role ids.

Sample Call:

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:

{
    "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"
        }
    }
}

www.threadfix.it | www.coalfire.com
Copyright © 2024 Coalfire. All rights reserved.

This Information Security Policy is CoalFire - Public: Distribution of this material is not limited.