# Quickstart (/docs/quickstart)



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

## Prerequisites [#prerequisites]

* A Xentr account with at least one organization and factory
* A Supabase access token (see [Authentication](/docs/authentication))
* `curl` or any HTTP client

## 1. Grab your access token [#1-grab-your-access-token]

Sign in to the dashboard at [app.xentr.ai](https://app.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 [#2-identify-your-factory-slug]

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

```
https://app.xentr.ai/[org-slug]/factories/[factory-slug]
                                       ^^^^^^^^^^^^
                                       factory slug
```

## 3. List machines [#3-list-machines]

<Tabs items="[&#x22;curl&#x22;, &#x22;TypeScript&#x22;, &#x22;Python&#x22;]">
  <Tab value="curl">
    ```bash
    curl https://api.xentr.ai/api/factories/[factory-slug]/machines \
      -H "Authorization: Bearer $XENTR_TOKEN"
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts
    const res = await fetch(
      'https://api.xentr.ai/api/factories/[factory-slug]/machines',
      { headers: { Authorization: `Bearer ${process.env.XENTR_TOKEN}` } },
    );
    const machines = await res.json();
    console.log(machines);
    ```
  </Tab>

  <Tab value="Python">
    ```python
    import os, requests

    res = requests.get(
        "https://api.xentr.ai/api/factories/[factory-slug]/machines",
        headers={"Authorization": f"Bearer {os.environ['XENTR_TOKEN']}"},
    )
    print(res.json())
    ```
  </Tab>
</Tabs>

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

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

## 4. What next? [#4-what-next]

<Cards>
  <Card icon="<Plug />" title="Connect a machine" href="/docs/guides/connect-machine">
    Stream live telemetry from the shop floor.
  </Card>

  <Card icon="<ClipboardList />" title="Create a work order" href="/docs/guides/work-orders">
    Dispatch production programmatically.
  </Card>

  <Card icon="<Code />" title="Browse the API" href="/docs/api-reference">
    Full reference, auto-generated from OpenAPI.
  </Card>

  <Card icon="<Webhook />" title="Webhooks" href="/docs/webhooks">
    Receive events when things happen.
  </Card>
</Cards>
