docs/netdata-ai/skills/query-netdata-cloud/query-members.md
This guide is part of the query-netdata-cloud skill.
Read the SKILL.md prerequisites first.
Members are Cloud-only. There is no agent-side equivalent.
GET /api/v2/spaces/{spaceID}/members -- list members of a space.
source "$(git rev-parse --show-toplevel)/.agents/skills/query-netdata-agents/scripts/_lib.sh"
agents_load_env
# All members of a space.
agents_query_cloud GET "/api/v2/spaces/$SPACE/members"
Verified live -- response is a JSON array, each entry:
| Field | Description |
|---|---|
memberID | UUID identifying the user's membership in this space (NOT the user's account id) |
accountID | UUID identifying the user's Cloud account |
name | Display name |
email | |
avatarURL | Avatar image URL (may be empty) |
role | One of: admin, manager, troubleshooter, observer, member, billing, ... |
joinMethod | How they joined: invite, auto, sso, ... |
joinedAt | RFC3339 timestamp |
deactivated | true if the membership has been deactivated (cannot view space until reactivated) |
# Members by role.
agents_query_cloud GET "/api/v2/spaces/$SPACE/members" \
| jq -r 'group_by(.role) | map({(.[0].role): length}) | add'
# Active admins of a space.
agents_query_cloud GET "/api/v2/spaces/$SPACE/members" \
| jq -r '.[] | select(.role=="admin" and (.deactivated|not)) | .name'
# Resolve a user's display name from an accountID found elsewhere
# (e.g. in an alert-config audit field).
TARGET_ACCOUNT="<account-uuid>"
agents_query_cloud GET "/api/v2/spaces/$SPACE/members" \
| jq -r --arg id "$TARGET_ACCOUNT" '.[] | select(.accountID==$id) | "\(.name) <\(.email)>"'
memberID vs accountID: the former is per-space (one
user gets a different memberID in each space); the latter is
the user's global Cloud account id and stays constant across
spaces. Use accountID when correlating across spaces.deactivated:true. Filter explicitly to exclude them.<repo>/.local/audits/... (gitignored).isMember, permissions[], member_count).user-create, space-user-added, space-user-removed,
user-space-permissions-changed, room-user-added, ... use
the feed to track membership changes over time.