API Reference

The Nexshift API gives you read-only access to your operational data. Use it to build dashboards, connect to Power BI, or integrate with your other business systems.

Paid Add-On โ€” $300/month

Overview

The Nexshift API is a REST API that returns JSON. All endpoints are read-only โ€” data can only be written through the Nexshift application.

All data returned is scoped to your company. You cannot access data from other companies with your API key.

Authentication

All API requests must include your API key in the Authorization header:

Authorization: Bearer nxs_your_api_key_here

API keys are provided by Nexshift when your account is set up. Contact your Nexshift account manager if you need a new key or need to revoke an existing one.

Keep your API key secret. Do not include it in client-side code or commit it to version control. If a key is compromised, revoke it immediately and generate a new one.

Power BI and Excel

When connecting from Power BI or Excel Power Query, set the authentication type to Anonymous in the credentials dialog. Pass your API key via the Authorization header directly in the Power Query code:

= Web.Contents(
    "https://yourcompany.nexshift.app/api/v1/production/runs",
    [
        Headers = [
            #"Authorization" = "Bearer nxs_your_api_key_here"
        ]
    ]
)

Then pipe the result through Json.Document() to parse the response and expand the table as needed.

Base URL

All API requests are made to your company subdomain:

https://yourcompany.nexshift.app/api/v1

Example request

curl https://yourcompany.nexshift.app/api/v1/production/runs \
  -H "Authorization: Bearer nxs_your_api_key_here" \
  -H "Content-Type: application/json"

Production

GET /api/v1/production/runs
Returns completed production runs. Includes output, scrap, downtime events, and OEE metrics per run.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date. Filter runs started on or after this date. Example: 2026-01-01
tostringISO 8601 date. Filter runs started on or before this date.
site_idstringFilter by site UUID.
machine_idstringFilter by machine UUID.
limitnumberMaximum records to return. Default 500, maximum 1000.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "id": "uuid",
      "started_at": "2026-03-26T00:21:16Z",
      "ended_at": "2026-03-26T02:21:29Z",
      "status": "completed",
      "setup_duration_seconds": 720,
      "running_at": "2026-03-26T00:33:16Z",
      "units_produced": 9700,
      "target_quantity": 10000,
      "batch_number": "123456",
      "machine": { "id": "uuid", "name": "Auto 3", "uom": "bags" },
      "site": { "id": "uuid", "name": "Main Plant", "location": "Brisbane, QLD" },
      "product": { "id": "uuid", "sku": "BUPB", "description": "Product description" },
      "operator": { "id": "uuid", "full_name": "Jane Smith" },
      "scrap": [
        { "id": "uuid", "units": 20, "reason": "Defective packaging", "timestamp": "..." }
      ],
      "downtime": [
        {
          "id": "uuid",
          "started_at": "2026-03-26T01:10:00Z",
          "ended_at": "2026-03-26T01:30:00Z",
          "duration_minutes": 20,
          "category": "Mechanical",
          "reason": "Conveyor jam"
        }
      ],
      "oee": {
        "availability": 83.4,
        "performance": 100.0,
        "quality": 99.8,
        "overall": 83.2
      }
    }
  ],
  "meta": { "from": "2026-03-01", "to": "2026-03-31", "count": 1 }
}
GET /api/v1/production/oee
Returns OEE summary aggregated by machine over the specified date range. Useful for trend analysis and dashboards.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date.
tostringISO 8601 date.
site_idstringFilter by site UUID.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "machine_id": "uuid",
      "machine_name": "Auto 3",
      "site_id": "uuid",
      "site_name": "Main Plant",
      "total_runs": 42,
      "total_units": 385000,
      "total_target": 420000,
      "attainment_pct": 91.7,
      "availability_pct": 88.2
    }
  ],
  "meta": { "from": "2026-01-01", "to": "2026-03-31" }
}

Quality

GET /api/v1/quality/results
Returns quality check logs with pass/fail results for each inspection.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date. Filter checks on or after this date.
tostringISO 8601 date.
site_idstringFilter by site UUID.
machine_idstringFilter by machine UUID.
passedbooleanFilter by pass/fail status. true or false.
limitnumberMaximum records. Default 500, maximum 1000.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "id": "uuid",
      "checked_at": "2026-03-26T09:15:00Z",
      "passed": true,
      "notes": null,
      "machine": { "id": "uuid", "name": "Auto 3" },
      "site": { "id": "uuid", "name": "Main Plant" },
      "template": { "id": "uuid", "name": "Packaging Inspection" },
      "logged_by": { "id": "uuid", "full_name": "Jane Smith" }
    }
  ],
  "meta": { "from": "2026-03-01", "to": "2026-03-31", "count": 1 }
}

