Start typing to search.

API Reference

Get a user

View Markdown

Get a user

GET /api/users/{id}

Get a user

Operation ID: getUser

Authentication

Option 1

  • BearerAuth (http bearer) API key token. Create via POST /api/api-keys. Format: envoy_<hex>

Option 2

  • CookieAuth (apiKey) Session cookie set after login + TOTP verification

Path parameters

  • idinteger, required Resource ID

Success responses

200

User details (no password_hash or totp_secret)

Content type: application/json

  • Reference: UserSafe
    • Type: object
    • Properties:
      • id (integer)
      • username (string)
      • role (string)
        • Allowed values: superadmin, admin, viewer
      • totp_verified (integer)
        • Allowed values: 0, 1
      • invite_pending (boolean)
      • created_at (string)
        • Format: date-time
      • updated_at (string)
        • Format: date-time

Error responses

404

Resource not found

Content type: application/json

  • Reference: Error
    • Type: object
    • Properties:
      • error (string)
        • Example: NOT_FOUND
      • message (string)
        • Example: Resource not found

Example:

{
  "error": "NOT_FOUND",
  "message": "Resource not found"
}

Examples

cURL

curl --request GET \
  --url 'https://your-envoy.example.com/api/users/YOUR_ID' \
  --header 'Authorization: Bearer $API_KEY'

JavaScript (fetch)

const response = await fetch('https://your-envoy.example.com/api/users/YOUR_ID', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
  },
});
 
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);