Profile API
Manage your Emberly profile, security settings, upload tokens, integrations, and account data via the REST API.
The Profile API gives authenticated users access to their full account — security settings, upload tokens, linked accounts, perks, referrals, and data export.
All Profile endpoints require a session cookie (authenticated browser session) unless otherwise noted. They are not typically called from external integrations. Use the Files API with your upload token for programmatic file operations.
Endpoints Overview
| Method | Path | Description |
|---|---|---|
GET | /api/profile | Get your full profile |
PATCH | /api/profile | Update profile fields |
POST | /api/profile/avatar | Upload avatar image |
POST | /api/profile/avatar/linked | Set avatar from linked account |
POST | /api/profile/banner | Upload profile banner |
GET | /api/profile/sessions | List login history |
DELETE | /api/profile/sessions | Revoke all active sessions |
GET | /api/profile/2fa | Generate TOTP setup |
POST | /api/profile/2fa | Enable 2FA (two-step) |
DELETE | /api/profile/2fa | Disable 2FA |
GET | /api/profile/2fa/recovery-codes | View recovery code status |
POST | /api/profile/2fa/recovery-codes | Regenerate recovery codes |
GET | /api/profile/linked-accounts | List linked GitHub/Discord |
DELETE | /api/profile/linked-accounts | Unlink an account |
GET | /api/profile/perks | List perks and progress |
POST | /api/profile/perks/refresh | Re-check perk eligibility |
GET | /api/profile/referrals | Get referral info |
POST | /api/profile/referrals | Set custom referral code |
GET | /api/profile/upload-token | Get upload token |
POST | /api/profile/upload-token | Regenerate upload token |
GET | /api/profile/upload-domain | List available upload domains |
POST | /api/profile/upload-domain | Set preferred upload domain |
GET | /api/profile/sharex | Download ShareX config |
POST | /api/profile/flameshot | Generate Flameshot script |
POST | /api/profile/spectacle | Generate KDE Spectacle script |
GET | /api/profile/bash | Download bash upload script |
GET | /api/profile/export | Export all data as ZIP |
GET | /api/profile/billing-history | Paginated credit history |
POST | /api/profile/discord-webhook/test | Test Discord webhook |
Get Your Profile
GET /api/profile
Returns your complete profile including files, settings, 2FA status, theme, and storage info.
Response (200):
Update Profile
PATCH /api/profile
Update one or more profile fields in a single request.
Request Body (all fields optional):
Response (200): Updated profile object (same shape as GET /api/profile)
Notes:
- To change your password, include both
currentPasswordandnewPassword - Password must meet complexity requirements (8+ chars, upper + lower + number + special)
- Password reuse against your last 5 passwords is rejected
Avatar & Banner
POST /api/profile/avatar
Upload a new avatar image. Accepted formats: JPEG, PNG, WebP, GIF (max 5 MB).
Content-Type: multipart/form-data
| Field | Type | Description |
|---|---|---|
file | File | Avatar image |
Response (200):
POST /api/profile/avatar/linked
Set your avatar from a linked GitHub or Discord account.
Request Body:
provider must be "github" or "discord". The provider must already be linked.
POST /api/profile/banner
Upload a profile banner. Accepted: JPEG, PNG, WebP, GIF (max 5 MB).
Content-Type: multipart/form-data
| Field | Type | Description |
|---|---|---|
file | File | Banner image |
Sessions
GET /api/profile/sessions
Returns your login history and active session metadata (IP, user-agent, timestamp).
Response (200):
DELETE /api/profile/sessions
Revoke all active sessions immediately (forces re-login on all devices). Your current session is also invalidated.
Response (200):
Two-Factor Authentication
GET /api/profile/2fa
Generate a TOTP secret and otpauth:// URI. Scan the URI with an authenticator app (Google Authenticator, Authy, 1Password, etc.).
Response (200):
POST /api/profile/2fa — Step 1: Send code
Validate the TOTP token from your app. If correct, an email verification code is sent.
Request Body:
Response (200):
POST /api/profile/2fa — Step 2: Verify code
Confirm the email code to complete 2FA enrollment.
Request Body:
Response (200):
DELETE /api/profile/2fa
Disable 2FA. Requires an email verification code (sent automatically when you request this action).
Request Body:
Recovery Codes
GET /api/profile/2fa/recovery-codes
Check recovery code status.
Query Parameters:
includeCodes=true— Include the actual code values (shown only once after generation)
Response (200):
POST /api/profile/2fa/recovery-codes
Regenerate all recovery codes. Previous codes are invalidated immediately.
Response (200):
Recovery codes are shown only once. Store them in a safe place immediately after generation.
Linked Accounts
GET /api/profile/linked-accounts
List your linked GitHub and Discord accounts.
Response (200):
DELETE /api/profile/linked-accounts?provider=github
Unlink a GitHub or Discord account.
Query Parameters:
provider—"github"or"discord"
Response (200):
Perks
GET /api/profile/perks
List all eligible perks with progress — contributor milestones and Discord booster tiers.
Response (200):
POST /api/profile/perks/refresh
Re-check your Discord boost status and GitHub contributor lines of code in real-time. Updates perkRoles on your account.
Response (200):
Referrals
GET /api/profile/referrals
Query Parameters:
action=stats— Returns total referrals and rewards earnedaction=history— Returns a list of successful referrals- (no action) — Returns your current referral code
Response (no action, 200):
POST /api/profile/referrals
Set or update your custom referral code.
Request Body:
Response (200):
Upload Token
Your upload token authenticates file uploads and URL creation from external tools.
GET /api/profile/upload-token
Fetch your current upload token.
Response (200):
POST /api/profile/upload-token
Regenerate your upload token. This immediately invalidates the old token.
Response (200):
After regenerating, update the token in all integrations (ShareX, Flameshot, scripts, etc.) or they will start returning 401.
Upload Domain
GET /api/profile/upload-domain
List domains available for file URLs — your default domain plus any verified custom domains.
Response (200):
POST /api/profile/upload-domain
Set the domain used for new upload URLs.
Request Body:
The domain must be verified before it can be set as the upload domain.
Integration Downloads
These endpoints generate pre-configured upload scripts and configs using your current token and upload domain.
GET /api/profile/sharex
Download a ShareX .sxcu config file. See ShareX Integration.
POST /api/profile/flameshot
Generate a Flameshot upload script. See Flameshot Integration.
Request Body:
POST /api/profile/spectacle
Generate a KDE Spectacle upload script.
Request Body:
GET /api/profile/bash
Download a generic bash upload script (.sh) with your token pre-configured.
Data Export
GET /api/profile/export
Triggers a full data export — all your files and URLs are packaged into a ZIP archive. The response is a Server-Sent Events (SSE) stream showing export progress.
Use GET /api/profile/export/progress to poll progress (0–100) as a separate SSE stream.
Response: ZIP file download when complete.
Exports can take several minutes for large accounts. Your browser will hold the connection open until the ZIP is ready.
Billing History
GET /api/profile/billing-history
Returns paginated credit transaction history.
Query Parameters:
limit(default: 20) — Results per pageoffset(default: 0) — Pagination offset
Response (200):
Discord Webhook Test
POST /api/profile/discord-webhook/test
Send a test embed to the Discord webhook URL configured in your profile. Useful to verify the webhook is working before relying on it for upload notifications.
Response (200):
Errors:
400— No Discord webhook configured in your profile502— Webhook URL rejected the request (check the URL is correct)
Related
- Account Settings Guide — dashboard walkthrough
- Contributor Perks
- Discord Perks
- ShareX Integration
- Flameshot Integration