API Reference

/

POST /v1/uploads/voxel-collision

POST /api/v1/uploads/voxel-collision

Create signed storage URLs for precomputed voxel collision from any integration. The integration chooses where to generate collision. Studio validates and stores its output; this endpoint does not start a baking job.

POST

https://moshpit.studio/api/v1/uploads/voxel-collision

Auth

Authorization: Bearer msk_YOUR_SECRET_KEY
X-Moshpit-Public-Key: mpk_YOUR_PUBLIC_KEY
X-Moshpit-External-User-Id: YOUR_HOST_USER_ID

Body

{}

JSON

{
  "voxelJson": { "fileSize": 512 },
  "voxelBin": { "fileSize": 1837688 }
}

Use actual positive integer byte counts. JSON is limited to 64 KiB. Binary is limited to 64 MiB and must be a multiple of four bytes.

Success response

{}

JSON

{
  "status": "success",
  "voxelJson": {
    "uploadUrl": "https://storage.example/signed-json",
    "fileUrl": "https://assets.example/splats/embed/.../grid.json",
    "expiresAt": "2026-10-15T12:10:00.000Z"
  },
  "voxelBin": {
    "uploadUrl": "https://storage.example/signed-bin",
    "fileUrl": "https://assets.example/splats/embed/.../grid.bin",
    "expiresAt": "2026-10-15T12:10:00.000Z"
  }
}

PUT the JSON as application/json and the binary as application/octet-stream to their signed URLs. Upload URLs expire in ten minutes. Signing does not reserve storage. Scene creation checks uploaded bytes and reserves quota. Pass fileUrl, not uploadUrl, to Scene creation.

Format

The JSON fields are voxelResolution, leafSize: 4, treeDepth, nodeCount, leafDataCount, and gridBounds: { min: [x,y,z], max: [x,y,z] }. Binary is little-endian uint32 octree nodes followed by leaf words, without a header. Its size is exactly 4 * (nodeCount + leafDataCount). Bounds contain whole voxels and fit the tree; nodes must be reachable with valid child/leaf indices. leafDataCount counts words and is even. The repository guide docs/voxel-collision.md includes the complete layout and a golden fixture.

A GLB is not required. To attach the grid to the primary splat's transform, supply voxelCollision: { "coordinateSpace": "splat-local" } at Scene creation and generate the grid in that asset's local coordinate frame.

Errors

StatusCause
400Invalid JSON, sizes, or missing external user
401Invalid integration credentials

Malformed uploaded bytes and foreign uploads are rejected during Scene creation.