Registry API
Schema 2 adds shared regions and systems. Schema 1 fixed-tile endpoints remain available. Read One shared world before converting a scene.
Base URL: https://creators.threetopia.com/api. JSON endpoints return { "message": "…" } on error, sometimes with a details array. Use the CLI unless you need a direct integration.
Authentication
Browser authentication uses a host-only, HttpOnly, Secure, SameSite=Lax cookie. Browser mutations require the same Origin. CLI authentication uses Authorization: Bearer TOKEN. Never put a token in a URL or package file.
| Method and path | Purpose |
|---|---|
GET /health |
Registry version and docs |
POST /auth/start |
Request code: {email}; browser same-origin |
POST /auth/verify |
Verify {challenge,code} and set session cookie |
GET /me |
Current creator or null |
PATCH /profile |
{handle,displayName}; handle is permanent |
GET /profile/avatar |
Own {xHandle,avatarUrl,refreshedAt} |
PUT /profile/avatar |
Import an X photo: {xHandle}; also accepts an X profile URL |
DELETE /profile/avatar |
Remove own photo and X link |
POST /auth/logout |
Revoke current credential |
POST /auth/device |
Start CLI device flow; empty JSON object |
POST /auth/device/poll |
{deviceCode}; pending returns 202 |
POST /auth/device/approve |
Browser only: {userCode,approve:true} |
GET /tokens |
List current creator’s CLI credentials |
DELETE /tokens/:id |
Revoke own CLI credential |
Device flow returns deviceCode, userCode, verificationUri, expiresIn, and interval. Poll at that interval; approval returns accessToken. The device code is confidential and is not the public user code.
Photo imports use Unavatar with generated fallback images disabled. They accept
JPEG, PNG, WebP, or GIF up to 2 MiB. One import per account per minute is allowed.
Failed imports leave the current photo unchanged. The free provider quota is
25 lookups per day per outbound IP; cached provider results do not use that quota.
Provider limits or outages return an error. Stored photos still load.
GET /creators/:handle/avatar serves the stored photo. Public creator records
include xHandle and avatarUrl, both nullable. X handles are user-supplied.
Shared world and sources
| Method and path | Purpose |
|---|---|
GET /world |
Current immutable revision or explicit legacy status |
GET /world/revisions/:hash |
Read an accepted historical revision |
GET /world/revisions/:hash/files?package=REF&path=FILE |
Read an exact pinned world file |
GET /world/policy |
Current provider policy |
PUT /world/policy |
Reviewer saves {policy}; later changes remain proposals |
POST /world/candidates |
{packageId,version,policy?}; optional proposed policy requires a reviewer |
GET /world/candidates |
Own candidates, or all candidates for a reviewer |
GET /world/candidates/:id |
Diagnostics, evidence, and state |
GET /world/candidates/:id/preview |
Private compiled revision |
GET /world/candidates/:id/files?package=REF&path=FILE |
Private exact candidate file |
POST /world/candidates/:id/accept |
Reviewer supplies {revision,note}; stale input returns 409 |
DELETE /world/candidates/:id |
Release an unaccepted candidate and its pins |
GET /sources |
Own repository bindings and build events |
POST /sources |
{packageId,repository,subpath,branch} for a public GitHub source |
DELETE /sources/:id |
Remove an owned binding; immutable releases remain |
POST /sources/reconcile |
Recover missed updates for owned bindings |
POST /sources/github |
GitHub push webhook with a valid HMAC signature |
Candidate creation reads registry bytes again. An uploaded IR or acceptance label is never trusted. Acceptance compares both the current revision and provider policy before it updates the world. Reviewer handles and webhook secrets are operator configuration; see source setup.
Tiles
| Method and path | Purpose |
|---|---|
GET /tiles |
Original worlds, current slots, published/reserved tiles, compatible Wang layouts and rotations |
POST /tiles/reserve |
{q,r,variant}; returns ID and canonical contract |
GET /tiles/:id |
Own reservation and full contract |
DELETE /tiles/:id |
Release own unused reservation |
Reservations are atomically unique by coordinate. Legacy world creation requires an owned reservation; upload requires its exact canonical contract.
Creator directory
GET /creators lists registered users. It includes users with no public packages.
| Parameter | Values |
|---|---|
q |
Name or handle; up to 80 characters. A leading @ is optional. |
filter |
all (default), packages, regions, or empty |
sort |
regions (default, most first), name, name-desc, packages, recent, or newest |
page |
1-based page, with 24 results per page |
packages requires a published package. regions requires a published world package.
empty means no published packages. recent uses the latest public publication.
newest uses the account join date. All sorts use stable tie-breakers.
Unknown filters and sorts use their defaults. Out-of-range pages use the last page.
The response has creators, total, page, pages, and perPage. Each creator
has handle, displayName, packages, regions, xHandle, and avatarUrl. Counts use public packages
owned or managed by the account. Drafts and archived packages do not affect results.
GET /creators/:handle returns the public profile and its published packages.
It accepts page and q (package name, title, or description). The package list
has 24 results per page. The profile count remains unfiltered.
Accounts with no published packages still have a profile.
GET /creators/:handle/compositions returns {nodes} for the composition view.
It starts with every public package owned or managed by the account, then follows
exact published dependencies. Each node has id, name, version, title,
description, kind, role, handle, owned, and dependencies.
owned marks the account's latest published versions. Dependencies have name
and version. An unavailable dependency has no node. Private and archived
metadata are not exposed. Shared references and cycles remain in the graph.
Graphs above 1,000 versions return 422. Use the paginated package list instead.
Packages
| Method and path | Purpose |
|---|---|
GET /packages?kind=asset&q=beacon |
Public, indexed, paginated package search with facet counts |
GET /packages?mine=1 |
Authenticated creator’s packages and states |
POST /packages |
{name,kind,title,description,tileId?,category?,tags?} |
GET /packages/:id |
Metadata, versions; own page includes installers |
PATCH /packages/:id |
Owner-only listing metadata: {category?,tags?}; does not change version manifests |
GET /packages/creators?creatorSearch=river |
Public creator filter suggestions; also accepts catalog filters |
GET /resolve?name=@creator/name&version=1.0.0 |
Public exact version, manifest and file hashes |
DELETE /packages/:id |
Delete own unpublished package |
Omit version or use latest to resolve the highest published numeric version. Use exact versions in dependency manifests.
GET /packages/:id includes a dependencies array for each visible version.
Each entry has id, name, and the exact version. Only published versions of
non-archived dependencies get links. The complete dependency list remains in
manifest.dependencies. Private parent versions are visible only to their owner.
GET /api/packages/compositions returns the signed-in account's composition
nodes. It uses the same format as the public creator composition endpoint.
Roots use each owned package's latest upload, including drafts. A package with
no upload has an empty version. Nodes include state and archived.
Dependencies use exact versions. Private versions are visible only to their owner.
No account parameter can change the owner scope.
Catalog search and filters
GET /api/packages is public. It indexes published names, titles, descriptions, creator handles/display names and listing tags. Search is case-insensitive, accent-insensitive, matches word prefixes, and requires every search word. Punctuation is treated as a separator; FTS operators are not exposed. An input made entirely of punctuation returns no matches.
| Parameter | Values |
|---|---|
q |
Search text, up to 160 characters / 16 search terms |
kind |
asset, world |
category |
nature, architecture, props, characters, vehicles, materials, effects, audio, tools, environments, uncategorized |
creator |
Exact public handle, with or without @ |
license |
Exact license string from a published manifest; use returned facets |
tag |
Exact normalized listing tag |
sort |
relevance, updated, newest, popular, name |
page |
1-based page, default 1; out-of-range pages return the last page |
perPage |
Results per page, default 24, maximum 60 |
Repeat a filter parameter to select multiple values: kind=asset&kind=world. Values within one facet are ORed; facets and the search query are ANDed. At most 10 values are accepted for each filter. Sorting is stable with a package ID tie-breaker. Without sort, searches use relevance and browsing uses the most recent published update. popular counts distinct creators with active CLI installations, not downloads or project count.
GET /api/packages?q=coastal&kind=asset&category=nature&tag=low%20poly&sort=popular&page=1&perPage=24
The response contains packages, total, page, perPage, pages and facets. Each facet entry has value, label and count. Counts respect every active filter except their own facet, so alternatives remain available. A selected value with no matches remains present with a zero count. Tag facets return up to 20 choices; other facets return up to 60. Selected choices take priority. Search creators beyond the initial list through /api/packages/creators?creatorSearch=…, including the current search/filter parameters; the response is {creators:[{value,label,count}]}.
Each result includes id, name, kind, title, description, handle, display_name, category, tags (an array), license, latest_version, state, installers, created_at and updated_at. Catalog timestamps are the first and latest publication times; they do not expose draft activity. The catalog shows the most recently published release. /resolve?version=latest resolves the highest semantic version.
Only non-archived packages with a published release are indexed. Draft versions, owner credentials, emails and private installation records never enter the catalog. The authenticated mine=1 endpoint retains its owner-specific response and does not use the public catalog filters or pagination.
Listing metadata is optional and editable without a new release. PATCH /api/packages/:id accepts a category ID from the table above (or "" to clear it), and an array of up to 10 tags of 1–30 letters, numbers, spaces or hyphens. Do not send uncategorized as a saved category; that is a search facet for the empty value. Tags are trimmed, lowercased and deduplicated. Titles, descriptions and licenses remain part of the published manifest.
Upload lifecycle
POST /packages/:id/versionswith the full package manifest, including file paths, byte lengths and SHA-256 hashes.PUT /packages/:id/versions/:version/files?path=…with each file’s raw bytes.POST /packages/:id/versions/:version/validatewith{}. The server measures uploaded geometry; a valid version becomes ready.- Review the owner-only preview.
POST /packages/:id/versions/:version/publishwith{}to publish.
GET /packages/:id/versions/:version/files?path=… serves bytes. Ready and draft files require the owner’s credential. Published files are public and immutable. Uploaded HTML/JavaScript is served as an attachment with a restrictive CSP and is not executed by the site.
DELETE /packages/:id/versions/:version removes an unpublished draft. Published versions cannot be changed or deleted.
Installations
After verifying and writing all files, the CLI calls POST /packages/:id/install with {version,projectId}. projectId is a random project UUID, not its name or path. DELETE at the same endpoint with {projectId} removes that active installation.
These records describe CLI-reported installations, not arbitrary downloads or proof that a package is actively rendered. Package owners see public creator handles and versions; no private project data.
Wang tile choices
GET /tiles includes choices on each available slot. Each choice contains variant, rotation (0–5) and legacyEdges. Send q, r, variant and rotation to POST /tiles/reserve. The server derives the transition edges itself; do not supply a self-made contract. A 409 means the coordinate or neighborhood changed; fetch /tiles again. A 422 means the requested layout/rotation does not fit. New reservations use version 2 contracts; older contracts remain valid.
Package page sections
GET /api/packages/:id/versions/:version/documentation returns document,
revision, updatedAt, and issues. Use ?revision=1 to read a saved revision.
Published pages are public. Draft pages are visible only to the package owner.
The owner saves with PUT and { "revision": 0, "document": { ... } }.
Use revision 0 for a new page. Otherwise send the last revision you read.
A stale revision returns 409. Incomplete or unknown fields return 422.
The document uses the eight fixed fields and schemaVersion: 1.
Each save creates a page revision. It does not change package bytes. Publication and world acceptance require complete sections. Existing releases stay available.
Package card images
GET or HEAD /api/packages/:id/versions/:version/cover returns the saved WebP
image. Published images are public. Ready versions require the owner's session
or CLI token. A missing image returns 404. Responses include an ETag.
The owner can PUT raw image/webp bytes to this path, or DELETE the image.
Use a still image with an 8:5 ratio, from 320 × 200 to 2048 × 1280 pixels.
The server accepts up to 1 MB. A successful upload returns its url.
Images belong to one exact version and do not change its manifest or files.