XentrDeveloper Docs

Quickstart

Make your first Factory OS API call in under 60 seconds.

This guide walks you through listing the machines in one of your factories — the "Hello, World" of the Factory OS API.

Prerequisites

  • A Xentr account with at least one organization and factory
  • A Supabase access token (see Authentication)
  • curl or any HTTP client

1. Grab your access token

Sign in to xentr.ai, open your browser devtools, and copy the Supabase access token from local storage or your sb-*-auth-token cookie.

For long-lived programmatic access, create a service role token in your organization settings (coming soon).

2. Identify your factory slug

Path params use factory slugs, not UUIDs. Find your slug in the Xentr dashboard URL:

https://www.xentr.ai/biocare/factories/biocare-main
                                       ^^^^^^^^^^^^
                                       factory slug

3. List machines

curl https://api.xentr.ai/api/factories/biocare-main/machines \
  -H "Authorization: Bearer $XENTR_TOKEN"
const res = await fetch(
  'https://api.xentr.ai/api/factories/biocare-main/machines',
  { headers: { Authorization: `Bearer ${process.env.XENTR_TOKEN}` } },
);
const machines = await res.json();
console.log(machines);
import os, requests

res = requests.get(
    "https://api.xentr.ai/api/factories/biocare-main/machines",
    headers={"Authorization": f"Bearer {os.environ['XENTR_TOKEN']}"},
)
print(res.json())

You'll get back an array of machines scoped to that factory:

[
  {
    "id": "a1b2c3d4-...",
    "code": "CNC-001",
    "name": "Haas VF-2",
    "factoryId": "...",
    "status": "running"
  }
]

4. What next?

On this page