{
  "info": {
    "_postman_id": "8c7e1b4a-3d6a-4a2f-9f5c-dirtfleet-public",
    "name": "DirtFleet REST API v1",
    "description": "Public DirtFleet REST API. Set the `apiKey` collection variable to your `dfk_…` token (issued at /settings → API keys). Every request authenticates via that variable.\n\nThe full machine-readable contract is at https://dirtfleet.app/openapi.yaml — this collection is a hand-curated, copy-pasteable subset for quick exploration.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{apiKey}}", "type": "string" }]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://dirtfleet.app",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "dfk_REPLACE_WITH_YOUR_KEY",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "Whoami (GET /api/v1/me)",
      "request": {
        "method": "GET",
        "header": [{ "key": "Accept", "value": "application/json" }],
        "url": {
          "raw": "{{baseUrl}}/api/v1/me",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "me"]
        },
        "description": "Returns the org + API key metadata associated with this key. Useful as a first request to confirm the key is wired up correctly."
      }
    },
    {
      "name": "List assets (GET /api/v1/assets)",
      "request": {
        "method": "GET",
        "header": [{ "key": "Accept", "value": "application/json" }],
        "url": {
          "raw": "{{baseUrl}}/api/v1/assets?limit=100",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "assets"],
          "query": [
            { "key": "limit", "value": "100" },
            { "key": "cursor", "value": "", "disabled": true }
          ]
        },
        "description": "Cursor-paginated. Required scope: `assets:read`."
      }
    },
    {
      "name": "List flags (GET /api/v1/flags)",
      "request": {
        "method": "GET",
        "header": [{ "key": "Accept", "value": "application/json" }],
        "url": {
          "raw": "{{baseUrl}}/api/v1/flags?severity=RED&limit=50",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "flags"],
          "query": [
            { "key": "severity", "value": "RED" },
            { "key": "status", "value": "OPEN", "disabled": true },
            { "key": "assetId", "value": "", "disabled": true },
            { "key": "limit", "value": "50" }
          ]
        },
        "description": "Defaults to `status=OPEN` when omitted. Required scope: `flags:read`."
      }
    },
    {
      "name": "Raise a flag (POST /api/v1/flags)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Accept", "value": "application/json" }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"assetId\": \"clx7asset_REPLACE_ME\",\n  \"severity\": \"RED\",\n  \"note\": \"Hydraulic leak — flagged from cab\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/flags",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "flags"]
        },
        "description": "Raises a YELLOW or RED flag. Push + email notifications fire identically to the in-app flow. Required scope: `flags:write`."
      }
    },
    {
      "name": "List hours logs (GET /api/v1/hours)",
      "request": {
        "method": "GET",
        "header": [{ "key": "Accept", "value": "application/json" }],
        "url": {
          "raw": "{{baseUrl}}/api/v1/hours?limit=100",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "hours"],
          "query": [
            { "key": "limit", "value": "100" },
            { "key": "assetId", "value": "", "disabled": true },
            { "key": "since", "value": "2026-05-01T00:00:00Z", "disabled": true },
            { "key": "cursor", "value": "", "disabled": true }
          ]
        },
        "description": "Cursor-paginated, newest-first. Optional `since` filter (ISO timestamp). Required scope: `hours:read`."
      }
    },
    {
      "name": "Log hours (POST /api/v1/hours)",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Accept", "value": "application/json" },
          {
            "key": "Idempotency-Key",
            "value": "{{$randomUUID}}",
            "description": "Optional. Retries with the same key return the original log id."
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"assetId\": \"clx7asset_REPLACE_ME\",\n  \"hoursReading\": 1342.7,\n  \"note\": \"End-of-shift reading\"\n}"
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/hours",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "hours"]
        },
        "description": "Logs a meter reading. Runs anomaly detection + AUTO_PM flagging server-side. Required scope: `hours:write`."
      }
    },
    {
      "name": "List work orders (GET /api/v1/work-orders)",
      "request": {
        "method": "GET",
        "header": [{ "key": "Accept", "value": "application/json" }],
        "url": {
          "raw": "{{baseUrl}}/api/v1/work-orders?priority=URGENT,HIGH&limit=50",
          "host": ["{{baseUrl}}"],
          "path": ["api", "v1", "work-orders"],
          "query": [
            { "key": "priority", "value": "URGENT,HIGH" },
            { "key": "status", "value": "OPEN,ASSIGNED,IN_PROGRESS,ON_HOLD", "disabled": true },
            { "key": "assignedToId", "value": "", "disabled": true },
            { "key": "limit", "value": "50" }
          ]
        },
        "description": "Defaults to the active queue (OPEN, ASSIGNED, IN_PROGRESS, ON_HOLD). Sorted by priority desc / due asc / created desc. Required scope: `workorders:read`."
      }
    }
  ]
}
