curl --request POST \
--url https://api.autoprintfarm.com/public/v1/worklist/{id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"good_units": 50000,
"fail_note": "<string>"
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/worklist/{id}/complete"
payload = {
"good_units": 50000,
"fail_note": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({good_units: 50000, fail_note: '<string>'})
};
fetch('https://api.autoprintfarm.com/public/v1/worklist/{id}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autoprintfarm.com/public/v1/worklist/{id}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'good_units' => 50000,
'fail_note' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.autoprintfarm.com/public/v1/worklist/{id}/complete"
payload := strings.NewReader("{\n \"good_units\": 50000,\n \"fail_note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.autoprintfarm.com/public/v1/worklist/{id}/complete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"good_units\": 50000,\n \"fail_note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/worklist/{id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"good_units\": 50000,\n \"fail_note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"title": "<string>",
"subtitle": "<string>",
"description": "<string>",
"task_type": "<string>",
"priority": "<string>",
"status": "<string>",
"printer_id": "<string>",
"estimated_time_minutes": 123,
"actual_time_minutes": 123,
"started_at": "<string>",
"completed_at": "<string>",
"due_date": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}Complete a worklist task
Sets status to completed with completed_at = now and computes actual_time_minutes if started_at is set. Side effect: for maintenance tasks, clears printer maintenance state and updates last_maintenance_date. For filament_change tasks, updates the printer’s filament fields from the task’s metadata (color, hex, type, grams).
The body is optional and read only for a clear-bed (collection) task whose plate wasn’t added to inventory when its print ended. For a stopped or cancelled print, or one whose end wasn’t observed, passing good_units adds that many good units to inventory; without it the task closes and adds nothing. A finished print started at the printer whose color is still unknown is added to inventory in full (or good_units of it) once its color is picked, and completing it before then is refused with 409 SKU_REQUIRED (if it also stopped or wasn’t seen ending, only when good_units is passed). fail_code and fail_note record why a stopped print failed.
Assembly steps: completing the last open step of an assembly assembles it: its parts and components are taken from inventory and the assembled item is added to stock. If that can’t be done (a component is out of stock, say), the request fails and the step stays open. An order’s Pack task: completing it packs the order, taking the inventory reserved for it. An order whose inventory isn’t reserved yet is refused with 400 ORDER_NOT_CONFIRMED; this and the other refusals below leave the task open.
curl --request POST \
--url https://api.autoprintfarm.com/public/v1/worklist/{id}/complete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"good_units": 50000,
"fail_note": "<string>"
}
'import requests
url = "https://api.autoprintfarm.com/public/v1/worklist/{id}/complete"
payload = {
"good_units": 50000,
"fail_note": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({good_units: 50000, fail_note: '<string>'})
};
fetch('https://api.autoprintfarm.com/public/v1/worklist/{id}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.autoprintfarm.com/public/v1/worklist/{id}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'good_units' => 50000,
'fail_note' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.autoprintfarm.com/public/v1/worklist/{id}/complete"
payload := strings.NewReader("{\n \"good_units\": 50000,\n \"fail_note\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.autoprintfarm.com/public/v1/worklist/{id}/complete")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"good_units\": 50000,\n \"fail_note\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autoprintfarm.com/public/v1/worklist/{id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"good_units\": 50000,\n \"fail_note\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"title": "<string>",
"subtitle": "<string>",
"description": "<string>",
"task_type": "<string>",
"priority": "<string>",
"status": "<string>",
"printer_id": "<string>",
"estimated_time_minutes": 123,
"actual_time_minutes": 123,
"started_at": "<string>",
"completed_at": "<string>",
"due_date": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"details": "<unknown>"
}
}Authorizations
API keys are minted in the AutoPrintFarm web app under Settings → API Keys. Send as Authorization: Bearer apf_live_.... Keys are shown exactly once at creation and can be revoked at any time.
Path Parameters
Body
Was this page helpful?