Skip to content
TailorMi

TailorMi API Reference

Version 1 — the catalogue, the models, and the account's orders.

Authentication — three interchangeable ways

Every endpoint accepts an API key, and most also accept a signed-in session (so the dashboard and same-account scripts work without a key).

Authorization: Bearer tm_live_…     (standard)
X-API-Key: tm_live_…             (for agents and gateways)
tailormi_session cookie          (signed-in browser)

Keys are created in the developer portal. Only the SHA-256 hash is stored; the full key is shown once at creation.

Scopes

catalog:readList and read products, sizes, colours and prices
fit:readRun fit analysis and size recommendations
measurements:writeSubmit body measurements for inference
models:readRead the model inventory
orders:readRead the account's orders
orders:writeCreate orders (payment stays on the website)
account:readRead the account a key belongs to
usage:readRead usage statistics

Measurement model — two pathways

POST
/api/v1/measurements/infer — one body.

curl -X POST https://www.tailormi.com/api/v1/measurements/infer \
  -H "Authorization: Bearer $TAILORMI_KEY" -H "Content-Type: application/json" \
  -d '{"chestCm": 92, "waistCm": 76}'

POST
/api/v1/measurements/batch — up to 20 bodies, each with an optional id.

curl -X POST https://www.tailormi.com/api/v1/measurements/batch \
  -H "Authorization: Bearer $TAILORMI_KEY" -H "Content-Type: application/json" \
  -d '{"items":[{"id":"emp-1","measurements":{"chestCm":92}},{"id":"emp-2","measurements":{"chestCm":104}}]}'

Response: completed measurements, which fields were inferred, a confidence score (0–1), and plausibility flags for values outside healthy ranges.

Fit model — two pathways

GET
/api/v1/fit/size?chest=92&waist=76&hips=96 — quick size against the standard chart.

POST
/api/v1/fit — full analysis against your own garment specs.

curl -X POST https://www.tailormi.com/api/v1/fit \
  -H "Authorization: Bearer $TAILORMI_KEY" -H "Content-Type: application/json" \
  -d '{"measurements":{"chestCm":92,"waistCm":76,"hipsCm":96},
       "garments":[{"id":"M","chestCm":100,"waistCm":88,"hipsCm":104,"stretchPct":8}],
       "includeChartRanking": true}'

Response: per-region ease (chest, waist, hips, shoulder, sleeve), a 0–100 score, a verdict, blockers, and the ranked sizes with "between sizes" detection.

Catalog and orders

curl -H "Authorization: Bearer $TAILORMI_KEY" "https://www.tailormi.com/api/v1/products?productType=scrubs&limit=12"
curl -H "Authorization: Bearer $TAILORMI_KEY" https://www.tailormi.com/api/v1/products/scrub-top-navy
curl -H "Authorization: Bearer $TAILORMI_KEY" https://www.tailormi.com/api/v1/orders

Creating an order returns an orderId and total; the customer pays on the website (the response carries the link). Orders are always the key owner's own.

Agents

/api/v1/agent returns a flat tool manifest (name, method, path, parameters, scope) that an agent can consume directly; /api/v1/openapi.json is the OpenAPI 3.1 document for tooling that prefers a spec.

Rate limits and errors

120 read requests and 20 write requests per key per minute. A limited request returns 429 with a Retry-After header.

401  {"error": "Invalid API key.", "docs": "/developers"}
403  {"error": "This API key does not have the \"orders:write\" scope.", "docs": "/developers"}
429  {"error": "Rate limit exceeded for this API key.", "retryAfterSec": 42}
400  {"error": "Invalid body. …", "issues": [{"path": "chestCm", "message": "Enter a number"}]}

JavaScript and Python examples

// JavaScript
const res = await fetch("https://www.tailormi.com/api/v1/fit/size?chest=92&waist=76&hips=96", {
  headers: { Authorization: `Bearer ${process.env.TAILORMI_KEY}` },
});
const { size, confidence } = await res.json();
# Python
import os, urllib.request
req = urllib.request.Request(
    "https://www.tailormi.com/api/v1/fit/size?chest=92&waist=76&hips=96",
    headers={"Authorization": f"Bearer {os.environ['TAILORMI_KEY']}"},
)
print(urllib.request.urlopen(req).read().decode())