---
title: "Reassemble the uploaded chunks into one vault file"
method: POST
path: "/api/prints/slicing/gcode-commit"
tags: ["slicing"]
---

# Reassemble the uploaded chunks into one vault file

`POST /api/prints/slicing/gcode-commit`

## Request

- Base URL: `https://www.immersivecommons.com`
- URL: `https://www.immersivecommons.com/api/prints/slicing/gcode-commit`
- Auth: HTTP bearer

SLICE_SERVICE_SECRET bearer. Reassembles server-side in seq order, writes the whole object to the vault, cleans up the temp parts, and returns the `file_id` that the result route links as the job's G-code.

## Request body

- GcodeCommitRequest
  - `request_id` string, required

## Response `200`

The committed vault file.

- GcodeCommitResponse
  - `ok` boolean, required
  - `file` object, required: The committed vault object. Pass `file_id` to the result route as `gcode_file_id`.
    - `file_id` string, required
    - `filename` string
    - `size` integer

## Other responses

- `400`: Invalid JSON, missing request_id, or chunks still missing.
- `401`: Wrong or missing service secret.
- `404`: No upload session for that request_id.
- `503`: SLICE_SERVICE_SECRET is not configured.

---

[API](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api.md) · [All operations](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/revisions/be67c1f67c27?raw)
