Users
- Written for
- + Written for
- Deprecated
- + Deprecated
- Applies to
- + Applies to
Users
Create, read, update, and lifecycle-manage the people in your instance, plus their email addresses, linked identities, and OAuth consent grants.
The User object never includes private_metadata on a read. Timestamps are epoch ms.
{
"object": "user",
"id": "user_2a…",
"username": null,
"first_name": "Ada",
"last_name": "Lovelace",
"image_url": null,
"public_metadata": { "plan": "pro" },
"mfa_enabled": true,
"banned": false,
"locked": false,
"last_sign_in_at": 1757600000000,
"created_at": 1757000000000,
"updated_at": 1757600000000
}Endpoints
Method & path | Scope | Notes |
|---|---|---|
|
| List, cursor-paginated |
|
| Never includes |
|
| Create from email + optional password/name/metadata. Emits |
|
| Update profile or metadata. idempotent |
|
| Replace the metadata bags wholesale. idempotent |
|
| Soft-delete; PII scrubbed after 30 days. idempotent |
|
| Ban and revoke every session. idempotent |
|
| Lift a ban (sessions are not restored). idempotent |
|
| Lock out sign-in for an optional duration (default 1 year). idempotent |
|
| Clear a lockout. idempotent |
|
| Remove every second factor + recovery codes. idempotent |
|
| Remove one factor (last removal turns MFA off). idempotent |
|
| The user's active sessions |
|
| Revoke all sessions, bump |
|
| Add an address (starts unverified). idempotent |
|
| Mark verified on the backend authority. idempotent |
|
| Make a verified address primary. idempotent |
|
| Base Atlas identity + linked providers. No tokens. |
|
| Merge a secondary user into this one. idempotent |
|
| Unlink a provider into a new standalone user. idempotent |
|
| Backend-initiated OAuth link; returns an |
|
| Stored provider token, refreshed if stale |
|
| OAuth clients the user authorized |
|
| Revoke all consent grants + tokens. idempotent |
|
| Revoke one consent grant. idempotent |
Bulk import / export
Method & path | Scope | Notes |
|---|---|---|
|
| Bulk-create users (dedupe by verified email). Argon2id hashes imported verbatim; plaintext is hashed; other formats rejected per-row. idempotent |
|
| Produce a serialised export job. Never contains password hashes / tokens. idempotent |
|
| Track jobs, counters, and per-row errors |
Examples
# Create a user, idempotently
curl https://api.atlas.dev/v1/users \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: signup-ada-001" \
-d '{"email_address":"ada@example.com","first_name":"Ada","email_verified":true}'
# Ban a user (revokes every session)
curl -X POST https://api.atlas.dev/v1/users/user_2a/ban \
-H "Authorization: Bearer sk_live_xxx"// @atlas/backend
const user = await atlas.users.create({ email_address: 'ada@example.com', first_name: 'Ada' });
await atlas.users.update(user.id, { public_metadata: { plan: 'pro' } });
await atlas.users.lock(user.id, { duration_in_seconds: 3600 });
// Merge a duplicate account into this one
const { collisions } = await atlas.users.linkIdentity(user.id, { secondary_user_id: 'user_dupe' });
// Read a stored Google token (auto-refreshed)
const { token } = await atlas.users.getOAuthAccessToken(user.id, 'google');# atlas-backend (Python)
user = atlas.users.create({"email_address": "ada@example.com", "first_name": "Ada"})
for u in paginate(atlas.users.list):
print(u["id"])