Skip to main content
POST
/
materials
/
filament
Create a filament record
curl --request POST \
  --url https://api.autoprintfarm.com/public/v1/materials/filament \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "<string>",
  "color": "<string>",
  "hex_code": "<string>",
  "brand": "<string>",
  "diameter": "<string>",
  "remaining_grams": 0,
  "spool_weight_grams": 1,
  "low_threshold": 1,
  "location": "<string>"
}
'
{
  "success": true,
  "data": {
    "id": "<string>",
    "type": "<string>",
    "color": "<string>",
    "hex_code": "<string>",
    "brand": "<string>",
    "diameter": "<string>",
    "remaining_grams": 123,
    "spool_weight_grams": 123,
    "low_threshold": 123,
    "status": "<string>",
    "location": "<string>",
    "created_at": "<string>",
    "updated_at": "<string>"
  }
}

Authorizations

Authorization
string
header
required

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.

Body

application/json
type
string
required
Required string length: 1 - 100
color
string
required
Required string length: 1 - 50
hex_code
string | null
Maximum string length: 7
brand
string | null
Maximum string length: 100
diameter
string | null
Maximum string length: 20
remaining_grams
number
default:0
Required range: x >= 0
spool_weight_grams
number | null
Required range: x >= 0
low_threshold
number | null
Required range: x >= 0
location
string | null
Maximum string length: 200

Response

Created

success
enum<boolean>
required
Available options:
true
data
object
required