API Reference
/
POST /v1/splats
POST /api/v1/splats
Commit an uploaded single-file or LOD Scene to the external user's library. This endpoint verifies the uploaded objects, reserves the user's storage quota, creates the Scene record, and adds default viewer/editor settings.
POST
https://moshpit.studio/api/v1/splats
Auth
All three headers are required:
Authorization: Bearer msk_YOUR_SECRET_KEY
X-Moshpit-Public-Key: mpk_YOUR_PUBLIC_KEY
X-Moshpit-External-User-Id: YOUR_HOST_USER_IDFor a single-file Scene, splatUrl must be the fileUrl returned from
POST /api/v1/uploads/splat-file.
For an LOD Scene, use the manifestUrl and folderKey returned from
POST /api/v1/uploads/lod-folder.
All upload values must belong to the same external user.
REST API access
REST API access is included on Free, Pro, and Enterprise. Storage, Scene counts, and integration limits still apply.
Scene visibility
New Scenes default to unlisted. Existing Scenes keep their saved visibility.
public: accessible by link and included in discovery lists.unlisted: excluded from discovery lists. When the integration enforces share links, anyone other than the owner needs its share token to open it.private: accessible to its owner and authorized embed access.
Only the owning external user can edit a Scene, regardless of visibility.
Body
JSON
{
"title": "Lobby scan",
"description": "Optional notes",
"visibility": "unlisted",
"splatUrl": "https://cdn.example.com/splats/embed/...",
"splatType": "file",
"imageUrl": "https://cdn.example.com/splat-images/external-user/thumbnail.webp",
"thumbnailDepthUrl": "https://cdn.example.com/splat-images/external-user/depth.jpg",
"initialCameraPosition": [0, 1.5, 4],
"initialCameraRotation": [-10, 0, 0]
}visibility defaults to unlisted, and splatType defaults to file. Upload
imageUrl and thumbnailDepthUrl through
POST /api/v1/uploads/splat-images.
If you provide thumbnailDepthUrl, you must also provide imageUrl. Camera and
transform arrays are optional three-number tuples. Omitted values use Studio
defaults.
For an LOD Scene, replace the upload fields with:
JSON
{
"splatType": "lod",
"splatUrl": "https://cdn.example.com/splats/external-user/lod-.../lod-meta.json",
"lodFolderKey": "splats/external-user/lod-.../"
}Voxel collision
Any integration can attach a precomputed voxel pair to a new Scene.
Sign through POST /api/v1/uploads/voxel-collision,
then PUT both artifacts before committing their fileUrl values:
JSON
{
"voxelJsonUrl": "<voxelJson.fileUrl>",
"voxelBinUrl": "<voxelBin.fileUrl>",
"voxelCollision": {
"coordinateSpace": "splat-local",
"surfaceOnly": true
}
}The pair is optional, but both URLs are required when either is supplied.
voxelCollision is optional. Use splat-local only when the grid is authored
in the primary splat asset's local coordinate frame, with the same axes,
units and origin. Its collision and preview then follow the splat's full
translation, rotation and scale through editor save, reload and viewer playback.
Do not bake the Scene placement into a splat-local grid. surfaceOnly defaults
to false; true ignores fully enclosed interior cells, useful for venue shells.
Omitting the attachment keeps the existing generated-grid convention.
No GLB, mesh descriptor, triangle count or separate collision transform is
required for a voxel pair. The existing collisionMeshUrl field and
POST /api/v1/uploads/collision-mesh remain supported for integrations using
source GLBs, including GLB-only commits. These are independent options.
Commit validates storage ownership, actual sizes and voxel octree structure. Both files count toward storage and failed-commit cleanup. Invalid or partial pairs return 400; foreign uploads return 403. Collision loads automatically, and the viewer keeps movement locked until required collision is ready.
Success response
JSON
{
"status": "success",
"splatId": "65f1a2b3c4d5e6f7a8b9c0d1",
"shareToken": "Qm9iIGlzIGEgc2hhcmUgdG9rZW4gZXhhbXBsZSAxMjM",
"shareUrlExpiresAt": null,
"splat": {
"id": "65f1a2b3c4d5e6f7a8b9c0d1",
"title": "Lobby scan",
"visibility": "unlisted",
"externalUserId": "host_user_123",
"isOwner": true
},
"usage": {
"usedBytes": 17825792,
"limitBytes": 21474836480,
"remainingBytes": 21457010688,
"percentUsed": 0.08
}
}Studio saves shareToken with the new unlisted Scene in the same database
insert and returns it on success. Build your viewer share URL from this token;
no second request is needed. The token has no time-based expiry, and
shareUrlExpiresAt is always null. Leaving Unlisted ends the token
permanently. Public and private Scenes return shareToken: null.
usage.limitBytes is derived from the integration owner's Studio account
storage meter. Host applications do not provide this value.
Error responses
| Status | Cause |
|---|---|
| 400 | Invalid JSON, invalid fields, missing external user, or invalid upload URL |
| 401 | Missing or invalid Bearer / public-key combination |
| 403 | Uploaded object does not belong to the external user |
| 404 | External user not found |
| 413 | External user storage quota exceeded |
If commit fails because of quota or database creation, Studio attempts to remove the uploaded object so the bucket and quota stay consistent.
Scene author
Optionally include author in the request:
JSON
{
"author": {
"name": "Leartes Studios",
"iconUrl": "https://example.com/author-icon.png",
"sourceUrl": "https://www.fab.com/listings/84e0fd02-9c0a-468b-9c3b-f454d4326f4e"
}
}Replace the example icon URL with the author's image URL. The name is required when supplying an author, trimmed, and limited to 200 characters. Icon and source URLs are optional HTTP or HTTPS URLs, up to 2048 characters each. Omit author or pass null to create a Scene without credit. The response includes author, or null when absent. See updating author credit for editing and removal, including Studio and Editor Embed controls.