Movatterモバイル変換


[0]ホーム

URL:


HashiConf 2025Don't miss the live stream of HashiConf Day 2 happening now View live stream

You are viewing documentation for version v202409-3.View latest version.

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

ParameterDescription
:user_idThe ID of the desired user.

To find the ID that corresponds to a given username, you can request ateam 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.

StatusResponseReason
200JSON API document (type: "users")The request was successful
401JSON API error objectUnauthorized
404JSON API error objectUser not found, or unauthorized to view the user

Sample Request

curl \  --header "Authorization: Bearer $TOKEN" \  --header "Content-Type: application/vnd.api+json" \  --request GET \  https://app.terraform.io/api/v2/users/user-MA4GL63FmYRpSFxa

Sample Response

{  "data": {    "id": "user-MA4GL63FmYRpSFxa",    "type": "users",    "attributes": {      "username": "admin",      "is-service-account": false,      "auth-method": "hcp_sso",      "avatar-url": "https://www.gravatar.com/avatar/fa1f0c9364253d351bf1c7f5c534cd40?s=100&d=mm",      "v2-only": true,      "permissions": {        "can-create-organizations": false,        "can-change-email": true,        "can-change-username": true      }    },    "relationships": {      "authentication-tokens": {        "links": {          "related": "/api/v2/users/user-MA4GL63FmYRpSFxa/authentication-tokens"        }      }    },    "links": {      "self": "/api/v2/users/user-MA4GL63FmYRpSFxa"    }  }}
Edit this page on GitHub

[8]ページ先頭

©2009-2025 Movatter.jp