API Reference - Migz93/3dq GitHub Wiki
3DQ provides a RESTful API that powers the frontend and can also be used for integrations with other systems. This reference documents the available endpoints.
All API endpoints are relative to your 3DQ instance URL:
http://your-server:6123/api
Currently, the API does not require authentication. It is designed to be used within a trusted network environment.
GET /api/settings
Returns all application settings as key-value pairs.
PUT /api/settings/:key
Updates a specific setting.
Request Body:
{
"value": "new-value"
}
GET /api/settings/quote/next-number
Returns the next available quote number.
GET /api/filaments
Returns all filaments in the database.
GET /api/filaments/active
Returns only active (non-archived) filaments.
GET /api/filaments/:id
Returns a specific filament by ID.
POST /api/filaments
Creates a new filament.
Request Body:
{
"name": "Prusament PLA Galaxy Black",
"type": "PLA",
"diameter": 1.75,
"spool_weight": 1000,
"spool_price": 29.99,
"density": 1.24,
"color": "#000000",
"link": "https://prusament.com/galaxy-black"
}
PUT /api/filaments/:id
Updates an existing filament.
DELETE /api/filaments/:id
Deletes a filament if it's not used in any quotes.
PATCH /api/filaments/:id/toggle-status
Archives or unarchives a filament.
GET /api/printers
Returns all printers in the database.
GET /api/printers/active
Returns only active (non-archived) printers.
GET /api/printers/:id
Returns a specific printer by ID.
POST /api/printers
Creates a new printer.
Request Body:
{
"name": "Bambu Lab X1 Carbon",
"material_diameter": 1.75,
"price": 1199,
"depreciation_time": 8000,
"service_cost": 200,
"power_usage": 100
}
PUT /api/printers/:id
Updates an existing printer.
DELETE /api/printers/:id
Deletes a printer if it's not used in any quotes.
PATCH /api/printers/:id/toggle-status
Archives or unarchives a printer.
GET /api/hardware
Returns all hardware items in the database.
GET /api/hardware/active
Returns only active (non-archived) hardware items.
GET /api/hardware/:id
Returns a specific hardware item by ID.
POST /api/hardware
Creates a new hardware item.
Request Body:
{
"name": "M3x10mm Socket Head Screw",
"unit_price": 0.15,
"link": "https://example.com/screws"
}
PUT /api/hardware/:id
Updates an existing hardware item.
DELETE /api/hardware/:id
Deletes a hardware item if it's not used in any quotes.
PATCH /api/hardware/:id/toggle-status
Archives or unarchives a hardware item.
GET /api/quotes
Returns all quotes in the database.
GET /api/quotes/:id
Returns a specific quote by ID, including all related data (filaments, hardware, print setup, labor).
POST /api/quotes
Creates a new quote.
Request Body:
{
"title": "Tardis Lightbox",
"customer_name": "John Smith",
"date": "2023-06-01",
"notes": "Blue filament preferred",
"markup_percent": 50,
"discount_percent": 0,
"quantity": 1,
"is_quick_quote": false
}
PUT /api/quotes/:id
Updates an existing quote.
DELETE /api/quotes/:id
Deletes a quote and all associated data.
GET /api/quotes/:id/invoice/:type
Generates an HTML invoice for a quote. The :type
parameter can be either client
or internal
.
GET /api/spoolman/status
Returns the current status of the Spoolman integration.
POST /api/spoolman/test-connection
Tests the connection to the configured Spoolman instance.
Request Body:
{
"url": "http://spoolman.local:7912"
}
POST /api/spoolman/sync
Synchronizes filament data from Spoolman to 3DQ.
All API responses follow a standard format:
{
"success": true,
"data": { ... }
}
{
"success": false,
"error": "Error message"
}
Standard HTTP status codes are used:
- 200: Success
- 400: Bad Request
- 404: Not Found
- 500: Server Error