List users
Your end users, newest first.
Query
qstringOnly users whose own id (external_id), name or email contains this text, in any case. Up to 100 characters.
limitnumber1 to 100, default 20.
afterusr_…next_cursor from the previous page.
Request
curl "https://api.muzekit.com/v1/users?limit=20" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY"const res = await fetch("https://api.muzekit.com/v1/users?limit=20", {
headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
const users = await res.json();import os
import requests
users = requests.get(
"https://api.muzekit.com/v1/users",
params={"limit": 20},
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()The list holds this key's environment's users, newest first: everyone a session or Create or update a user added. q finds users by your own id, their name or their email; to get one user by an id you know, use Get a user. last_active_at is the last time your server opened a session for the user or updated them.
Examples
Page through every user
Follow next_cursor until has_more is false. Use limit=100 for the fewest calls.
AFTER=""
while :; do
PAGE=$(curl -s "https://api.muzekit.com/v1/users?limit=100&after=$AFTER" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY")
echo "$PAGE" | jq -r '.data[] | [.id, .external_id] | @tsv'
AFTER=$(echo "$PAGE" | jq -r '.next_cursor // empty')
[ -z "$AFTER" ] && break
doneasync function* allUsers() {
let after = "";
do {
const url = `https://api.muzekit.com/v1/users?limit=100&after=${after}`;
const page = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
}).then((r) => r.json());
yield* page.data;
after = page.next_cursor ?? "";
} while (after);
}
for await (const user of allUsers()) console.log(user.id, user.external_id);import os
import requests
def all_users():
params = {"limit": 100}
while True:
page = requests.get(
"https://api.muzekit.com/v1/users",
params=params,
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()
yield from page["data"]
if not page["has_more"]:
break
params["after"] = page["next_cursor"]
for user in all_users():
print(user["id"], user["external_id"])Search users by email or name
q matches part of the email, the name or your own id, in any case. It matches its text as typed, so % and _ are plain characters.
curl -G https://api.muzekit.com/v1/users \
--data-urlencode "[email protected]" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY"const params = new URLSearchParams({ q: "@acme.com" });
const res = await fetch(`https://api.muzekit.com/v1/users?${params}`, {
headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
const { data: acmeUsers } = await res.json();import os
import requests
acme_users = requests.get(
"https://api.muzekit.com/v1/users",
params={"q": "@acme.com"},
headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()["data"]Map Muzekit ids to your own users
Each user's external_id is the id your server gave it. Build a lookup once and store the usr_… id on your side, so later calls (such as GET /v1/templates?user=usr_… or uploads into the user's library) need no search.
# One page: "your id <tab> Muzekit id"
curl -s "https://api.muzekit.com/v1/users?limit=100" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
| jq -r '.data[] | [.external_id, .id] | @tsv'// allUsers() from the example above
const muzekitIds = new Map();
for await (const user of allUsers()) muzekitIds.set(user.external_id, user.id);
await db.users.update("user_42", { muzekitId: muzekitIds.get("user_42") });# all_users() from the example above
muzekit_ids = {u["external_id"]: u["id"] for u in all_users()}
db.users.update("user_42", muzekit_id=muzekit_ids.get("user_42"))Find users who stopped opening the editor
Compare last_active_at with a cutoff, for example to send your own reminder email. Muzekit never emails end users.
# Users on the first page with no session in 30 days
CUTOFF=$(date -u -v-30d +%Y-%m-%dT%H:%M:%S) # GNU date: -d '30 days ago'
curl -s "https://api.muzekit.com/v1/users?limit=100" \
-H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
| jq -r --arg c "$CUTOFF" \
'.data[] | select((.last_active_at // "") < $c) | .external_id'// allUsers() from the first example
const cutoff = Date.now() - 30 * 86_400_000;
const idle = [];
for await (const user of allUsers()) {
if (!user.last_active_at || Date.parse(user.last_active_at) < cutoff) {
idle.push(user.external_id);
}
}from datetime import datetime, timedelta, timezone
# all_users() from the first example
cutoff = datetime.now(timezone.utc) - timedelta(days=30)
idle = [
u["external_id"]
for u in all_users()
if not u["last_active_at"]
or datetime.fromisoformat(u["last_active_at"].replace("Z", "+00:00")) < cutoff
]For activity counts across all users per day (sessions, saves, downloads), read Get usage.
Response
{
"object": "list",
"data": [
{
"object": "user",
"id": "usr_8fK2mQ1xZpR",
"external_id": "user_42",
"name": "Ada",
"email": null,
"locale": null,
"metadata": {},
"last_active_at": "2026-10-16T21:35:00.000Z",
"created_at": "2026-10-02T09:12:44.000Z"
}
],
"has_more": true,
"next_cursor": "usr_3hT9cL0wQeB"
}Each item is a user.