User

This contains APIs related to User as defined in Harness

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

Request
Security:
ApiKey (readwrite)
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"
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
curl -i -X GET \
  https://app.harness.io/gateway/ng/api/user/two-factor-auth/:authMechanism \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

List of current gen users with the given Account Identifier

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string

This is the Account Identifier. Users corresponding to this Account will be retrieved.

searchString
string
Default: ""

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

pageIndex
integer <int32>
Default: 0

Indicates the number of pages. Results for these pages will be retrieved.

pageSize
integer <int32>
Default: 50

The number of the elements to fetch

Array of objects (SortOrder)

Sort criteria for the elements.

Responses
400

Bad Request

500

Internal server error

default

This retrieves a list of Current Generation Users corresponding to the specified Account Identifier.

get/ng/api/user/currentgen
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/user/currentgen?accountIdentifier=string&searchString=&pageIndex=0&pageSize=50&sortOrders=%5Bobject%20Object%5D' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Retrieves the list of projects of the current user corresponding to the specified Account Identifier.

Request
Security:
ApiKey (readwrite)
query Parameters
accountId
string

This is the Account Identifier. Details of all the Projects within the scope of this Account will be fetched.

pageIndex
integer <int32>
Default: 0

Indicates the number of pages. Results for these pages will be retrieved.

pageSize
integer <int32>
Default: 50

The number of the elements to fetch

Array of objects (SortOrder)

Sort criteria for the elements.

Responses
400

Bad Request

500

Internal server error

default

List of projects of the current user corresponding to the specified Account Identifier

get/ng/api/user/projects
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/user/projects?accountId=string&pageIndex=0&pageSize=50&sortOrders=%5Bobject%20Object%5D' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

list of project(s) of current user in the passed account Id in form of List

Request
Security:
ApiKey (readwrite)
query Parameters
accountId
string

Account Identifier for the Entity

userId
string

User Identifier

Responses
400

Bad Request

500

Internal server error

default

Returns the list of project(s) of current user in the passed account Id in form of List

get/ng/api/user/all-projects
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/user/all-projects?accountId=string&userId=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Count of projects that are accessible to a user filtered by CreatedAt time

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
string

Account Identifier for the Entity

userId
string

user Identifier

startTime
integer <int64>

Start time to Filter projects by CreatedAt time

endTime
integer <int64>

End time to Filter projects by CreatedAt time

Responses
400

Bad Request

500

Internal server error

default

Returns the count of projects that are accessible to a user filtered by CreatedAt time

get/ng/api/user/projects-count
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/user/projects-count?accountIdentifier=string&userId=string&startTime=0&endTime=0' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates the User password

Request
Security:
ApiKey (readwrite)
Request Body schema:
currentPassword
string
newPassword
string
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": [
    ]
}

unlock user in a given scope

Request
Security:
ApiKey (readwrite)
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
curl -i -X PUT \
  'https://app.harness.io/gateway/ng/api/user/unlock-user/:userId?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

List of user's Metadata for a given scope

Request
Security:
ApiKey (readwrite)
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

Indicates the number of pages. Results for these pages will be retrieved.

pageSize
integer <int32>
Default: 50

The number of the elements to fetch

Array of objects (SortOrder)

Sort criteria for the elements.

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

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": [
    ],
  • "parentFilter": "NO_PARENT_SCOPES"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

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

Request
Security:
ApiKey (readwrite)
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/user/last-admin?userId=string&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Returns the user metadata along with rolesAssignments by userId and scope

Request
Security:
ApiKey (readwrite)
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/user/aggregate/:userId?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

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

Request
Security:
ApiKey (readwrite)
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

Indicates the number of pages. Results for these pages will be retrieved.

pageSize
integer <int32>
Default: 50

The number of the elements to fetch

Array of objects (SortOrder)

Sort criteria for the elements.

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": [
    ]
}

Add user(s) to given scope

Request
Security:
ApiKey (readwrite)
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:
emails
Array of strings [ 0 .. 100 ] items
Array of objects (RoleBinding)
userGroups
Array of strings
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": [
    ]
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates the User information

Request
Security:
ApiKey (readwrite)
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
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
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

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

Request
Security:
ApiKey (readwrite)
query Parameters
routingId
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": [
    ]
}

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

Request
Security:
ApiKey (readwrite)
query Parameters
routingId
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
curl -i -X PUT \
  'https://app.harness.io/gateway/ng/api/user/disable-two-factor-auth?routingId=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Remove user as the collaborator from the scope

Request
Security:
ApiKey (readwrite)
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
curl -i -X DELETE \
  'https://app.harness.io/gateway/ng/api/user/:userId?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets current logged in User information

Request
Security:
ApiKey (readwrite)
Responses
400

Bad Request

500

Internal server error

default

Returns current logged in user info

get/ng/api/user/currentUser
Request samples
curl -i -X GET \
  https://app.harness.io/gateway/ng/api/user/currentUser \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}