Skip to main content
POST
/
files
Create a print file record from an uploaded file
curl --request POST \
  --url https://api.autoprintfarm.com/public/v1/files \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "storage_key": "<string>",
  "product_id": "<string>",
  "number_of_units": 1
}
'
{
  "success": true,
  "data": {
    "id": "<string>",
    "name": "<string>",
    "product_id": "<string>",
    "file_size_bytes": 123,
    "number_of_units": 123,
    "print_time_seconds": 123,
    "filament_weight_grams": 123,
    "filament_length_meters": 123,
    "filament_type": "<string>",
    "printer_model_id": "<string>",
    "nozzle_diameter": 123,
    "layer_count": 123,
    "curr_bed_type": "<string>",
    "default_print_profile": "<string>",
    "object_count": 123,
    "has_thumbnail": true,
    "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
name
string
required

Print filename; must match the filename segment of storage_key and use a supported extension.

Required string length: 1 - 255
storage_key
string
required

Storage key for the uploaded file, taken verbatim from the storage_key field returned by POST /files/upload-url.

Minimum string length: 1
product_id
string

Optional product to associate the file with.

number_of_units
integer
default:1

How many physical units this print produces per run (e.g. a 4-up plate = 4).

Required range: x >= 1

Response

Created

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