← Back to app

API Guide

Call the XML Inventory Viewer's JSON API from another project using an API key.

Getting 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.

Authenticating requests

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.

Endpoints

MethodPathPurpose
GET/api/filesList uploaded XML file names
GET/api/columnsList available inventory columns
GET/api/summaryPaged, searchable, sortable view across all files
GET/api/file-recordsPaged, searchable, sortable view of one file
POST/api/uploadUpload a new XML inventory file
GET/api/export/summaryDownload an .xlsx export across all files
GET/api/export/fileDownload an .xlsx export of one file

GET /api/summary

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"

POST /api/upload

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

GET /api/export/summary and GET /api/export/file

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

Key lifecycle