User

This contains APIs related to User as defined in Harness

Add user to user groups

Adds the user to the specified user group IDs passed in the body and removes all other user groups for user except harness managed user groups

Securityx-api-key
Request
path Parameters
userId
required
string

User Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema:
userGroupIdsToAdd
Array of strings unique
Responses
400

Bad Request

500

Internal server error

default

Adds the user to specified user group IDs and removes all other user groups for user except harness managed user groups

put/ng/api/user/add-user-to-groups/{userId}
Request samples
{
  • "userGroupIdsToAdd": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Add user(s) to scope

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Request Body schema:
required
emails
required
Array of strings [ 0 .. 100 ] items
Array of objects (RoleBinding)
userGroups
Array of strings
Array of objects (UserSettingFromInvite)
Responses
400

Bad Request

500

Internal server error

default

Returns list of added users to a given scope

post/ng/api/user/users
Request samples
{
  • "emails": [
    ],
  • "roleBindings": [
    ],
  • "userGroups": [
    ],
  • "userSettings": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Change user password

Updates the User password

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
currentPassword
string

This is the current password.

newPassword
string

This is the new password.

Responses
400

Bad Request

500

Internal server error

default

Returns whether the operation is successful or not with readable response.

put/ng/api/user/password
Request samples
{
  • "currentPassword": "string",
  • "newPassword": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Check if user is last admin

Check whether the user is last admin at scope or not

Securityx-api-key
Request
query Parameters
userId
string

User identifier

accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns Boolean status whether the user is last admin at scope or not

get/ng/api/user/last-admin
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Disable two factor authentication

Disables two-factor-auth for an user in an account

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns user information

put/ng/api/user/disable-two-factor-auth
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get detailed user information

Returns the user metadata along with rolesAssignments by userId and scope

Securityx-api-key
Request
path Parameters
userId
required
string

user Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns the user metadata along with rolesAssignments by userId and scope

get/ng/api/user/aggregate/{userId}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get list of users

List of all the user's metadata along with rolesAssignments who have access to given scope

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

searchTerm
string

Search term

pageIndex
integer <int32>
Default: 0

Page Index of the results to fetch.Default Value: 0

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

Page Token of the next results to fetch.Default Value: ''

Request Body schema:
resourceGroupIdentifiers
Array of strings unique
roleIdentifiers
Array of strings unique
Responses
400

Bad Request

500

Internal server error

default

Returns list of all the user's metadata along with rolesAssignments who have access to given scope

post/ng/api/user/aggregate
Request samples
{
  • "resourceGroupIdentifiers": [
    ],
  • "roleIdentifiers": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets Two Factor Auth Settings

Gets two factor authentication settings information of the current logged in user

Securityx-api-key
Request
path Parameters
authMechanism
required
string

This is the authentication mechanism for the logged-in User. Two-Factor Authentication settings will be fetched for this mechanism.

Value: "TOTP"
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns current logged in user's two factor authentication info

get/ng/api/user/two-factor-auth/{authMechanism}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get Current User Info

Gets current logged in User information

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns current logged in user info

get/ng/api/user/currentUser
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get users list

Get list of user's for a given scope

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

pageIndex
integer <int32>
Default: 0

Page Index of the results to fetch.Default Value: 0

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

Page Token of the next results to fetch.Default Value: ''

Request Body schema:
searchTerm
string

This string will be used to filter the results. Details of all the users having this string in their name or email address will be filtered.

identifiers
Array of strings unique

Filter by User Identifiers

emails
Array of strings unique

Filter by User Emails

parentFilter
string
Enum: "NO_PARENT_SCOPES" "INCLUDE_PARENT_SCOPES" "STRICTLY_PARENT_SCOPES"
Responses
400

Bad Request

500

Internal server error

default

Returns the list of user's Metadata for a given scope

post/ng/api/user/batch
Request samples
{
  • "searchTerm": "string",
  • "identifiers": [
    ],
  • "emails": [
    ],
  • "parentFilter": "NO_PARENT_SCOPES"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update User

Updates the User information

Securityx-api-key
Request
path Parameters
userId
required
string

User Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
name
string
email
string
givenName
string
familyName
string
Responses
400

Bad Request

500

Internal server error

default

Returns the update User information

put/ng/api/user/{userId}
Request samples
{
  • "name": "string",
  • "email": "string",
  • "givenName": "string",
  • "familyName": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Remove user from scope

Remove user as the collaborator from the scope

Securityx-api-key
Request
path Parameters
userId
required
string

user Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns Boolean status whether request was successful or not

delete/ng/api/user/{userId}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Reset two factor authorization

Reset Two-Factor authorization.

Securityx-api-key
Request
path Parameters
userId
required
string
query Parameters
accountIdentifier
required
string
Responses
400

Bad Request

500

Internal server error

default

Successfully reset two factor authorization for an account

get/ng/api/user/reset-two-factor-auth/{userId}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Unlock user

unlock user in a given scope

Securityx-api-key
Request
path Parameters
userId
required
string

user Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns user information

put/ng/api/user/unlock-user/{userId}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Enable two factor authentication

Enables two-factor-auth for an user in an account

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
userId
string
email
string
twoFactorAuthenticationEnabled
boolean
mechanism
string
Value: "TOTP"
totpSecretKey
string
totpqrurl
string
Responses
400

Bad Request

500

Internal server error

default

Returns user information

put/ng/api/user/enable-two-factor-auth
Request samples
{
  • "userId": "string",
  • "email": "string",
  • "twoFactorAuthenticationEnabled": true,
  • "mechanism": "TOTP",
  • "totpSecretKey": "string",
  • "totpqrurl": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update User

Updates the User information

Securityx-api-key
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
uuid
string
name
string
email
string
token
string
defaultAccountId
string
intent
string
Array of objects (GatewayAccountRequest)
admin
boolean
twoFactorAuthenticationEnabled
boolean
emailVerified
boolean
locked
boolean
disabled
boolean
signupAction
string
edition
string
billingFrequency
string
object (UtmInfo)
externallyManaged
boolean
givenName
string
familyName
string
externalId
string
createdAt
integer <int64>
lastUpdatedAt
integer <int64>
object
isEnrichedInfoCollected
boolean
Responses
400

Bad Request

500

Internal server error

default

Returns the update User information

put/ng/api/user
Request samples
{
  • "uuid": "string",
  • "name": "string",
  • "email": "string",
  • "token": "string",
  • "defaultAccountId": "string",
  • "intent": "string",
  • "accounts": [
    ],
  • "admin": true,
  • "twoFactorAuthenticationEnabled": true,
  • "emailVerified": true,
  • "locked": true,
  • "disabled": true,
  • "signupAction": "string",
  • "edition": "string",
  • "billingFrequency": "string",
  • "utmInfo": {
    },
  • "externallyManaged": true,
  • "givenName": "string",
  • "familyName": "string",
  • "externalId": "string",
  • "createdAt": 0,
  • "lastUpdatedAt": 0,
  • "userPreferences": {
    },
  • "isEnrichedInfoCollected": true
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}