Users API reference
HCP Terraform's user objects do not contain any identifying information about a user, other than their HCP Terraform username and avatar image; they are intended for displaying names and avatars in contexts that refer to a user by ID, like lists of team members or the details of a run. Most of these contexts can already include user objects via an ?include
parameter, so you shouldn't usually need to make a separate call to this endpoint.
Show a User
Shows details for a given user.
GET /users/:user_id
Parameter | Description |
---|---|
:user_id | The ID of the desired user. |
To find the ID that corresponds to a given username, you can request a team object for a team that user belongs to, specify ?include=users
in the request, and look for the user's name in the included list of user objects.
Status | Response | Reason |
---|---|---|
200 | JSON API document (type: "users" ) | The request was successful |
401 | JSON API error object | Unauthorized |
404 | JSON API error object | User not found, or unauthorized to view the user |
Sample Request
Sample Response