> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nearnode.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Fleet Management

> Deploy, track, and manage physical assets at scale with Batches and Templates.

Fleet Management is how NearNode scales from 10 nodes to 100,000. Instead of creating nodes one by one, you generate them in **Batches** — with sequential serial IDs, shared configurations, and group-level lifecycle tracking.

<Info>
  **Ops Tip:** You can create and manage batches entirely from the Dashboard under **Fleet**. The batch wizard walks you through configuration, preview, and generation.
</Info>

## Creating a Batch

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://nearnode.io/api/v1/batches \
    -H "Authorization: Bearer sk_live_..." \
    -H "Content-Type: application/json" \
    -d '{
      "label": "Q1 2026 Business Cards",
      "prefix": "VID-2026",
      "quantity": 100,
      "function_type": "vcard",
      "base_payload": {
        "organization": "VidiAI",
        "website": "https://vidiai.ch"
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://nearnode.io/api/v1/batches', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer sk_live_...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      label: 'Q1 2026 Business Cards',
      prefix: 'VID-2026',
      quantity: 100,
      function_type: 'vcard',
      base_payload: {
        organization: 'VidiAI',
        website: 'https://vidiai.ch',
      },
    }),
  });

  const { data } = await response.json();
  console.log(`Batch ${data.id} — ${data.quantity} nodes queued`);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://nearnode.io/api/v1/batches",
      headers={"Authorization": "Bearer sk_live_..."},
      json={
          "label": "Q1 2026 Business Cards",
          "prefix": "VID-2026",
          "quantity": 100,
          "function_type": "vcard",
          "base_payload": {
              "organization": "VidiAI",
              "website": "https://vidiai.ch",
          },
      },
  )

  data = response.json()["data"]
  print(f"Batch {data['id']} — {data['quantity']} nodes queued")
  ```
</CodeGroup>

This generates 100 nodes with serial IDs `VID-2026-001` through `VID-2026-100`. Each node gets a unique slug and permanent scan URL.

<Note>
  A single batch can generate up to **500 nodes**. Need more? Create multiple batches with sequential prefixes (`VID-2026-A`, `VID-2026-B`, etc.).
</Note>

## Batch Lifecycle

Every batch moves through a tracked lifecycle. Status transitions are logged automatically.

<Steps>
  <Step title="Pending">
    Batch created, configuration saved. Nodes not yet generated.
  </Step>

  <Step title="Generating">
    Node generation in progress. Slugs and serial IDs are being assigned.
  </Step>

  <Step title="Ready">
    All nodes generated. Awaiting hardware write (NFC encoding or QR printing).
  </Step>

  <Step title="Writing">
    NFC tags are being written via the [Writer module](/features/nfc-writer). Progress tracked per-node.
  </Step>

  <Step title="Deployed">
    All tags written and verified. Batch is fully deployed in the field.
  </Step>
</Steps>

<Warning>
  If generation fails (e.g., duplicate prefix conflict), the batch moves to `failed` status. No partial batches are created — it's all or nothing.
</Warning>

## CSV Manifest

After generation, download the CSV manifest for your printing or encoding workflow:

```csv theme={null}
serial_id,slug,url,status
VID-2026-001,k9m2xp4q,https://nearnode.io/v/k9m2xp4q,active
VID-2026-002,r3n7yb8w,https://nearnode.io/v/r3n7yb8w,active
VID-2026-003,m5t8zc2v,https://nearnode.io/v/m5t8zc2v,active
...
```

<Tip>
  Import the manifest directly into your NFC writing tool or QR code generator. The `url` column contains the complete scan URL ready for encoding.
</Tip>

## Templates

Bind a batch to a **Template** to enforce brand consistency across all generated nodes. Templates define default payload values and **locked fields** that cannot be overridden at the individual node level.

| Concept          | Description                                                           |
| ---------------- | --------------------------------------------------------------------- |
| `base_payload`   | Default values applied to every node in the batch                     |
| `locked_fields`  | Fields that editors cannot override (e.g., `organization`, `website`) |
| Template binding | Applied at generation time — cannot be changed after                  |

<Info>
  **Ops Tip:** Templates are managed under **Templates** in the Dashboard. Create a "Corporate vCard" template once, then reuse it across every batch.
</Info>

## Use Cases

<CardGroup cols={2}>
  <Card title="Business Cards" icon="address-card">
    Generate vCard nodes for an entire team. Each card gets a unique slug but shares the company template.
  </Card>

  <Card title="Event Badges" icon="id-badge">
    Deploy 500 NFC badges for a conference. Route to check-in during the event, post-event surveys after.
  </Card>

  <Card title="Product Packaging" icon="box">
    Embed QR codes in packaging that link to manuals, warranty registration, or authenticity verification.
  </Card>

  <Card title="Asset Tracking" icon="barcode">
    Tag equipment, vehicles, or inventory. Scan to view maintenance history, location logs, or documentation.
  </Card>
</CardGroup>
