---
title: "Users"
icon : "api"
description: "List, whitelist, fetch, update, and delete users on a project."
---

# Users

All user endpoints live under `/api/v3/projects/:project_uuid/users`.

## List users

<Endpoint
  method="GET"
  path  ="https://api.envyauth.my.id/api/v3/projects/:project_uuid/users"
/>

Paginated list of every user on the project.

Query parameters:

| Name | Default | Notes |
|---|---|---|
| `limit` | `50` | Max `200`. |
| `offset` | `0` | Zero-based row offset. |

### Response

<CodeGroup tabs={[
  {
    title: '200 OK',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "users":  [ /* user row objects */ ],\n    "limit":  50,\n    "offset": 0\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '404 Not Found',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "Project not found",\n  "code":  "NOT_FOUND",\n  "requestid": "uuid"\n}',
  },
  {
    title: '500 Internal',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "Failed to list users",\n  "code":  "INTERNAL",\n  "requestid": "uuid"\n}',
  },
]} />

## Whitelist a user

<Endpoint
  method="POST"
  path  ="https://api.envyauth.my.id/api/v3/projects/:project_uuid/users"
/>

Generates one or more keys and binds them to Discord IDs. The body shape selects between single and bulk modes.

### Single

```json
{
  "discord_id":  "1118453649727823974",
  "note":        "Premium tier",
  "expire_time": 30
}
```

`note` is optional and capped at 256 characters. `expire_time` accepts either a number of days (`30`) or an absolute date string (`"2026-12-31"`). Omit it for a permanent key.

### Bulk

```json
{
  "discord_ids": ["111...", "222...", "333..."],
  "note":        "Imported batch",
  "expire_time": "2026-12-31"
}
```

Up to 5000 Discord IDs per call. Split larger imports client-side. The plan's active-key cap applies only to new IDs after deduping existing claimed users, so re-uploading an old list mostly skips.

### Response

<CodeGroup tabs={[
  {
    title: '200 OK · Single',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "message":       "Whitelisted",\n    "generated_key": "<32-char key>",\n    "key_expire":    1761868800,\n    "discord_id":    "1118453649727823974"\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '200 OK · Bulk',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "message":         "Bulk whitelist complete",\n    "total_requested": 3,\n    "total_generated": 1,\n    "total_skipped":   2,\n    "generated": [\n      { "discord_id": "111...", "generated_key": "...", "key_expire": null }\n    ],\n    "skipped": [\n      { "discord_id": "222...", "reason": "already_whitelisted" },\n      { "discord_id": "333...", "reason": "insert_failed" }\n    ]\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '402 Plan Limit',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "Reached your plan\'s 500 active-key limit. Upgrade or remove keys before whitelisting more.",\n  "code":  "PLAN_LIMIT",\n  "requestid": "uuid"\n}',
  },
  {
    title: '422 Validation',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "Invalid discord_id format",\n  "code":  "VALIDATION",\n  "requestid": "uuid"\n}',
  },
]} />

`skipped[].reason` is one of `already_whitelisted`, `race_already_whitelisted`, or `insert_failed`.

## Get a user

<Endpoint
  method="GET"
  path  ="https://api.envyauth.my.id/api/v3/projects/:project_uuid/users/:identifier"
/>

Full user row plus the user's currently active sessions. `:identifier` accepts a Discord ID, a 32-character script key, or the user UUID. See [Overview](/docs/api-reference#user-identifiers) for the formats.

### Response

<CodeGroup tabs={[
  {
    title: '200 OK',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "identifier": { "kind": "discord_id", "raw": "1118..." },\n    "user_data": {\n      "id":               "uuid",\n      "project_id":       "uuid",\n      "discord_id":       "1118...",\n      "user_key":         "<32-char>",\n      "status":           "active",\n      "key_note":         "Premium",\n      "key_expire":       1761868800,\n      "fingerprint":      "<sha256-hex>",\n      "total_executions": 259,\n      "total_resets":     2,\n      "last_seen_at":     1748419200,\n      "ban_reason":       null,\n      "ban_until":        null\n    },\n    "sessions": [ /* active session rows */ ]\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '404 Not Found',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "No user matches this identifier in this project",\n  "code":  "NOT_FOUND",\n  "requestid": "uuid"\n}',
  },
]} />

`identifier.kind` echoes back which shape the server detected. `status` is one of `active`, `no_hwid`, `reset`, or `banned`.

## Update a user

<Endpoint
  method="PATCH"
  path  ="https://api.envyauth.my.id/api/v3/projects/:project_uuid/users"
/>

Update the note or expiry on a key.

Body:

```json
{
  "script_key":  "<32-char>",
  "note":        "Renewed",
  "expire_time": 60
}
```

`script_key` is required. Both `note` and `expire_time` are optional and only the fields you include are touched.

### Response

<CodeGroup tabs={[
  {
    title: '200 OK',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "message":   "User updated",\n    "user_data": { /* refreshed user row */ }\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '404 Not Found',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "No claimed user matches this key in this project",\n  "code":  "NOT_FOUND",\n  "requestid": "uuid"\n}',
  },
  {
    title: '422 Validation',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "Invalid script_key format",\n  "code":  "VALIDATION",\n  "requestid": "uuid"\n}',
  },
]} />

To toggle ban state, use [Ban / Unban](/docs/api-reference/bans) instead.

## Delete a user

<Endpoint
  method="DELETE"
  path  ="https://api.envyauth.my.id/api/v3/projects/:project_uuid/users"
/>

Delete a key. Claimed keys remove the user row; unclaimed keys remove the pool entry.

Body:

```json
{
  "script_key": "<32-char>"
}
```

### Response

<CodeGroup tabs={[
  {
    title: '200 OK · Claimed',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "message": "Deleted user and revoked key"\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '200 OK · Unclaimed',
    lang : 'json',
    code : '{\n  "success": true,\n  "data": {\n    "message": "Deleted unclaimed key"\n  },\n  "requestid": "uuid"\n}',
  },
  {
    title: '404 Not Found',
    lang : 'json',
    code : '{\n  "success": false,\n  "error": "Key not found in this project",\n  "code":  "NOT_FOUND",\n  "requestid": "uuid"\n}',
  },
]} />
