API Reference
/
POST /v1/splats/batch-delete
POST /api/v1/splats/batch-delete
Permanently delete up to 50 scenes owned by the supplied external user. Each scene gets the same cleanup as DELETE /api/v1/splats/{splatId}. The response returns one result per scene, so a single bad ID never blocks the rest of the batch.
POST
https://moshpit.studio/api/v1/splats/batch-delete
Auth
All three headers are required:
Plain
Authorization: Bearer msk_YOUR_SECRET_KEY
X-Moshpit-Public-Key: mpk_YOUR_PUBLIC_KEY
X-Moshpit-External-User-Id: YOUR_HOST_USER_IDOnly scenes that belong to the integration tied to the keys and to the supplied external user are deleted. Any other ID comes back as not_found. The response never says whether a scene owned by someone else exists.
REST API access
REST API access is included on Free, Pro, and Enterprise. Storage, Scene counts, and integration limits still apply.
Request body
| Field | Type | Notes |
|---|---|---|
splatIds | string[] | 1–50 scene IDs. Duplicates are removed (first occurrence wins), then the 50 limit is checked. |
Example request
Bash
curl -X POST "https://moshpit.studio/api/v1/splats/batch-delete" \
-H "Authorization: Bearer msk_YOUR_SECRET_KEY" \
-H "X-Moshpit-Public-Key: mpk_YOUR_PUBLIC_KEY" \
-H "X-Moshpit-External-User-Id: host_user_123" \
-H "Content-Type: application/json" \
-d '{"splatIds":["65f1a2b3c4d5e6f7a8b9c0d1","65f1a2b3c4d5e6f7a8b9c0d2"]}'Success response — 200 OK
A request that passes validation returns 200, even when some or every scene could not be deleted. Read the per-scene status values.
JSON
{
"status": "success",
"results": [
{ "splatId": "65f1a2b3c4d5e6f7a8b9c0d1", "status": "deleted" },
{
"splatId": "65f1a2b3c4d5e6f7a8b9c0d2",
"status": "not_found",
"message": "Scene not found"
}
],
"summary": {
"requested": 2,
"deleted": 1,
"notFound": 1,
"conflict": 0,
"failed": 0,
"skipped": 0
}
}results keeps the order of the de-duplicated input, with exactly one entry per ID.
Per-scene status
status | Meaning | What to do |
|---|---|---|
deleted | The scene is gone. Asset cleanup runs in the background. | Remove it from your UI. |
not_found | No active scene with this ID belongs to this external user. It may already be deleted, or the ID is malformed. | Treat as already removed. |
conflict | The scene changed (for example, a new version was published) while it was being deleted. Nothing was removed. | Reload the scene and retry. |
failed | An unexpected server error before this scene was removed. The scene still exists. | Retry the ID. Other scenes in the batch are unaffected. |
skipped | The request ran out of time before starting this scene. Nothing was removed for it. | Send the ID again in a new request. |
Side effects
For every deleted scene, in order:
- Storage cleanup jobs are queued for the splat file or LOD folder, thumbnails, collision and voxel files, owned audio and layer assets, and any retained versions.
- The scene document is removed. Retained scene versions, comments and
SplatViewrecords are removed. - The external user's
usedBytesstorage quota is decremented by the scene's size. - Cache tags
splat-{id},splat-meta-{id}(and slug tags) are revalidated.
After the batch, queued storage cleanup runs once and home-portfolio is revalidated.
Up to three scenes are deleted at a time. A request stops starting new deletes after about 18 seconds and returns the scenes it didn't reach as skipped, so large batches answer before gateway timeouts. If a request still fails in transit, some scenes may already be deleted. Retrying the same IDs is safe: already-deleted scenes come back as not_found.
Error responses
These reject the whole request. Nothing is deleted.
| Status | Cause |
|---|---|
| 400 | Body isn't JSON, splatIds is missing, not an array, empty, holds a non-string, or has more than 50 unique IDs |
| 401 | Missing or invalid Bearer / public-key combination |
| 404 | The X-Moshpit-External-User-Id header doesn't resolve to an external user |
Limits
- At most 50 unique IDs per request. To delete more, send several requests.
- For a progress UI, send smaller batches (for example 5 IDs) one after another. Each response tells you which scenes are done.
- One request is metered as one API call, whatever the batch size.
What's next
- DELETE /v1/splats/{splatId} — delete a single scene.
- GET /v1/splats — list the user's remaining scenes after a delete.
- DELETE /v1/external-user — delete a customer and all of their scenes.