Skip to content

Tool Library

Manage your cutting tools, holders, and tool assemblies.

Concepts

Term What it is
Equipment library A named collection of assemblies. A user can have many libraries (one per machine, project, etc.).
Holder A stackable component between the spindle and the cutting tool (collets, extensions, adapters). Passed inline inside assemblies; add_to_library=true also saves it to the per-user holder library.
Tool The cutting-edge component: end mill, drill, reamer, etc. Defined parametrically. Passed inline inside assemblies; add_to_library=true also saves it to the per-user tool library.
Assembly An ordered stack of components (typically holder → optional arbor → tool) that fills one machine tool slot. Lives inside an equipment library.

Endpoints

Method Path Scope
GET /libraries/equipment libraries:read
GET /libraries/equipment/{library_id} libraries:read
POST /libraries/equipment equipment:write
PATCH /libraries/equipment/{library_id} equipment:write
DELETE /libraries/equipment/{library_id} equipment:write
POST /libraries/equipment/{library_id}/assemblies?add_to_library=true equipment:write
PATCH /libraries/equipment/{library_id}/assemblies/{assembly_id}?sync_library=true equipment:write
DELETE /libraries/equipment/{library_id}/assemblies/{assembly_id}?sync_library=true equipment:write
GET /libraries/holders equipment:read
GET /libraries/holders/{holder_id} equipment:read
POST /libraries/holders equipment:write
PATCH /libraries/holders/{holder_id}?sync_assemblies=true equipment:write
DELETE /libraries/holders/{holder_id}?sync_assemblies=true equipment:write
GET /libraries/tools equipment:read
GET /libraries/tools/{tool_id} equipment:read
POST /libraries/tools equipment:write
POST /libraries/tools/validate equipment:read
PATCH /libraries/tools/{tool_id}?sync_assemblies=true equipment:write
DELETE /libraries/tools/{tool_id}?sync_assemblies=true equipment:write
GET /equipment/external-catalogue/tool-types equipment:read
GET /equipment/external-catalogue/search equipment:read
GET /equipment/external-catalogue/{manufacturer}/{article_number} equipment:read

The full request/response schemas (deeply-nested MDES models) live in the Scalar reference.

Sync semantics

  • add_to_library (POST assembly): when true, each component in the assembly is also persisted as a standalone entry in the per-user holder/tool libraries so it can be reused across assemblies.
  • sync_library (PATCH/DELETE assembly): when true (default for DELETE), edits to nested components are propagated to the user's holder/tool libraries; orphaned components are deleted.
  • sync_assemblies (PATCH/DELETE holder/tool): when true, every assembly that references the item is updated or has the reference removed.

Sample: Build from Scratch

Define every component yourself: create an empty equipment library, validate the tool geometry, then compose an assembly that embeds the holder and tool inline. With add_to_library=true, the components are also saved to the per-user holder/tool libraries for reuse.

import requests, uuid

API = "https://app.autonomiq.de/backend-api/api/public/v1"
H = {"X-API-Key": "smk_live_..."}

# 1. Create an empty equipment library (id is server-assigned; read it from the response)
library_id = requests.post(
    f"{API}/libraries/equipment",
    json={
        "library": {"name": "Bracket prod", "assemblies": []},
        "description": "Tooling for the v3 bracket line",
        "is_remote": False,
        "remote_data": {},
        "is_default": False,
    },
    headers=H,
).json()["id"]

# 2. Validate the tool's geometry before committing anything
tool = {
    "name": "6mm carbide endmill",
    "tool_type": "CentreCuttingEndMill",
    "manufacturer": "Acme",
    "flute_count": 4,
    "tool_parameters": {
        "CuttingDiameter": 6.0,
        "DepthOfCutMaximum": 18.0,
        "OverallLength": 50.0,
    },
}

resp = requests.post(f"{API}/libraries/tools/validate", json=tool, headers=H)
if resp.status_code == 400:
    raise RuntimeError(f"Invalid tool: {resp.json()['detail']}")

# 3. Compose the assembly — holder and tool are passed inline
#    add_to_library=true also saves them to the per-user holder/tool libraries
requests.post(
    f"{API}/libraries/equipment/{library_id}/assemblies",
    params={"add_to_library": True},
    json={
        "uuid": str(uuid.uuid4()),
        "name": "ER25 + 6mm endmill",
        "manufacturer": "Acme",
        "components": [
            {
                "component_type": "adaptive_item",
                "adaptive_item": {
                    "uuid": str(uuid.uuid4()),
                    "name": "ER25 collet chuck",
                    "stacking_group": "Holder",
                    "manufacturer": "Acme",
                    # ... other AdaptiveItem fields
                },
            },
            {
                "component_type": "parametric_cutting_tool",
                "parametric_cutting_tool": {
                    "uuid": str(uuid.uuid4()),
                    **tool,
                },
            },
        ],
        # ... other ToolAssembly fields
    },
    headers=H,
).raise_for_status()

POST /libraries/tools/validate is a dry-run that checks a tool's geometric parameters for validity before committing anything. It returns 204 on success and 400 with code=invalid_parameter on any constraint violation; nothing is persisted either way.

Sample: Build from Datron Catalogues

Browse the Datron cloud catalogue, search by metadata, fetch a tool's full MDES entry, and drop it into your equipment library as an assembly.

import requests, uuid

API = "https://app.autonomiq.de/backend-api/api/public/v1"
H = {"X-API-Key": "smk_live_..."}

# 1. Discover available tool_type values to populate a category filter
types = requests.get(
    f"{API}/equipment/external-catalogue/tool-types",
    params={"manufacturer": "Datron"},
    headers=H,
).json()

# 2. Search by article number and/or filters
hits = requests.get(
    f"{API}/equipment/external-catalogue/search",
    params={
        "manufacturer": "Datron",
        "tool_types": "CentreCuttingEndMill",
        "diameter_min": 5.0,
        "diameter_max": 7.0,
        "limit": 20,
    },
    headers=H,
).json()
article = hits["results"][0]["article_number"]

# 3. Fetch the full ToolAssemblyLibraryEntry
entry = requests.get(
    f"{API}/equipment/external-catalogue/Datron/{article}",
    headers=H,
).json()

# 4. Drop a fresh UUID on it and post into the user's library
entry["uuid"] = str(uuid.uuid4())
requests.post(
    f"{API}/libraries/equipment/{library_id}/assemblies",
    params={"add_to_library": True},
    json=entry,
    headers=H,
).raise_for_status()

search requires either q of 4+ characters or at least one filter; selecting a manufacturer counts as a filter, since it enables browse-all.