API REFERENCE · V1
Build with Qoblox.
Discover community scripts, browse games, and retrieve source code through the Qoblox API.
/api/v1Use your Qoblox deployment’s origin.Quick start
Public script discovery does not require an API key. This example runs on the same origin as Qoblox. For another client, prepend your deployment’s origin to the request path.
const response = await fetch('/api/v1/scripts?sort=trending');
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const { data: scripts } = await response.json();
console.log(scripts);JSON responses wrap the result in data. Script records include their id, slug, title, and creator details.
API keys
API keys let external services call authenticated Qoblox endpoints with Authorization: Bearer. Manage them from your dashboard. New keys are shown once, then stored as hashes.
// Run on your server. Set both environment variables first.
const origin = process.env.QOBLOX_ORIGIN;
const key = process.env.QOBLOX_API_KEY;
if (!origin || !key) throw new Error('Missing Qoblox configuration');
const response = await fetch(new URL('/api/v1/me/bookmarks', origin), {
headers: {
Authorization: `Bearer ${key}`
}
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status}`);
}
const { data: bookmarks } = await response.json();Key management routes require your signed-in browser session and a CSRF token. Bearer keys cannot manage API keys, edit your profile, manage sessions, request account deletion, or manage profile comments. Keep keys on your server, never in browser bundles or public repositories.
Replace a key without interrupting your service
- Create a new key and save its one-time token.
- Update your service configuration and test an authenticated request.
- Revoke the old key from API access. Requests using it will return 401.
Read endpoints
All paths below are relative to /api/v1. Replace braces with the requested identifier.
/scriptsBrowse public scripts. Returns up to 20 active scripts with a current revision.
JSON · data[]/scripts/{idOrSlug}Retrieve a script by its UUID or slug.
JSON · data/scripts/{id}/revisionsRetrieve the revision history for a script UUID.
JSON · data[]/scripts/{id}/codeRetrieve source code as plain text. Use a script UUID; add ?revision={revisionId} to request a specific revision.
text/plain/scripts/{id}/downloadDownload the source as a .lua attachment. Accepts the same revision parameter.
text/plain · attachment/me/bookmarksList the signed-in user’s saved scripts. Requires a session cookie or bearer API key.
JSON · data[]/meCheck your authenticated identity. Anonymous requests return data.user as null. Invalid bearer credentials return 401.
JSON · data.user/users/{username}Read a public creator profile, including avatar, banner, and lifetime public-script views.
JSON · data/catalog/gamesList games and their slugs for script discovery.
JSON · data[]/catalog/tagsList community tags and their slugs.
JSON · data[]/catalog/platformsList supported platforms.
JSON · data[]Filter and sort scripts
Use these parameters with GET /scripts.
| Parameter | Value | Behavior |
|---|---|---|
q | Search text | Matches script titles and summaries. |
game | Game slug | Filters scripts for a known game. |
sort | trending, newest, updated, popular | Defaults to trending. Popular orders by likes; trending orders by views, then likes. |
The current list endpoint returns up to 20 records. Tag filtering and cursor pagination are not implemented in the current list handler.
Retrieve source code
The /code endpoint returns text rather than JSON. Use response.text() to read it. Source and revision requests use the script’s UUID, not its slug.
// Replace SCRIPT_UUID with a script's id from the list response.
const response = await fetch('/api/v1/scripts/SCRIPT_UUID/code');
if (!response.ok) {
throw new Error(`Source unavailable: ${response.status}`);
}
const source = await response.text();Access & errors
Some resources require a signed-in user or group membership. Access depends on the resource and the current session or bearer key; a missing or inaccessible resource may return 404.
Check the HTTP status before parsing a response. JSON endpoints and plain-text endpoints can return different error bodies, so do not assume every error is JSON.
| Status | Meaning | Next step |
|---|---|---|
| 400 | Invalid input | Check fields against endpoint requirements. |
| 401 | Authentication required or invalid key | Check the bearer header and whether the key was revoked. |
| 403 | Action is not permitted | Check account permissions, email verification, and session requirements. |
| 404 | Resource missing or inaccessible | Check its identifier and your access to the resource. |
Browser account and profile-comment mutations require a session and CSRF token. Integration endpoints accept bearer credentials directly. Keys act with your account’s permissions on those endpoints and remain valid until revoked. Scoped keys and automatic expiration are not currently supported.