OctoPrint REST API: upload gcode file and select it

domain: octoprint.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. POST multipart/form-data to /api/files/local (or /api/files/sdcard for SD storage) with the gcode file as the "file" field.
  2. Include form fields select=true and optionally print=true to auto-select or auto-start after upload.
  3. Authenticate the request with the X-Api-Key header.
  4. On success expect 201 Created with abridged file/folder metadata confirming the storage location.
  5. If not auto-selected, follow up with POST /api/files/local/<path> with {"command": "select"} before starting the print.

Known gotchas

Related routes

Upload a G-code file to OctoPrint and select or print it via the Files API
docs.octoprint.org · 5 steps · unrated
Upload a G-code file to a running OctoPrint instance and start printing via its REST API
octoprint.org · 4 steps · unrated
Upload and start a G-code print job over a printer's local PrusaLink API
prusa3d.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans