Call the XML Inventory Viewer's JSON API from another project using an API key.
Log in, open the API Keys tab, name the key (typically the calling app's name), set an expiration in days (0 = never expires), and click Generate. The full key is shown exactly once — copy it immediately.
Send the key on every request:
Authorization: Bearer xiv_<your key>
A missing, invalid, expired, or revoked key returns:
HTTP/1.1 401 Unauthorized
{"error":"unauthorized"}
A key has the same access as a logged-in admin, except it cannot call /api/admin/keys* — only a logged-in session can create or revoke keys.
| Method | Path | Purpose |
|---|---|---|
| GET | /api/files | List uploaded XML file names |
| GET | /api/columns | List available inventory columns |
| GET | /api/summary | Paged, searchable, sortable view across all files |
| GET | /api/file-records | Paged, searchable, sortable view of one file |
| POST | /api/upload | Upload a new XML inventory file |
| GET | /api/export/summary | Download an .xlsx export across all files |
| GET | /api/export/file | Download an .xlsx export of one file |
Query params: search, sort (a column key), order (asc|desc), page (default 1), limit (one of 25,50,100,500,1000,5000,10000; default 50).
curl -H "Authorization: Bearer xiv_<your key>" \
"https://your-instance/api/summary?search=toyota&sort=year&order=desc&page=1&limit=50"
Multipart form upload; the file field must be named file and end in .xml.
curl -H "Authorization: Bearer xiv_<your key>" \
-F "file=@march_intake.xml" \
https://your-instance/api/upload
Same query params as their read counterparts, plus a required columns (comma-separated column keys). Streams back an .xlsx file.
curl -H "Authorization: Bearer xiv_<your key>" \
"https://your-instance/api/export/summary?columns=vin,year,make,model" \
-o summary.xlsx
expirationDays: 0 at creation means the key never expires.401 {"error":"unauthorized"} as a missing key.