Skip to content

Get a single user

Find a user by its ID. Use me to fetch current user. Operators can only see themselves (unless they have legacyViewAll set to true), fetching other users will yield Not Found error.

GET/users/{id}

Path parameters

NameTypeDescriptionRequired
id
string
Id of the target user

Response schema

{
// Internal unique identifier
id: string;
// Legacy internal unique identifier (for retro-compatibility)
legacyId: number;
// If true, user can read all resources on the workspace
legacyViewAll: boolean;
// User's workspace name
workspaceName: string;
// User name
name: string;
// User's device ID (for non-API users)
deviceUserId: string | null;
// User's device type
deviceType: "PSD" | "SOFT_PSD" | "API";
// User role
role: "ADMIN" | "OPERATOR" | "READ_ONLY_API_KEY";
// User public key
pubKey: string;
// User status
status: "ACTIVE" | "INACTIVE";
// Whether the user is suspended
isSuspended: boolean;
// Creation timestamp
createdAt: string;
// Last modification timestamp
updatedAt: string;
}

Examples

bash
curl \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {jwt}" \
  "$API_BASE_URL/users/{id}"
ts
const url = "<base-url>/users/{id}";

const headers = {
  "Content-Type": "application/json",
  Authorization: "Bearer <jwt>"
};

fetch(url, { headers }).then(res => {
  console.log(res)
});
python
import requests

url = "<base-url>/users/{id}"

headers = {
  "Content-Type": "application/json",
  "Authorization": "Bearer <jwt>"
}

print(requests.get(url, headers=headers))