import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const user = await client.users.retrieve('user_id');
console.log(user.id);{
"id": "<string>",
"email": "<string>",
"access_profiles": [
{
"id": "<string>",
"identity": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"role": "manager",
"account": {
"id": "<string>",
"name": "<string>",
"status": "<string>",
"organization_id": "<string>"
}
}
],
"first_name": "<string>",
"last_name": "<string>",
"organization_id": "<string>",
"is_organization_admin": true,
"is_deployment_admin": true,
"preferences": {}
}Get basic information for a user. The requester must belong to the same organization as the target user and be an admin or manager of an account the target user belongs to.
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const user = await client.users.retrieve('user_id');
console.log(user.id);{
"id": "<string>",
"email": "<string>",
"access_profiles": [
{
"id": "<string>",
"identity": {
"id": "<string>",
"type": "user",
"object": "identity"
},
"role": "manager",
"account": {
"id": "<string>",
"name": "<string>",
"status": "<string>",
"organization_id": "<string>"
}
}
],
"first_name": "<string>",
"last_name": "<string>",
"organization_id": "<string>",
"is_organization_admin": true,
"is_deployment_admin": true,
"preferences": {}
}Successful Response
User id
E-mail address
A list of access profiles that the selected user has access to
Show child attributes
First name
Last name
The organization ID of the user.
True if the current user is an organization admin.
True if the current user is a deployment admin.
User preferences that can be stored in the Scale GenAI Platform.