Get Certificate

Retrieves a single certificate by its unique identifier. Use this endpoint to fetch the full details of a specific certificate, including its type, name, and any metadata that was stored at creation time.

This is commonly used when displaying certificate detail views, or when you need to verify a certificate exists before performing a batch attachment operation.

Request

Path Parameters

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

Response

200 OK

Returns the Certificate object matching the provided ID.

FieldTypeDescription
idstringUnique identifier for the certificate
type'material' | 'process'Classification of the certificate
namestringHuman-readable name or identifier
metadataRecord<string, unknown> | undefinedOptional free-form metadata object
createdAtstringISO 8601 timestamp of when the certificate was created

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

Response — Material certificate with metadata

{
  "id": "cert_abc123",
  "type": "material",
  "name": "Steel Alloy 4140 Mill Cert",
  "metadata": {
    "grade": "4140",
    "supplier": "MetalCo",
    "lotNumber": "LOT-2024-0042",
    "expirationDate": "2025-01-15"
  },
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Request — Process certificate without metadata

curl http://localhost:3000/api/certs/cert_def456

Response — Process certificate

{
  "id": "cert_def456",
  "type": "process",
  "name": "Operator Welding Qualification — J. Smith",
  "createdAt": "2024-01-16T08:00:00.000Z"
}

Notes

  • The id parameter is taken from the URL path. It must match an existing certificate exactly.
  • The metadata field is only present in the response if it was provided when the certificate was created.
  • Certificates are immutable after creation — the data returned by this endpoint will never change.