N1Developer docsv1

Machines · v1

QUERY

machines

Mock

Mock. This operation is part of the approved contract but its module is not built yet. Run Core with N1_API_MODE=mock N1_DEV_AUTH=stub to get deterministic demo-shop data from it. The real server answers NOT_IMPLEMENTED until it ships; the schema and examples here will not change when it does.

The shop’s machines, paged, filterable and searchable

The shop’s machines, paged. Search matches name and kind. Every role except accountant can read them.

POST/graphqlapp audience

Who can call this. Owner, admin, supervisor, operator, QC.

Headers

  • AuthorizationstringRequired

    Bearer <token>, issued for this endpoint's audience. The token decides the shop and roles; nothing in the request body can change them.

    Example: Bearer eyJhbGciOiJFZERTQSJ9…

  • Content-TypestringRequired

    Always application/json. Only POST is accepted.

    Example: application/json

  • X-Request-IdstringOptional

    Your id for this request (8–128 characters of A–Z a–z 0–9 . _ : -). Echoed back in the response header and in every error, so you can quote it when reporting a problem. Core makes one if you send none.

    Example: app-7f3c2a9e-checkout

Arguments

  • afterStringOptional

    endCursor of the previous page.

  • beforeStringOptional

    startCursor of the next page, when paging backwards.

  • filterMachineFilterOptional

    Narrow by status.

    Show children
  • firstIntOptional

    Page size, 1–100 (default 20).

    Example: 4

  • lastIntOptional

    Page size when paging backwards, 1–100.

  • searchStringOptional

    Free text, 1–100 characters.

  • sortMachineSortOptional

    Order (default: name, A to Z).

    Show children

Returns

  • machinesMachineConnection!Required

    The shop’s machines, paged. Search matches name and kind. Every role except accountant can read them.

    Show children
    • edges[MachineEdge!]!Required

      The rows on this page, in order.

      Example: [{"cursor":"WyJkcmlsbCBwcmVzcyAxIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDQwMDA2Il0","node":{"id":"0192f0c1-0000-7000-8000-000000d40006","name":"Drill Press 1","kind":"Drill press","status":"IDLE","currentAssignment":null}},{"cursor":"WyJncmluZGVyIDEiLCIwMTkyZjBjMS0wMDAwLTcwMDAtODAwMC0wMDAwMDBkNDAwMDciXQ","node":{"id":"0192f0c1-0000-7000-8000-000000d40007","name":"Grinder 1","kind":"Cylindrical grinder","status":"MAINTENANCE","currentAssignment":null}},{"cursor":"WyJsYXRoZSAxIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDQwMDAxIl0","node":{"id":"0192f0c1-0000-7000-8000-000000d40001","name":"Lathe 1","kind":"CNC lathe","status":"RUNNING","currentAssignment":{"qrValue":"JC-00001","operationName":"Milling","startedAt":"2026-10-12T00:30:00.000Z"}}},{"cursor":"WyJsYXRoZSAyIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDQwMDAyIl0","node":{"id":"0192f0c1-0000-7000-8000-000000d40002","name":"Lathe 2","kind":"CNC lathe","status":"RUNNING","currentAssignment":{"qrValue":"JC-00002","operationName":"Deburring","startedAt":"2026-10-10T21:30:00.000Z"}}}]

      Show children
      • cursorString!Required

        Opaque position of this row in the list.

        Example: "WyJkcmlsbCBwcmVzcyAxIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDQwMDA2Il0"

      • nodeMachine!Required

        The Machine.

        Example: {"id":"0192f0c1-0000-7000-8000-000000d40006","name":"Drill Press 1","kind":"Drill press","status":"IDLE","currentAssignment":null}

        Show children
        • codeString!Required

          code machine detail.

        • createdAtString!Required

          UTC time the machine was added.

        • currentAssignmentMachineAssignmentOptional

          The open assignment, or null when the machine is not running a job.

          Example: null

          Show children
          • idID!Required

            Stable id (UUIDv7).

          • jobCardIdID!Required

            The job card it belongs to.

          • jobOperationIdID!Required

            The step being run (JobOperation.id).

          • operationNameString!Required

            What the step does.

          • qrValueString!Required

            That job card’s QR text.

          • startedAtString!Required

            UTC time the machine was assigned.

        • currentWorkMachineWorkOptional

          Current work, or null.

          Show children
          • operatorString!Required

            Operator name.

          • titleString!Required

            Job title.

          • workOrderIdID!Required

            Order id.

        • idID!Required

          Stable id (UUIDv7).

          Example: "0192f0c1-0000-7000-8000-000000d40006"

        • kindString!Required

          What sort of machine it is, such as “CNC lathe”.

          Example: "Drill press"

        • locationString!Required

          location machine detail.

        • modelString!Required

          model machine detail.

        • nameString!Required

          The name the shop calls it, such as “Lathe 3”.

          Example: "Drill Press 1"

        • notesString!Required

          notes machine detail.

        • statusMachineStatus!Required

          What it is doing.

          Example: "IDLE"

          • IDLEFree to take a job operation.
          • MAINTENANCEOut of service. It cannot be assigned work.
          • RUNNINGHas an open assignment. Set by assignMachine and releaseMachine, never by hand.
        • typeMachineType!Required

          Machine category.

          • CNC_LATHECNC lathe.
          • CNC_MILLCNC mill.
          • INSPECTIONInspection.
          • LATHELathe.
          • PACKINGPacking.
          • WELDINGWelding.
        • updatedAtString!Required

          UTC time of the last change.

    • pageInfoPageInfo!Required

      Whether more pages exist, and the cursors to reach them.

      Example: {"hasNextPage":true,"hasPreviousPage":false,"endCursor":"WyJsYXRoZSAyIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDQwMDAyIl0"}

      Show children
      • endCursorStringOptional

        Cursor of the last row; pass it as after to get the next page. Null when the page is empty.

        Example: "WyJsYXRoZSAyIiwiMDE5MmYwYzEtMDAwMC03MDAwLTgwMDAtMDAwMDAwZDQwMDAyIl0"

      • hasNextPageBoolean!Required

        Whether another page follows this one.

        Example: true

      • hasPreviousPageBoolean!Required

        Whether another page comes before this one.

        Example: false

      • startCursorStringOptional

        Cursor of the first row; pass it as before to page backwards. Null when the page is empty.

    • totalCountInt!Required

      All rows matching the filter and search, not just this page.

      Example: 7

Errors

CodeHTTPWhen
VALIDATION_FAILED400Input failed Zod or route schema validation. details lists each field path and problem.
FORBIDDEN403Signed in, but the role or tenant does not allow the action.

Every error has the same body. See Errors.

Rate limit tier

Tier: per user. Over the limit you get RATE_LIMITED (HTTP 429) with a Retry-After header. See Response handling.

Search documentation

Search operations, types and errors from the generated contract.