Get Certificate Attachments

Retrieves all attachment records for a specific certificate. Each record shows which serial number has this certificate attached, at which process step the attachment was made, when it happened, and who performed it.

This endpoint is useful for auditing certificate coverage — for example, verifying that every serial in a production batch has a required material certification attached, or reviewing which process steps a particular certification was recorded at.

Request

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the certificate (e.g. "cert_abc123")

Response

200 OK

Returns an array of CertAttachment objects for the specified certificate. If the certificate exists but has no attachments, returns an empty array [].

FieldTypeDescription
idstring | undefinedServer-generated attachment ID, if assigned
serialIdstringThe serial number this attachment belongs to
certIdstringThe certificate ID (matches the path parameter)
stepIdstringThe process step ID where the attachment was recorded
attachedAtstringISO 8601 timestamp of when the attachment was created
attachedBystringThe user ID who performed the attachment

404 Not Found

Returned when no certificate exists with the given ID.

ConditionMessage
Certificate does not exist"Certificate not found: cert_abc123"

500 Internal Server Error

Returned if an unhandled error occurs while querying the database.

ConditionMessage
Database read failure"Internal Server Error"

Examples

Request

curl http://localhost:3000/api/certs/cert_abc123/attachments

Response — Multiple attachments across different steps

[
  {
    "id": "ca_001",
    "serialId": "sn_001",
    "certId": "cert_abc123",
    "stepId": "step_a1",
    "attachedAt": "2024-01-15T10:30:00.000Z",
    "attachedBy": "user_xyz"
  },
  {
    "id": "ca_002",
    "serialId": "sn_002",
    "certId": "cert_abc123",
    "stepId": "step_a1",
    "attachedAt": "2024-01-15T10:30:00.000Z",
    "attachedBy": "user_xyz"
  },
  {
    "id": "ca_003",
    "serialId": "sn_005",
    "certId": "cert_abc123",
    "stepId": "step_b2",
    "attachedAt": "2024-01-16T08:00:00.000Z",
    "attachedBy": "user_abc"
  }
]

Response — No attachments

[]

Notes

  • This endpoint returns attachments for a single certificate across all serials. To see all certificates attached to a single serial, use the serial detail endpoint instead.
  • The stepId in each attachment record indicates where in the manufacturing route the certificate was attached. Different serials may have the same certificate attached at different steps if they were at different points in the route when the attachment was made.
  • Attachments are immutable — once created, they cannot be modified or deleted. This ensures the audit trail remains intact.
  • The response is not paginated. For certificates attached to a very large number of serials, the response may be large.