N1Developer docsv1

Job cards · v1

MUTATION

assignJobOperation

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.

Give one step of a job card to an operator

Give a step of a job card to an operator. Owner, admin and supervisor. JOB_OPERATION_NOT_FOUND for an unknown step, USER_NOT_FOUND for an unknown user, VALIDATION_FAILED if the user is inactive, is not an operator, or the step is already done.

POST/graphqlapp audience

Who can call this. Owner, admin, supervisor.

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

  • Idempotency-KeystringRequired

    A key you generate once per user action (a UUID). Retrying with the same key never applies the change twice.

    Example: 0192f0c1-9b2a-7d40-8c3e-1f5a6b7c8d9e

  • 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

  • operationIdID!Required

    The step (JobOperation.id).

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

  • operatorIdID!Required

    The operator (User.id).

    Example: "0192f0c1-0000-7000-8000-0000000000a6"

Returns

  • assignJobOperationJobCard!Required

    Give a step of a job card to an operator. Owner, admin and supervisor. JOB_OPERATION_NOT_FOUND for an unknown step, USER_NOT_FOUND for an unknown user, VALIDATION_FAILED if the user is inactive, is not an operator, or the step is already done.

    Show children
    • createdAtString!Required

      UTC time the card was made.

      Example: "2026-09-04T05:00:00.000Z"

    • customerNameString!Required

      The customer’s name.

      Example: "Bharat Hydraulics 2"

    • dueDateString!Required

      The order’s promised date, YYYY-MM-DD in the shop’s timezone.

      Example: "2026-10-02"

    • idID!Required

      Stable id (UUIDv7).

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

    • lastActivityAtString!Required

      UTC time anything on the card last moved. “Stuck” is measured from here.

      Example: "2026-10-12T04:30:00.000Z"

    • operations[JobOperation!]!Required

      The steps, in order.

      Example: [{"id":"0192f0c1-0000-7000-8000-000000d300e7","seq":1,"name":"Threading","status":"PENDING","operatorId":"0192f0c1-0000-7000-8000-0000000000a5","operatorName":"Esha Demo","machineId":null,"machineName":null,"startedAt":null,"endedAt":null},{"id":"0192f0c1-0000-7000-8000-000000d300e8","seq":2,"name":"Deburring","status":"PENDING","operatorId":"0192f0c1-0000-7000-8000-0000000000a6","operatorName":"Farid Demo","machineId":null,"machineName":null,"startedAt":null,"endedAt":null},{"id":"0192f0c1-0000-7000-8000-000000d300e9","seq":3,"name":"Finishing","status":"PENDING","operatorId":null,"operatorName":null,"machineId":null,"machineName":null,"startedAt":null,"endedAt":null}]

      Show children
      • endedAtStringOptional

        UTC time the step finished.

        Example: null

      • idID!Required

        Stable id (UUIDv7).

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

      • machineIdIDOptional

        The machine it runs on, if one is assigned.

        Example: null

      • machineNameStringOptional

        That machine’s name.

        Example: null

      • nameString!Required

        What the step does.

        Example: "Threading"

      • operatorIdIDOptional

        The operator it is assigned to, if any.

        Example: "0192f0c1-0000-7000-8000-0000000000a5"

      • operatorNameStringOptional

        That operator’s name.

        Example: "Esha Demo"

      • seqInt!Required

        Order of the step, from 1.

        Example: 1

      • startedAtStringOptional

        UTC time the step started.

        Example: null

      • statusJobOperationStatus!Required

        Where the step is.

        Example: "PENDING"

        • DONEFinished.
        • PENDINGNot started.
        • RUNNINGBeing worked on now.
    • orderIdID!Required

      The order (see order).

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

    • orderLineIdID!Required

      The order line it was made for.

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

    • partString!Required

      Part name or number.

      Example: "Valve Body"

    • poNumberString!Required

      The order’s PO number.

      Example: "PO-2026-0002"

    • qrValueString!Required

      The text printed as a QR code on the card. Unique in the shop; jobCardByQr resolves it.

      Example: "JC-00005"

    • quantityInt!Required

      Pieces to make.

      Example: 140

    • statusJobCardStatus!Required

      Worked out from the operations.

      Example: "QUEUED"

      • DONEEvery operation is done.
      • IN_PROGRESSAt least one operation has started and not every one is done.
      • QUEUEDNo operation has started.

Errors

CodeHTTPWhen
JOB_OPERATION_NOT_FOUND404The operation id is unknown in this shop (another shop's ids answer the same).
USER_NOT_FOUND404The id is unknown in this shop (another shop's ids answer the same).
VALIDATION_FAILED400Input failed Zod or route schema validation. details lists each field path and problem.
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.