Skip to content

Complete reference for all AutoPrintFarm API endpoints.

GET /v1/printers

Query Parameters:

  • status - Filter by status (idle, printing, offline)
  • group - Filter by group ID
  • tag - Filter by tag
  • page - Page number
  • per_page - Results per page (max 100)

Example:

Terminal window
curl "https://api.autoprintfarm.com/v1/printers?status=printing" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"data": [
{
"id": "prt_abc123",
"name": "Prusa-A-01",
"status": "printing",
"model": "Prusa i3 MK3S+",
"firmware": "OctoPrint 1.8.0",
"temperatures": {
"hotend": 215,
"bed": 60
},
"current_job": "job_xyz789",
"progress": 45,
"group": "production",
"tags": ["enclosed", "multi-material"],
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-10-06T14:25:00Z"
}
],
"pagination": {
"page": 1,
"per_page": 20,
"total": 45,
"total_pages": 3
}
}
GET /v1/printers/:id
POST /v1/printers

Body:

{
"name": "Prusa-B-05",
"connection_url": "http://192.168.1.105",
"api_key": "OctoPrint-API-Key",
"model": "Prusa i3 MK3S+",
"group": "production",
"tags": ["enclosed"]
}
PATCH /v1/printers/:id
DELETE /v1/printers/:id
POST /v1/printers/:id/actions

Actions:

  • pause - Pause current job
  • resume - Resume paused job
  • cancel - Cancel current job
  • home - Home all axes
  • cooldown - Cool down heaters

Example:

Terminal window
curl -X POST "https://api.autoprintfarm.com/v1/printers/prt_abc123/actions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"action": "pause"}'

GET /v1/jobs

Query Parameters:

  • status - queued, printing, completed, failed, cancelled
  • printer_id - Filter by printer
  • priority - low, normal, high, urgent
  • from - Start date (ISO 8601)
  • to - End date (ISO 8601)
GET /v1/jobs/:id

Response:

{
"id": "job_xyz789",
"name": "part-001.gcode",
"status": "printing",
"priority": "normal",
"printer_id": "prt_abc123",
"progress": 45,
"file_url": "https://cdn.autoprintfarm.com/files/xyz789.gcode",
"estimated_duration": 7200,
"elapsed_time": 3240,
"material": {
"type": "PLA",
"color": "Black",
"estimated_usage": 45.2
},
"created_at": "2025-10-06T12:00:00Z",
"started_at": "2025-10-06T12:15:00Z",
"completed_at": null
}
POST /v1/jobs

Body:

{
"file_url": "https://your-cdn.com/model.gcode",
"name": "custom-part-v2",
"priority": "high",
"printer_id": "prt_abc123", // Optional - auto-assign if omitted
"material": "PLA",
"copies": 1,
"tags": ["production", "order-456"]
}

With File Upload:

Terminal window
curl -X POST "https://api.autoprintfarm.com/v1/jobs" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@model.gcode" \
-F "name=custom-part" \
-F "priority=high"
PATCH /v1/jobs/:id
DELETE /v1/jobs/:id

GET /v1/materials
GET /v1/materials/:id

Response:

{
"id": "mat_pla001",
"type": "PLA",
"brand": "Hatchbox",
"color": "Black",
"spool_weight": 1000,
"remaining_weight": 650,
"cost_per_kg": 20.00,
"printer_id": "prt_abc123",
"reorder_threshold": 100,
"status": "active",
"created_at": "2025-09-01T10:00:00Z"
}
POST /v1/materials
PATCH /v1/materials/:id

GET /v1/analytics/fleet

Query Parameters:

  • from - Start date
  • to - End date
  • group - Filter by group

Response:

{
"period": {
"from": "2025-10-01T00:00:00Z",
"to": "2025-10-06T23:59:59Z"
},
"metrics": {
"total_printers": 45,
"active_printers": 38,
"utilization_rate": 84.4,
"jobs_completed": 1247,
"success_rate": 96.8,
"total_print_time": 89234,
"material_consumed": 34567,
"estimated_cost": 691.34
}
}
GET /v1/analytics/printers/:id
GET /v1/analytics/jobs
GET /v1/analytics/materials

GET /v1/webhooks
POST /v1/webhooks

Body:

{
"url": "https://your-app.com/webhook",
"events": [
"job.created",
"job.started",
"job.completed",
"job.failed",
"printer.offline",
"printer.online",
"material.low"
],
"secret": "webhook_secret_key",
"enabled": true
}

Available Events:

  • job.* - All job events
  • job.created, job.started, job.completed, job.failed
  • printer.* - All printer events
  • printer.online, printer.offline, printer.error
  • material.* - All material events
  • material.low, material.empty
PATCH /v1/webhooks/:id
DELETE /v1/webhooks/:id
POST /v1/webhooks/:id/test

GET /v1/organization
PATCH /v1/organization

GET /v1/users
GET /v1/users/:id
POST /v1/users/invite

CodeDescription
invalid_requestRequest format invalid
invalid_api_keyAPI key invalid or expired
insufficient_permissionsMissing required scope
resource_not_foundResource doesn’t exist
printer_busyPrinter already printing
printer_offlinePrinter not connected
file_invalidG-code file invalid
quota_exceededPlan limit reached
rate_limit_exceededToo many requests
internal_errorServer error

See API Overview - Rate Limiting for details.


All list endpoints support pagination:

Terminal window
GET /v1/jobs?page=2&per_page=50

Maximum per_page: 100


Sort results with sort parameter:

Terminal window
GET /v1/jobs?sort=-created_at # Descending
GET /v1/jobs?sort=priority # Ascending

Request specific fields only:

Terminal window
GET /v1/printers?fields=id,name,status

Reduces response size and improves performance.


import { AutoPrintFarm } from '@autoprintfarm/sdk';
const client = new AutoPrintFarm({ apiKey: 'YOUR_KEY' });
// List printers
const printers = await client.printers.list({ status: 'printing' });
// Create job
const job = await client.jobs.create({
file_url: 'https://example.com/model.gcode',
priority: 'high'
});
// Get analytics
const analytics = await client.analytics.fleet({
from: '2025-10-01',
to: '2025-10-06'
});
from autoprintfarm import Client
client = Client(api_key='YOUR_KEY')
# List printers
printers = client.printers.list(status='printing')
# Create job
job = client.jobs.create(
file_url='https://example.com/model.gcode',
priority='high'
)
# Get analytics
analytics = client.analytics.fleet(
from_date='2025-10-01',
to_date='2025-10-06'
)