Quick start
API access is granted by the owner. Once it is on, open Dashboard → Developers, create a key, and send it as a bearer token. Keys are shown once; store yours in an environment variable.
curl https://resent.lol/api/v1/me \
-H "Authorization: Bearer $RESENT_API_KEY"The response is your profile plus the key's scopes, rate limit and today's usage.
{
"id": 42,
"username": "yourname",
"display": "Your Name",
"url": "https://resent.lol/yourname",
"api": {
"key": { "hint": "rl_live_ab12…wxyz", "scopes": ["profile:read", "stats:read"] },
"usage": { "day": "2026-11-23", "requests": 12, "errors": 0 }
}
}Getting access
The owner grants API access per member and chooses the allowed scopes and key slots. Revoking access immediately invalidates every key that member holds. There is no self-serve signup for the API.
Send your username and what you want to build. The owner opens the API tab in the owner panel.
The owner picks a scope set and a key slot count (3 by default, up to 20).
Open Dashboard → Developers and create a key. It is shown once, then only its hash and hint are kept.
Use the REST API, an SDK or webhooks. Rotate or revoke keys from the same page.
Authentication
Every request after the public metadata routes needs a key. Two headers work:
Authorization: Bearer rl_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X-API-Key: rl_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXKeys start with rl_live_. Only a peppered hash is stored, so a lost key cannot be recovered — rotate it instead. Never put a key in client-side JavaScript, a public repo or a Discord message.
| Status | Code | Meaning |
|---|---|---|
| 401 | missing_key | No bearer token or X-API-Key. |
| 401 | invalid_key | The key is unknown, revoked or expired. |
| 403 | access_revoked | The owner turned API access off for the account. |
| 403 | scope_required | The key does not include the scope for that route. |
| 429 | rate_limited | Per-minute limit reached. Read Retry-After. |
| 429 | quota_exhausted | Daily request quota reached. |
Scopes
A key can only use scopes the owner allowed. Write scopes imply the matching read scope. Owner scopes (admin:*) can never be granted to a member key.
profile:readRead profilesYour account and any public profile.profile:writeEdit your profileDisplay name, bio, links, media and settings.social:readRead commentsComments and reaction counts.social:writePost comments and reactionsComment, react and delete your own comments.stats:readRead statsViews, rank, sources, clicks and audience data.leaderboard:readRead the leaderboardRankings by views, likes, aliases, badges and season.search:readSearch membersFind members by username, display name, bio or alias.site:readRead site numbersAggregate member, view and link counts.uploads:readList uploadsYour files, sizes, limits and storage use.uploads:writeUpload and delete filesSend file bytes and remove your own uploads.templates:readRead templatesYour templates and the public gallery.templates:writeManage templatesCreate, delete and apply templates.widgets:readRead widgetsLive data for a profile's widgets.webhooks:readRead webhooksList endpoints and delivery history.webhooks:writeManage webhooksCreate, edit, test and delete endpoints.admin:readOwner: read administrationOwner-only overview and request logs.admin:writeOwner: manage accessOwner-only grants, revokes and key rotation.Endpoints
All paths below are relative to https://resent.lol/api/v1.
| Method | Path | Scope | What it does |
|---|---|---|---|
| GET | /me | profile:read | Your account, API key and usage summary. |
| PATCH | /me/profile | profile:write | Update display, bio, links, media and profile settings. |
| GET | /me/analytics | stats:read | Daily views, sources, clicks, rank and audience. |
| GET | /users/:username | profile:read | Public profile, links, badges, widgets and social counts. |
| GET | /users/:username/stats | stats:read | Views, weekly views, rank, likes and comments. |
| GET | /users/:username/badges | profile:read | Badges earned by a member. |
| GET | /users/:username/comments | social:read | Comments with cursor pagination. |
| POST | /users/:username/comments | social:write | Comment on a profile (500 characters max). |
| DELETE | /comments/:id | social:write | Delete your comment or one on your profile. |
| POST | /users/:username/like | social:write | React with 1, -1 or 0 to clear. |
| GET | /leaderboard | leaderboard:read | Ranked members with paging and five sort modes. |
| GET | /search | search:read | Search usernames, display names, bios and aliases. |
| GET | /stats | site:read | Aggregate site counts. |
| GET | /badges | profile:read | Badge catalogue with your earned flags. |
| GET | /uploads | uploads:read | Your files, storage use and limits. |
| POST | /uploads | uploads:write | Raw file bytes with ?kind=file|avatar|banner|… |
| DELETE | /uploads/:id | uploads:write | Delete one of your uploads. |
| GET | /templates | templates:read | Your templates or the public gallery. |
| POST | /templates | templates:write | Save a template with an optional preview. |
| DELETE | /templates/:id | templates:write | Delete your template. |
| POST | /templates/:id/use | templates:write | Count a template application. |
| GET | /widgets/:username | widgets:read | Live widget payload without counting a view. |
| GET | /webhooks | webhooks:read | List endpoints and delivery stats. |
| POST | /webhooks | webhooks:write | Create an endpoint; the secret is shown once. |
| PATCH | /webhooks/:id | webhooks:write | Change URL, events or active state. |
| DELETE | /webhooks/:id | webhooks:write | Delete an endpoint and its history. |
| POST | /webhooks/:id/secret | webhooks:write | Rotate the signing secret. |
| POST | /webhooks/:id/test | webhooks:write | Queue a signed test delivery. |
| GET | /webhooks/:id/deliveries | webhooks:read | Recent delivery attempts. |
Pagination
Comments use a timestamp cursor: pass ?before=<created> from the last item. The leaderboard uses ?offset= and ?limit=. Template and upload lists use ?limit= and ?offset=. Limits are capped server-side.
Examples
TypeScript / JavaScript
const API = 'https://resent.lol/api/v1';
const KEY = process.env.RESENT_API_KEY!;
async function profile(username: string) {
const res = await fetch(`${API}/users/${encodeURIComponent(username)}`, {
headers: { Authorization: `Bearer ${KEY}` }
});
if (!res.ok) throw new Error((await res.json()).error);
return (await res.json()).profile;
}
console.log(await profile('yourname'));discordeno
import { createBot, Intents, startBot } from 'discordeno';
import { resentProfile, resentLeaderboard } from './resent-discordeno.js';
const bot = createBot({
token: process.env.DISCORD_TOKEN!,
intents: Intents.Guilds | Intents.GuildMessages,
events: {
ready: () => console.log('ready'),
messageCreate: async (_bot, message) => {
const text = message.content.trim();
if (text === '!profile') {
const p = await resentProfile('yourname');
await bot.helpers.sendMessage(message.channelId, {
content: `**${p.display}** · ${p.views} views · ${p.social.up} likes\n${p.url}`
});
}
if (text === '!top') {
const top = await resentLeaderboard(5);
await bot.helpers.sendMessage(message.channelId, {
content: top.entries.map(e => `#${e.rank} ${e.username} — ${e.metric}`).join('\n')
});
}
}
}
});
await startBot(bot);discord.py
import os
import discord
from discord.ext import commands
from resent import ResentClient
bot = commands.Bot(command_prefix="!", intents=discord.Intents.default())
resent = ResentClient(os.environ["RESENT_API_KEY"])
@bot.command()
async def profile(ctx: commands.Context, username: str):
p = await resent.profile(username)
await ctx.reply(f"**{p['display']}** · {p['views']} views · {p['social']['up']} likes\n{p['url']}")
@bot.command()
async def top(ctx: commands.Context, limit: int = 5):
board = await resent.leaderboard(limit=limit)
lines = [f"#{e['rank']} {e['username']} — {e['metric']}" for e in board["entries"]]
await ctx.reply("\n".join(lines) or "No members yet.")
bot.run(os.environ["DISCORD_TOKEN"])discord.js
import { Client, GatewayIntentBits, Events } from 'discord.js';
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent] });
const API = 'https://resent.lol/api/v1';
const headers = { Authorization: `Bearer ${process.env.RESENT_API_KEY}` };
client.on(Events.MessageCreate, async message => {
if (message.author.bot || !message.content.startsWith('!profile ')) return;
const name = message.content.slice(9).trim();
const res = await fetch(`${API}/users/${encodeURIComponent(name)}`, { headers });
if (!res.ok) return message.reply('No member with that username.');
const { profile } = await res.json();
await message.reply(`**${profile.display}** — ${profile.views} views\n${profile.url}`);
});
client.login(process.env.DISCORD_TOKEN);Python requests
import os, requests
BASE = "https://resent.lol/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['RESENT_API_KEY']}"}
r = requests.get(f"{BASE}/leaderboard", params={"sort": "likes", "limit": 10}, headers=HEADERS, timeout=15)
r.raise_for_status()
for entry in r.json()["entries"]:
print(entry["rank"], entry["username"], entry["metric"])Uploads
Uploads take raw bytes, not multipart form data. Send the file body with its realContent-Type, set ?kind=, and optionally X-File-Name. The largest single chunk is 32 MB; larger files use the dashboard's chunked uploader.
curl -X POST "https://resent.lol/api/v1/uploads?kind=avatar" \
-H "Authorization: Bearer $RESENT_API_KEY" \
-H "Content-Type: image/png" \
-H "X-File-Name: me.png" \
--data-binary @me.pngKinds are file, avatar, banner, background,audio, badge, cursor and embed. To use a picture as your avatar, PATCH /me/profile with the returned url.
{ "avatar": "/i/abc123.png", "banner": null }Webhooks
Webhooks deliver JSON to an HTTPS endpoint. Every request is signed with HMAC-SHA256 over the raw body using your endpoint secret. Verify the signature before trusting the payload, and reject anything older than five minutes.
Headers
X-Resent-Event: profile.comment
X-Resent-Delivery: whd_abc123
X-Resent-Signature: sha256=hex…
Content-Type: application/jsonPayload
{
"id": "whd_abc123",
"event": "profile.comment",
"created": 1795394400000,
"data": {
"profile": "yourname",
"by": "someone",
"body": "nice page",
"id": "comment_id"
}
}Verify a signature (Node)
import { createHmac, timingSafeEqual } from 'node:crypto';
function verify(rawBody, header, secret) {
const expected = 'sha256=' + createHmac('sha256', secret).update(rawBody).digest('hex');
const a = Buffer.from(header || ''), b = Buffer.from(expected);
return a.length === b.length && timingSafeEqual(a, b);
}Failed deliveries are retried five times with exponential backoff (1m, 5m, 30m, 2h, 6h). The dashboard shows the response code and error for each attempt. Only HTTPS URLs are accepted; private, loopback and link-local addresses are blocked.
Limits & errors
Every key has a per-minute limit and a daily quota. Both are set when the key is created and can be lowered later. Responses carry the current state:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 1795394460
X-Quota-Limit: 5000
X-Quota-Remaining: 4988Errors are JSON with a stable code so a bot can react without parsing prose:
{ "error": "This key needs the stats:read scope", "code": "scope_required", "scope": "stats:read" }| Status | When |
|---|---|
| 400 | Malformed JSON, missing field, invalid reaction or template. |
| 401 | Missing, invalid, revoked or expired key. |
| 403 | Access revoked, missing scope, or owner-only route. |
| 404 | No member, comment, upload or template with that id. |
| 409 | Key slot, template or webhook limit reached. |
| 413 | File larger than the kind's cap or the 32 MB chunk limit. |
| 429 | Rate limit or daily quota. Honour Retry-After. |
| 500 | Unexpected server error. Retry with backoff. |
SDKs & snippets
Copy a file into your project. They have no dependencies beyond the standard library of each language.
The snippets are examples, not a hosted package. Pin a copy in your repo so an update cannot break your bot.
FAQ
Can I get a key without asking the owner?
No. Access is granted per member in the owner panel. Ask the owner with your username and a short description of your project.
What happens when access is revoked?
Every active key for that member is revoked at once. Requests return 401 invalid_key, and the member sees the gate again in Dashboard → Developers.
Can I use the API from a browser?
Yes, CORS is open for /api/v1. But a key in client-side code is public. Use a small server or serverless function to hold the key.
Do API reads count as profile views?
No. Reading a profile through the API never increments the view counter. Widget reads are separate for the same reason.
How do I rotate a key?
Use Rotate in Dashboard → Developers, or POST /api/me/developer/keys/:id/rotate. The old key is revoked immediately and the new one is shown once.
Are webhooks retried?
Yes, five attempts with exponential backoff. A 2xx response marks the delivery delivered; anything else is retried.
Where do I report a bug?
Open the Help Center or message the owner in Discord. Include the request id, endpoint and response code; never paste a full key.