Get Notes by Step

Retrieves all step notes attached to a specific process step. Returns every note created at the given step across all serial numbers, providing a complete view of observations and defects recorded at a particular workstation or process stage.

This endpoint is used by the operator step view to display contextual notes alongside the parts currently at the step. It is also called internally by the step view API endpoint (GET /api/operator/step/:stepId) to include notes in the aggregated response.

Notes are returned in storage order (typically creation order).

Request

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe process step ID to query notes for (e.g. "step_001").

Response

200 OK

Returns an array of StepNote objects. May be empty if no notes exist for the step.

FieldTypeDescription
idstringUnique note identifier
jobIdstringJob ID the note belongs to
pathIdstringPath ID the note belongs to
stepIdstringStep ID (matches the queried :id parameter)
serialIdsstring[]Serial IDs this note applies to
textstringNote content
createdBystringUser ID of the note author
createdAtstringISO 8601 creation timestamp
pushedToJirabooleanWhether this note has been pushed to Jira
jiraCommentIdstring | undefinedJira comment ID if pushed

500 Internal Server Error

ConditionMessage
Database read failure"Internal Server Error"

Examples

Request

curl http://localhost:3000/api/notes/step/step_001

Response — Notes at a step

[
  {
    "id": "note_a1b2c3",
    "jobId": "job_abc123",
    "pathId": "path_xyz789",
    "stepId": "step_001",
    "serialIds": ["sn_00001", "sn_00002"],
    "text": "Minor surface blemish observed on batch, within tolerance.",
    "createdBy": "user_a1b2c3",
    "createdAt": "2024-01-15T10:30:00.000Z",
    "pushedToJira": false
  },
  {
    "id": "note_g7h8i9",
    "jobId": "job_abc123",
    "pathId": "path_xyz789",
    "stepId": "step_001",
    "serialIds": ["sn_00005"],
    "text": "Torque spec verified at 25 Nm.",
    "createdBy": "user_d4e5f6",
    "createdAt": "2024-01-15T14:00:00.000Z",
    "pushedToJira": true,
    "jiraCommentId": "10042"
  }
]

Response — No notes at step

[]

Notes

  • This endpoint does not validate that the step ID exists. Querying a non-existent step ID returns an empty array rather than a 404.
  • Notes from different jobs and paths can appear in the same response if they share the same step ID. In practice, step IDs are unique across the system (generated with step_ prefix + nanoid), so this only returns notes from the specific step instance.
  • The serialIds array on each note shows all serials the note applies to, not just those currently at the step. Serials may have advanced past the step since the note was created.
  • There is no pagination. All matching notes are returned in a single response.
  • This is the same data source used by the Step View endpoint, which includes notes in its aggregated response.