Using the Artifact API
What you'll learn
- What the Artifact REST API provides and how it relates to the in-app exports from Tutorial 13: BOMs & Exports
- How to get an API key and open the interactive API documentation
- The resource hierarchy you walk when pulling data (organization → project → diagram → version → harness)
- How to export BOMs, Connections Tables, netlists, harness data, and library inventory programmatically
- How to write back: create and update library items, and sync NX-routed lengths onto a harness
- How errors, permissions, and v1 limitations behave
Prerequisites
- Complete Tutorial 13: BOMs & Exports so you know what a BOM, Connections Table, and netlist represent in Artifact.
- Complete Tutorial 17: Admin Options — you need Allow User API Access enabled for your role (or be an Administrator who can turn it on), and you must create an API key from API Keys & Documentation in your profile menu.
Steps
01Understand what the API is for
The Artifact API is a programmatic surface for data you already manage in the app. Most of version v1 is GET endpoints — list resources and download exports — plus a small set of POST write endpoints that create and update library items and write NX-routed lengths onto a harness (Step 11). You cannot create or edit diagrams, or release versions, through the API today.
Every request is scoped to your organization and inherits your user permissions. An Editor's key can read the same projects and diagrams they can open in the UI. The write endpoints need a key whose creator is an Editor or Administrator.
Typical uses:
- Nightly BOM or Connections Table pulls into ERP/MRP
- Custom dashboards over library procurement fields
- Harness or diagram JSON fed into downstream CAD or analysis tools
- Netlist export for test-bench or simulation workflows
What the API does not cover in v1: PDF drawing export, Cut Lists, or diagram edits (other than harness lengths).
02Confirm you have access and create a key
API access is opt-in per organization.
- An Administrator opens Admin Controls (bottom-left profile avatar → Admin Controls) and sets Allow User API Access to Admin, Editor, or Disable API Access (Tutorial 17: Admin Options, Step 5).
- If your role is allowed, click your profile avatar in the bottom-left corner → API Keys & Documentation.
- Click Create New API Key, set a Key Name (minimum 10 characters) and Expires In (7–365 days), then Create Key.
- Copy the key immediately — it is shown once. Store it in a secrets manager, not in source control.
Keys inherit your permission level. If an admin later disables API access for your role, existing keys below that threshold stop working.
03Open the API documentation
The in-app docs are the source of truth for paths, parameters, and live testing.
- In the API Keys modal, click View API Documentation (opens https://app.artifact.engineer/api/v1/docs in a new tab), or browse directly to
{your-artifact-url}/api/v1/docs. - Paste your API key into the Authentication field at the top. A green check confirms it is loaded for Try it buttons on each endpoint.
- Expand any endpoint to see required headers/query params, example responses, generated curl commands, and a Send Request tester.
04Authenticate every request
Pass the key as a Bearer token:
Authorization: Bearer <YOUR_API_KEY>
Use your deployment's base URL — for Artifact Cloud that is typically https://app.artifact.engineer (self-hosted instances use their own hostname). All v1 routes live under /api/v1/.
Example:
curl -X GET "https://app.artifact.engineer/api/v1/projects/list" \
-H "Authorization: Bearer YOUR_API_KEY"
Most endpoints accept parameters as query strings (recommended) or as custom headers with the same names. The POST write endpoints (Step 11) take a JSON body instead.
05Walk the resource hierarchy
You usually discover IDs top-down before exporting a specific version:
Organization (implicit — scoped by your API key)
└── Projects GET /api/v1/projects/list
└── Diagrams GET /api/v1/diagrams/list?projectId=…
└── Versions GET /api/v1/diagram-versions/list?diagramId=…
├── BOM / Connections Table / Netlist / raw JSON
└── Harnesses GET /api/v1/harnesses/list?diagramVersionId=…
└── Harness BOM / raw layout
└── Library GET /api/v1/library
All IDs are UUIDs. Pick the diagram version you want — often a release for manufacturing, or the latest draft for work-in-progress automation.
To go straight to released work, GET /api/v1/releases/list?diagramId=… lists a diagram's releases without walking its versions. The export routes below also accept a diagramId plus a release or variant name in place of diagramVersionId — for example GET /api/v1/diagram-versions/bom/csv?diagramId=DIAGRAM_ID&release=RELEASE_NAME.
06Export a diagram BOM
These endpoints mirror the in-app BOM modal (Tutorial 13: BOMs & Exports) as JSON or CSV.
JSON — structured rows plus a columns array:
GET /api/v1/diagram-versions/bom/raw?diagramVersionId=VERSION_ID
CSV — same data as a downloadable file:
GET /api/v1/diagram-versions/bom/csv?diagramVersionId=VERSION_ID
Optional query parameters on both:
| Parameter | Default | Values |
|---|---|---|
bomType | all | all, devices, connectors, cables, tools |
lengthUnit | Project Units | in, ft, cm, m, mm |
massUnit | Project Units | g, kg, oz, lb |
massPerLengthUnit | Project Units | g/m, kg/m, oz/ft, lb/ft, kg/km, lb/1000ft |
Unit parameters default to the project's Project Units (Tutorial 17: Admin Options), or in / lb / lb/1000ft if the project has none set.
Example CSV download:
curl -G "https://app.artifact.engineer/api/v1/diagram-versions/bom/csv" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "diagramVersionId=VERSION_ID" \
--data-urlencode "bomType=all" \
-o bom.csv
07Export a Connections Table or netlist
Connections Table — one row per conductor, same pin-to-pin view as the in-app table:
GET /api/v1/diagram-versions/connections-table/raw?diagramVersionId=…
GET /api/v1/diagram-versions/connections-table/csv?diagramVersionId=…
Lengths are always in the project's Project Units.
Netlist — electrical nets with ordered trace steps (see the Naming Specification section in the API documentation):
GET /api/v1/diagram-versions/netlist/raw?diagramVersionId=…
GET /api/v1/diagram-versions/netlist/csv?diagramVersionId=…
Useful netlist query flags:
traceDesignBlocks=true— continue traces through design-block internals (steps prefixed with[Block Name]).showPinName/showPinFunction— control label granularity in each trace step (defaults: pin name on, function off).- CSV-only:
showHarness,showCable,showWire— insert harness/cable/wire columns between trace steps.
08Pull harness data and harness-scoped BOMs
After listing harnesses for a diagram version:
GET /api/v1/harnesses/list?diagramVersionId=VERSION_ID
You can fetch:
- Raw harness layout (ports, segments, treatments) —
GET /api/v1/harnesses/raw?harnessId=… - Harness BOM (JSON or CSV) —
GET /api/v1/harnesses/bom/raw?harnessId=…or…/bom/csv?harnessId=… - NX Routing PLMXML —
GET /api/v1/harnesses/plmxml?harnessId=…returns the same.plmxmlfile as the in-app NX export (Tutorial 15: Linking Artifact to NX). AddincludeShields=trueto include shield conductors.
Harness BOM parameters match the diagram BOM (bomType, unit fields). This is the API equivalent of opening BOM from Harness Properties in the harness editor — treatments and harness-scoped parts roll up here.
There is no Cut List endpoint in v1; cut lengths still require the in-app Cut List modal (Tutorial 13: BOMs & Exports, Step 5).
09Read the full library catalog
Return every library item in your organization:
GET /api/v1/library
Each item includes its data payload (ports, wires, procurement fields, categories, etc.). This complements the Advanced Library Search CSV export (Tutorial 4: Library Search Tools) when you want the raw JSON for a custom integration rather than a filtered query result.
10Fetch raw diagram JSON for custom tooling
When you need the complete version payload — every device, wire, preference, and title-block field — rather than a tabular export:
GET /api/v1/diagram-versions/raw?diagramVersionId=VERSION_ID
The response wraps the same diagram-version document the editor persists: nodes, edges, preferences, and pageData. Use this for bespoke parsers, diff tools, or feeding data into scripts that don't map cleanly onto BOM or Connections Table columns.
11Write to Artifact
Three POST endpoints write data. Each takes a JSON body, and each needs an API key whose creator is an Editor or Administrator:
POST /api/v1/library/create create up to 50 library items
POST /api/v1/library/update update up to 50 library items by id
POST /api/v1/harnesses/lengths/update write NX-routed lengths onto a harness
All three are all-or-nothing: if any item has a problem, the request returns 422 listing every issue and nothing is written. Send "dryRun": true to check a request without writing anything.
- Create library items — items must pass the same rules as the library editor (for example, every value with a unit states its unit). Items that look like an existing part return
409; resend with"force": trueto create them anyway. - Update library items — only the fields you send change, and
nullclears a field. A locked item, or one changed since theexpected_updated_atyou sent, returns409. Every update is saved as a restorable version. - Sync harness lengths — send the routed
.plmxmlfile's text as theplmxmlstring, with aharnessId(or aharnessNameplusdiagramId). This is the API equivalent of Import → Lengths only in the harness 3D CAD Bridge (Tutorial 15: Linking Artifact to NX, Step 8), and it only writes to a draft. Checkpoints and releases are read-only.
12Handle errors
Failed requests return JSON like { "error": "…" } with standard HTTP status codes:
| Code | Typical cause |
|---|---|
401 | Missing, invalid, or expired API key |
400 | Bad parameter (malformed UUID, invalid unit value) |
403 | Write endpoint called with a key whose creator is not an Editor or Administrator |
404 | Resource not found or not in your organization |
409 | Write blocked: a look-alike library item, a locked item, or one changed since you read it |
413 | Request body too large (a PLMXML file over 25 MB) |
422 | Write failed validation — nothing was written |
500 | Unexpected server error — retry or contact support |
If a call succeeds in the docs Try it panel but fails in your script, compare the exact query string and Bearer header first.
Summary
You confirmed API access, created a Bearer token from API Keys & Documentation, and used the API documentation to explore v1's endpoints. You walked the project → diagram → version hierarchy, exported BOMs, Connections Tables, and netlists (JSON or CSV), pulled harness and library data, and know where raw diagram JSON fits. You also saw the write endpoints for library items and NX-routed harness lengths. The API mirrors Tutorial 13: BOMs & Exports's manufacturing exports for automation — without PDFs or Cut Lists.
What's next
- → Tutorial 13: BOMs & Exports — compare API output to what you see in the in-app modals and tune units/filters to match.
- → Tutorial 12: System Versioning — combined BOM and bulk PDF export still live in the UI, not the REST API.
- → Tutorial 17: Admin Options — rotate keys, revoke access, or adjust Allow User API Access for your team.