User by ID​
Returns the full user object (human or machine) including the profile, email, etc.
Path Parameters
userId string required
User ID of the user you like to get.
Responses
- 200
- 403
- 404
- default
OK
application/json
application/grpc
application/grpc-web+proto
Schema
Example (from schema)
Schema
details object
user object
{
"details": {
"sequence": "2",
"changeDate": "2024-04-09T11:59:28.432Z",
"resourceOwner": "69629023906488334"
},
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"state": "USER_STATE_UNSPECIFIED",
"username": "minnie-mouse",
"loginNames": [
"gigi@zitadel.com",
"gigi@zitadel.zitadel.ch"
],
"preferredLoginName": "gigi@zitadel.com",
"human": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"state": "USER_STATE_UNSPECIFIED",
"username": "minnie-mouse",
"loginNames": [
"gigi@zitadel.com",
"gigi@zitadel.zitadel.ch"
],
"preferredLoginName": "gigi@zitadel.com",
"profile": {
"givenName": "Minnie",
"familyName": "Mouse",
"nickName": "Mini",
"displayName": "Minnie Mouse",
"preferredLanguage": "en",
"gender": "GENDER_FEMALE",
"avatarUrl": "https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32"
},
"email": {
"email": "mini@mouse.com",
"isVerified": true
},
"phone": {
"phone": "+41791234567",
"isVerified": true
},
"passwordChangeRequired": true
},
"machine": {
"name": "zitadel",
"description": "The one and only IAM",
"hasSecret": "true",
"accessTokenType": "ACCESS_TOKEN_TYPE_BEARER"
}
}
}
Schema
Example (from schema)
Schema
details object
user object
{
"details": {
"sequence": "2",
"changeDate": "2024-04-09T11:59:28.433Z",
"resourceOwner": "69629023906488334"
},
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"state": "USER_STATE_UNSPECIFIED",
"username": "minnie-mouse",
"loginNames": [
"gigi@zitadel.com",
"gigi@zitadel.zitadel.ch"
],
"preferredLoginName": "gigi@zitadel.com",
"human": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"state": "USER_STATE_UNSPECIFIED",
"username": "minnie-mouse",
"loginNames": [
"gigi@zitadel.com",
"gigi@zitadel.zitadel.ch"
],
"preferredLoginName": "gigi@zitadel.com",
"profile": {
"givenName": "Minnie",
"familyName": "Mouse",
"nickName": "Mini",
"displayName": "Minnie Mouse",
"preferredLanguage": "en",
"gender": "GENDER_FEMALE",
"avatarUrl": "https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32"
},
"email": {
"email": "mini@mouse.com",
"isVerified": true
},
"phone": {
"phone": "+41791234567",
"isVerified": true
},
"passwordChangeRequired": true
},
"machine": {
"name": "zitadel",
"description": "The one and only IAM",
"hasSecret": "true",
"accessTokenType": "ACCESS_TOKEN_TYPE_BEARER"
}
}
}
Schema
Example (from schema)
Schema
details object
user object
{
"details": {
"sequence": "2",
"changeDate": "2024-04-09T11:59:28.434Z",
"resourceOwner": "69629023906488334"
},
"user": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"state": "USER_STATE_UNSPECIFIED",
"username": "minnie-mouse",
"loginNames": [
"gigi@zitadel.com",
"gigi@zitadel.zitadel.ch"
],
"preferredLoginName": "gigi@zitadel.com",
"human": {
"userId": "d654e6ba-70a3-48ef-a95d-37c8d8a7901a",
"state": "USER_STATE_UNSPECIFIED",
"username": "minnie-mouse",
"loginNames": [
"gigi@zitadel.com",
"gigi@zitadel.zitadel.ch"
],
"preferredLoginName": "gigi@zitadel.com",
"profile": {
"givenName": "Minnie",
"familyName": "Mouse",
"nickName": "Mini",
"displayName": "Minnie Mouse",
"preferredLanguage": "en",
"gender": "GENDER_FEMALE",
"avatarUrl": "https://api.zitadel.ch/assets/v1/avatar-32432jkh4kj32"
},
"email": {
"email": "mini@mouse.com",
"isVerified": true
},
"phone": {
"phone": "+41791234567",
"isVerified": true
},
"passwordChangeRequired": true
},
"machine": {
"name": "zitadel",
"description": "The one and only IAM",
"hasSecret": "true",
"accessTokenType": "ACCESS_TOKEN_TYPE_BEARER"
}
}
}
Returned when the user does not have permission to access the resource.
application/json
application/grpc
application/grpc-web+proto
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Returned when the resource does not exist.
application/json
application/grpc
application/grpc-web+proto
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
An unexpected error response.
application/json
application/grpc
application/grpc-web+proto
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
Schema
Example (from schema)
Schema
code int32
message string
details object[]
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}
GET /v2beta/users/:userId
Authorization
name: OAuth2type: oauth2scopes:openid,urn:zitadel:iam:org:project:id:zitadel:aud
flows: { "authorizationCode": { "authorizationUrl": "$CUSTOM-DOMAIN/oauth/v2/authorize", "tokenUrl": "$CUSTOM-DOMAIN/oauth/v2/token", "scopes": { "openid": "openid", "urn:zitadel:iam:org:project:id:zitadel:aud": "urn:zitadel:iam:org:project:id:zitadel:aud" } } }
Request
Request
curl / cURL
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
python / requests
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
go / native
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
nodejs / axios
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
ruby / Net::HTTP
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
csharp / RestSharp
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
php / cURL
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
java / OkHttp
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'
powershell / RestMethod
curl -L -X GET 'https://$CUSTOM-DOMAIN/v2beta/users/:userId' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'