Redeem key

Redeem key

POST
https://api.envyauth.my.id/api/v3/projects/:project_uuid/users/redeem

Atomically claims a key on behalf of a Discord user. If the key is in the project's unused pool, it moves to the user list and binds to the Discord ID. If the key is already claimed but has no Discord ID, the Discord ID is attached to that existing row.

One key per Discord ID per project is enforced. A Discord ID that already has a key returns 409 with code: "ALREADY_HAS_KEY".

Request

terminal
curl -X POST https://api.envyauth.my.id/api/v3/projects/<project_uuid>/users/redeem \  -H "Authorization: Bearer YOUR_API_TOKEN" \  -H "Content-Type: application/json" \  -d '{"discord_id":"1118453649727823974","key":"<32-char>"}'
FieldTypeRequiredMeaning
discord_idstringyes17–20 digit Discord snowflake.
keystringyes32-character key to redeem.

The Discord username and avatar are resolved server-side; you do not need to pass them.

Response

{  "success": true,  "data": {    "redeemed":   true,    "stage":      "unclaimed_claim",    "user_id":    "uuid",    "key":        "<32-char>",    "key_note":   "Premium",    "key_expire": 1761868800  },  "requestid": "uuid"}

stage is one of:

StageMeaning
unclaimed_claimThe key was in the unused pool and is now a user row bound to the Discord ID.
claimed_bindThe key was already a claimed row with no Discord ID. The Discord ID has now been attached.