Qoblox/Developers/API

API REFERENCE · V1

Build with Qoblox.

Discover community scripts, browse games, and retrieve source code through the Qoblox API.

Base path/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.

JavaScript · list scripts
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.

Server JavaScript · bearer request
// 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

  1. Create a new key and save its one-time token.
  2. Update your service configuration and test an authenticated request.
  3. 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.

GET/scripts

Browse public scripts. Returns up to 20 active scripts with a current revision.

JSON · data[]
GET/scripts/{idOrSlug}

Retrieve a script by its UUID or slug.

JSON · data
GET/scripts/{id}/revisions

Retrieve the revision history for a script UUID.

JSON · data[]
GET/scripts/{id}/code

Retrieve source code as plain text. Use a script UUID; add ?revision={revisionId} to request a specific revision.

text/plain
GET/scripts/{id}/download

Download the source as a .lua attachment. Accepts the same revision parameter.

text/plain · attachment
GETAUTH/me/bookmarks

List the signed-in user’s saved scripts. Requires a session cookie or bearer API key.

JSON · data[]
GET/me

Check your authenticated identity. Anonymous requests return data.user as null. Invalid bearer credentials return 401.

JSON · data.user
GET/users/{username}

Read a public creator profile, including avatar, banner, and lifetime public-script views.

JSON · data
GET/catalog/games

List games and their slugs for script discovery.

JSON · data[]
GET/catalog/tags

List community tags and their slugs.

JSON · data[]
GET/catalog/platforms

List supported platforms.

JSON · data[]

Filter and sort scripts

Use these parameters with GET /scripts.

ParameterValueBehavior
qSearch textMatches script titles and summaries.
gameGame slugFilters scripts for a known game.
sorttrending, newest, updated, popularDefaults 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.

JavaScript · retrieve source
// 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.

StatusMeaningNext step
400Invalid inputCheck fields against endpoint requirements.
401Authentication required or invalid keyCheck the bearer header and whether the key was revoked.
403Action is not permittedCheck account permissions, email verification, and session requirements.
404Resource missing or inaccessibleCheck 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.