Maintenance

GET /api/v1/maintenance/downtime
Returns asset downtime events logged against the asset register.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date.
tostringISO 8601 date.
site_idstringFilter by site UUID.
is_openbooleanFilter open or closed downtime events.
limitnumberMaximum records. Default 500, maximum 1000.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "id": "uuid",
      "started_at": "2026-03-26T08:00:00Z",
      "ended_at": "2026-03-26T08:45:00Z",
      "duration_minutes": 45,
      "is_open": false,
      "reason": "Gearbox failure",
      "asset": {
        "id": "uuid",
        "name": "Conveyor Belt A",
        "asset_number": "EQ-001",
        "category": "Conveyor"
      },
      "site": { "id": "uuid", "name": "Main Plant" }
    }
  ],
  "meta": { "from": "2026-03-01", "to": "2026-03-31", "count": 1 }
}

Safety

GET /api/v1/safety/incidents
Returns safety incidents with severity, status, and location details.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date. Filter incidents on or after this date.
tostringISO 8601 date.
site_idstringFilter by site UUID.
statusstringFilter by status: reported, under_investigation, corrective_actions_open, closed.
severitystringFilter by severity level.
limitnumberMaximum records. Default 500, maximum 1000.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "id": "uuid",
      "reference_number": "INC-2026-001",
      "title": "Slip hazard near packaging line",
      "severity": "minor",
      "status": "closed",
      "occurred_at": "2026-03-15T14:30:00Z",
      "location": "Packaging area",
      "site": { "id": "uuid", "name": "Main Plant" }
    }
  ],
  "meta": { "from": "2026-01-01", "to": "2026-03-31", "count": 1 }
}

Batching

GET /api/v1/batching/batches
Returns bulk batch records for sites running in Bulk Batch mode. Includes full ingredient usage and supplier batch codes per batch. Both standard and formulation batches are returned.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date. Filter batches created on or after this date.
tostringISO 8601 date.
site_idstringFilter by site UUID.
limitnumberMaximum records. Default 500, maximum 1000.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "id": "uuid",
      "batch_number": "BB-2026-0001",
      "total_qty": 150,
      "qty_uom": "kg",
      "notes": null,
      "created_at": "2026-04-12T22:07:09Z",
      "site_id": "uuid",
      "site_name": "Main Plant",
      "recipe_id": "uuid",
      "recipe_code": "SKU-001",
      "recipe_name": "Product Name",
      "recipe_version": 1,
      "is_formulation": false,
      "ingredients": [
        {
          "id": "uuid",
          "material_id": "uuid",
          "material_code": "RM-001",
          "material_name": "Raw Material Name",
          "qty_used": 75,
          "uom": "kg",
          "supplier_batch": "SUP-BATCH-001"
        }
      ]
    }
  ],
  "meta": { "count": 1, "from": null, "to": null }
}
GET /api/v1/batching/ingredient-logs
Returns ingredient log entries for sites running in Simple Log mode. Each record represents a single ingredient logged against a production run, including supplier batch code and traceability back to the machine, product, and recipe.

Query parameters

ParameterTypeDescription
fromstringISO 8601 date. Filter logs on or after this date.
tostringISO 8601 date.
site_idstringFilter by site UUID.
limitnumberMaximum records. Default 500, maximum 1000.

Response

{
  "company": "Acme Manufacturing",
  "data": [
    {
      "id": "uuid",
      "logged_at": "2026-04-09T20:15:01Z",
      "site_id": "uuid",
      "site_name": "Main Plant",
      "machine_id": "uuid",
      "machine_name": "Extruder 1",
      "product_sku": "SKU-001",
      "product_description": "Product Name",
      "run_id": "uuid",
      "batch_number": "0001",
      "recipe_id": "uuid",
      "recipe_code": "SKU-001",
      "recipe_name": "Recipe Name",
      "material_id": "uuid",
      "material_code": "RM-001",
      "material_name": "Raw Material Name",
      "qty_used": 0.15,
      "uom": "kg",
      "supplier_batch": "SUP-BATCH-001"
    }
  ],
  "meta": { "count": 1 }
}

Errors

The API uses standard HTTP status codes.

StatusMeaning
200Success
401Missing or invalid API key
403API key does not have access to the requested resource
429Rate limit exceeded
500Internal server error

Error responses include a JSON body with a message field explaining the error:

{ "error": "Invalid or missing API key" }
Need help? Contact us at [email protected] if you have questions about the API or need help with an integration.