Harness User API

This contains APIs related to User as defined in Harness

Operations 20

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

PUT /ng/api/user/add-user-to-groups/{userId} Set which user groups a user belongs to · Add user to user groups #
Ask an LLM
“How do I put an existing Harness user into a set of user groups?”
“Does adding a user to groups remove them from their other groups?”
Tell an agent
Put user {userId} into user groups {userGroupIdsToAdd}, replacing their other non-managed groups.
Reassign user {userId}'s group membership in project {projectIdentifier} to {userGroupIdsToAdd}.
POST /ng/api/user/users Invite users by email to a scope · Add user(s) to scope #
Ask an LLM
“Can I invite several people by email to a Harness project at once?”
“Is it possible to give invited users role bindings or user groups as they're added?”
Tell an agent
Invite {emails} to my account.
Add {emails} to project {projectIdentifier} and place them in user groups {userGroups}.
PUT /ng/api/user/password Change my password · Change user password #
Ask an LLM
“How do I change my own login password?”
“Do I need to supply my current password to set a new one?”
Tell an agent
Change my password from {currentPassword} to {newPassword}.
Update my login password to {newPassword}.
GET /ng/api/user/last-admin Check whether a user is the last admin · Check if user is last admin #
Ask an LLM
“Is this user the only admin left in the account?”
“Would removing someone leave a project with no administrator?”
Tell an agent
Check whether user {userId} is the last admin in my account.
Tell me if {userId} is the only remaining admin of project {projectIdentifier}.
PUT /ng/api/user/disable-two-factor-auth Turn off two-factor authentication for me · Disable two factor authentication #
Ask an LLM
“How do I switch off two-factor authentication on my Harness login?”
“Can I disable 2FA for my own user in an account?”
Tell an agent
Disable two-factor authentication for my user in account {accountIdentifier}.
Turn off my 2FA.
POST /ng/api/user/endImpersonation/{userId} End an impersonation session · end impersonation session for user #
Ask an LLM
“How do I stop impersonating another user?”
“Can an admin end the impersonation session they started?”
Tell an agent
End my impersonation session of user {userId}.
Stop impersonating {userId} and return to my own identity.
GET /ng/api/user/aggregate/{userId} Get a user's details and role assignments · Get detailed user information #
Ask an LLM
“What roles has a specific user been assigned in a project?”
“Where can I see one user's metadata together with their role assignments?”
Tell an agent
Show user {userId}'s details and role assignments.
Get the roles assigned to user {userId} in org {orgIdentifier}.
POST /ng/api/user/aggregate List users with their role assignments · Get list of users #
Ask an LLM
“Who has access to this project, and with which roles?”
“Can I filter the people in a scope by role or resource group?”
Tell an agent
List everyone with access to project {projectIdentifier} along with their role assignments.
Show users who hold role {roleIdentifiers}, including their role assignments.
GET /ng/api/user/two-factor-auth/{authMechanism} Get my two-factor auth setup details · Gets Two Factor Auth Settings #
Ask an LLM
“Where do I get the settings needed to set up TOTP two-factor auth for my login?”
“What does the two-factor setup look like for a given auth mechanism?”
Tell an agent
Get my two-factor authentication settings for mechanism {authMechanism}.
Fetch the {authMechanism} 2FA setup info for my user.
GET /ng/api/user/currentUser Get the logged-in user's profile · Get Current User Info #
Ask an LLM
“Who am I logged in as in Harness?”
“What account details does the API return for the current user?”
Tell an agent
Show my own user profile.
Get the currently logged-in user's info for account {accountIdentifier}.
POST /ng/api/user/batch Look up users in a scope by email or id · Get users list #
Ask an LLM
“Can I look up several users at once by their email addresses?”
“Which users in an org match a given search term?”
Tell an agent
Look up the users with emails {emails}.
Get the basic user records for ids {identifiers}.
POST /ng/api/user/impersonate/{userId} Start impersonating a user · impersonate User #
Ask an LLM
“Can an admin sign in as another user to troubleshoot what they see?”
“Do I have to give a reason when impersonating someone?”
Tell an agent
Impersonate user {userId} because {reasonOfImpersonation}.
Start an impersonation session as {userId} with reason {reasonOfImpersonation}.
PUT /ng/api/user/{userId} Update another user's name or email · Update User #
Ask an LLM
“Can I rename a user or change their email by their user id?”
“Which profile fields of a specific user can be edited?”
Tell an agent
Change user {userId}'s email to {email}.
Set user {userId}'s given name to {givenName} and family name to {familyName}.
DELETE /ng/api/user/{userId} Remove a user from a scope · Remove user from scope #
Ask an LLM
“How do I take someone off a Harness project?”
“Can I remove a collaborator from an org without deleting their account?”
Tell an agent destructive · confirm first
Remove user {userId} from project {projectIdentifier}.
Revoke {userId}'s access to my account.
GET /ng/api/user/reset-two-factor-auth/{userId} Reset a user's two-factor authentication · Reset two factor authorization #
Ask an LLM
“What can I do when a user has lost their 2FA device?”
“Can an admin reset two-factor for someone else?”
Tell an agent
Reset two-factor authentication for user {userId}.
Clear {userId}'s 2FA so they can enroll again.
PUT /ng/api/user/unlock-user/{userId} Unlock a locked-out user · Unlock user #
Ask an LLM
“How do I unlock a user who got locked out?”
“Can I unlock someone within a specific org or project?”
Tell an agent
Unlock user {userId}.
Unlock {userId} in org {orgIdentifier}.
PUT /ng/api/user/enable-two-factor-auth Turn on two-factor authentication · Enable two factor authentication #
Ask an LLM
“Can I enable TOTP two-factor authentication for a user in an account?”
“What secret key does enabling 2FA expect?”
Tell an agent
Enable two-factor auth for {email} using mechanism {mechanism}.
Turn on 2FA for user {userId} with TOTP secret {totpSecretKey}.
PUT /ng/api/user Update my user profile record · Update User #
Ask an LLM
“How do I change my own display name or preferences?”
“Can I set my default account on my user record?”
Tell an agent
Update my display name to {name}.
Set my default account to {defaultAccountId}.
POST /code/api/v1/user/favorite Mark a code resource as a favorite · Create favorite #
Ask an LLM
“Can I star a repository in Harness Code?”
“Which resource types can be added to my favorites?”
Tell an agent
Add {resource_id} to my favorites.
Favorite {resource_type} {resource_id}.
DELETE /code/api/v1/user/favorite/{resource_id} Unfavorite a code resource · Delete favorite #
Ask an LLM
“How do I unstar a repo I favorited?”
“Can I remove something from my favorites list?”
Tell an agent destructive · confirm first
Remove {resource_id} from my favorites.
Unfavorite {resource_type} {resource_id}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/harness:harness-user-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

harness-user-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Harness User API
  version: '1.0'
  description: The Harness Software Delivery Platform uses OpenAPI Specification v3.0.
  contact:
    name: API Support
    email: contact@harness.io
    url: https://harness.io/
  x-logo:
    url: https://mma.prnewswire.com/media/779232/Harnes_logo_horizontal.jpg?p=facebook
    altText: Harness
  termsOfService: https://harness.io/terms-of-use/
servers:
- url: https://app.harness.io
  description: Harness host URL
- url: https://{vanity}
  description: Vanity URL
  variables:
    vanity:
      default: app.harness.io
security:
- x-api-key: []
tags:


# --- truncated at 32 KB (103 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/harness/refs/heads/main/openapi/harness-user-api-openapi.yml