TECRID API · v1
Canonicalize. Sign.
Issue. Resolve.
Verified laboratories reserve identifiers and issue signed, private TECRIDs. The report owner controls public access to findings.
Fastest implementation path
Open the repository. Type integrate.
The checked-in Codex and Claude Code instructions inspect the target stack, create a secret-free setup outline, implement the smallest compatible connection, run tests, and leave a durable integration report. People retain control of identity, credentials, disclosure, deployment, and production writes.
01 / AUTHENTICATION
Bearer keys, scoped to one organization.
Create a key inside your authenticated dashboard, store it in a secret manager, and pass it in the Authorization header. TECRID displays each secret once and stores only its SHA-256 hash.
Authorization: Bearer tec_live_••••••••••••01A / ISSUER ONBOARDING
Five gates before production issuance.
A laboratory account begins unverified. ICS records legal identity and authority, accreditation or comparable competence evidence, the approved method and matrix scope, private-key control, and TECRID signing conformance as separate checks. The final approval endpoint remains locked until all five pass.
Key control and conformance use a single-use, 15-minute canonical challenge. The laboratory signs the exact UTF-8 payload with the Ed25519 private key corresponding to its submitted public JWK. Private keys never go to TECRID.
POST /api/issuer-application/key-challenge
POST /api/issuer-application/key-challenge/verify
Content-Type: application/json
{
"challengeId": "issuer_challenge_…",
"signature": "BASE64URL_ED25519_SIGNATURE"
}Successful challenge verification proves the key relationship and the required signing format. It does not approve laboratory identity, competence, or analytical scope; those remain independent ICS review decisions.
02 / CANONICALIZE
POST /api/v1/credentials/canonicalize
Normalizes the submitted evidence and returns the exact UTF-8 JSON string the laboratory must sign. Do not reserialize or reformat that string before signing.
curl https://tecrid.com/api/v1/credentials/canonicalize \
-H "Authorization: Bearer $TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tecrid": "TECRID·YOUR-LAB-26-XXXXXXXX",
"sampleName": "Organic cacao powder",
"lotNumber": "C-240518",
"matrix": "Food · Powder",
"method": "ICP-MS",
"submittingParty": "Example Brand",
"releasedAt": "2026-08-28",
"sourceDocument": {
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"filename": "laboratory-report.pdf",
"reportNumber": "LAB-240518"
},
"publish": true,
"results": [
{ "analyte": "Lead", "symbol": "Pb", "resultText": "42", "unit": "µg/kg", "loqText": "10" }
]
}'03 / ISSUE
POST /api/v1/credentials
Use publish: false to save a draft. The v1 field publish: true issues a private TECRID with the verified lab’s Ed25519 proof. Use visibility: "controlled" or omit visibility. Requests for visibility: "public" during issuance receive an authorization error.
For a historical PDF, include sourceDocument. Its SHA-256 fingerprint, report reference, submitting party, and release date become part of the signed payload; the private PDF itself is not exposed by the public API.
curl https://tecrid.com/api/v1/credentials \
-H "Authorization: Bearer $TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tecrid": "TECRID·YOUR-LAB-26-XXXXXXXX",
"sampleName": "Organic cacao powder",
"productSku": "CACAO-12OZ",
"lotNumber": "C-240518",
"matrix": "Food · Powder",
"method": "ICP-MS",
"submittingParty": "Example Brand",
"releasedAt": "2026-08-28",
"sourceDocument": {
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"filename": "laboratory-report.pdf",
"reportNumber": "LAB-240518"
},
"publish": true,
"proof": {
"keyId": "lab.example/key/2026-01",
"algorithm": "Ed25519",
"signature": "BASE64URL_SIGNATURE"
},
"results": [
{ "analyte": "Lead", "symbol": "Pb", "resultText": "42", "unit": "µg/kg", "loqText": "10" }
]
}'03B / BATCH
POST /api/v1/credentials/batch
Send up to 500 credential payloads in one call. Each item uses the same validation and Ed25519 signature check as a single issuance. The call can succeed for some items and fail for others. A repeated reportId or sampleId returns the existing TECRID and does not create a duplicate.
Limit: 500 credentials per call, 10 calls per minute for each laboratory, and a 2 MB JSON body. For 10,000 or more, split the work into chunks of 500. Retries are safe because the laboratory report or sample ID is the idempotency key. Set async to true when you want a job id you can read again. Each job is still one chunk of 500.
laboratorySite is compared with the sites on the certificate. A report from a site that is not covered is not labeled accredited. An analyte that is outside the accredited scope is still issued and marked Not on the accredited scope. TECRID does not decide whether a result is acceptable.
curl https://tecrid.com/api/v1/credentials/batch \
-H "Authorization: Bearer $TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"credentials": [
{
"tecrid": "TECRID·YOUR-LAB-26-YYYYYYYY",
"reportId": "LL-240518",
"sampleId": "S-240518",
"laboratorySite": "Ann Arbor, MI",
"sampleName": "Olive oil",
"lotNumber": "LOT-240518",
"matrix": "Olive oil",
"method": "ICP-MS",
"releasedAt": "2026-08-28",
"publish": true,
"sourceDocument": {
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"filename": "LL-240518.pdf",
"reportNumber": "LL-240518"
},
"proof": {
"keyId": "lab.example/key/2026-01",
"algorithm": "Ed25519",
"signature": "BASE64URL_SIGNATURE"
},
"results": [
{ "analyte": "Lead", "resultText": "0.02", "unit": "mg/kg" }
]
}
]
}'Each result is created, existing, or error with a reason. Read a stored chunk with GET /api/v1/credentials/batch/jobs/:jobId.
# 10,000 credentials: 20 files of 500. Pause after each 10 calls.
i=0
for f in chunks/chunk-*.json; do
curl -sS https://tecrid.com/api/v1/credentials/batch \
-H "Authorization: Bearer $TECRID_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @"$f"
i=$((i+1))
if [ $((i % 10)) -eq 0 ]; then sleep 60; fi
doneAdd "async": true next to the credentials array when you want HTTP 202 and a job id. Poll GET /api/v1/credentials/batch/jobs/:jobId with the same bearer key. The job still holds at most 500 credentials.
03A / REPORT MARK
Reserve. Render. Fingerprint. Sign. Finalize.
Reserve a TECRID, add the certificate mark to the final PDF, then hash that exact file and sign the structured report.
TECRID logo on certificates
On each new certificate, display the TECRID as plain text beside the official logo. Make the logo an HTTPS link to that report’s own record. In the reservation response, use reportMark.logo.imageUrl for the logo, reportMark.logo.href for its link, and reportMark.humanReadable for the printed ID.
Open the exported PDF and tap the logo before hashing or signing. The resolver shows the reservation until issuance and the issued record afterward. A link to a controlled record keeps the record’s existing access rules.
See the linked logo on the sample certificate or download the laboratory connector with the local PDF marking tool. Preserve issued and historical PDFs at their existing fingerprints.
POST /api/v1/report-reservations
curl https://tecrid.com/api/v1/report-reservations \
-H "Authorization: Bearer $LAB_TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"productName": "Organic cacao powder",
"productSku": "CACAO-12OZ",
"laboratoryReportNumber": "LAB-240518",
"idempotencyKey": "LAB-240518-r1",
"sourceSystem": "labware",
"routingToken": "tec_route_••••••••••••"
}'POST /api/v1/report-reservations/batch
Use a verified laboratory bearer key with reports:write. Send up to 25 reports per request, with a distinct idempotencyKey for each. Each response item contains its input index and either the reservation with its TECRID and report mark or an error. Resend the same keys and report details after an uncertain response to recover the same identifiers.
curl https://tecrid.com/api/v1/report-reservations/batch \
-H "Authorization: Bearer $LAB_TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"reports": [
{
"productName": "Extra virgin olive oil",
"productSku": "EVOO-250",
"laboratoryReportNumber": "LAB-1001",
"idempotencyKey": "LAB-1001-r1",
"routingToken": "tec_route_••••••••••••"
},
{
"productName": "Extra virgin olive oil",
"productSku": "EVOO-250",
"laboratoryReportNumber": "LAB-1002",
"idempotencyKey": "LAB-1002-r1",
"routingToken": "tec_route_••••••••••••"
}
]
}'Include the brand’s routing token for that SKU at reservation time to assign the report to its workspace. Both reservation routes support a token per report.
Templates can also use tecrid_logo_url, tecrid_logo_href, and tecrid_identifier from reportMark.templateFields. An optional QR code can use reportMark.qrData.
POST /api/v1/report-reservations/:id/finalize
curl https://tecrid.com/api/v1/report-reservations/$RESERVATION_ID/finalize \
-H "Authorization: Bearer $LAB_TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sampleName": "Organic cacao powder",
"productSku": "CACAO-12OZ",
"visibility": "controlled",
"publish": true,
"sourceDocument": {
"sha256": "SHA256_OF_FINAL_TECRID_MARKED_PDF",
"filename": "final-report.pdf",
"reportNumber": "LAB-240518"
},
"proof": {
"keyId": "lab.example/key/2026-01",
"algorithm": "Ed25519",
"signature": "BASE64URL_SIGNATURE"
},
"results": [
{ "analyte": "Lead", "resultText": "42", "unit": "µg/kg" }
]
}'For each printed report, canonicalize with its TECRID and final PDF SHA-256, sign the returned bytes, then finalize its reservation. Signed results stay private. With a routing token, the designated workspace receives the full findings and existing recipient grants still apply.
The brand or supplier owner can open the signed report from their workspace and choose Make results public. The owner approves one version at a time. A corrected version requires fresh approval.
04 / LIST
GET /api/v1/credentials
Returns up to 100 credentials for the organization associated with the bearer key, newest first.
curl https://tecrid.com/api/v1/credentials \ -H "Authorization: Bearer $TECRID_API_KEY"05 / RESOLVE
GET /api/v1/credentials/:identifier
Anyone with the identifier can check status. Findings, report details, and signed payloads stay gated until an owner releases the results. A read bearer key from the issuing laboratory or designated owner workspace can retrieve the full signed record.
curl https://tecrid.com/api/v1/credentials/TECRID%C2%B7YOUR-LAB-26-XXXXXXXX06 / CORRECT OR REVOKE
POST /api/v1/credentials/:tecrid/versions
Corrections and revocations append a signed version. First post the proposed revision to /:tecrid/canonicalize, sign the returned payload, then submit the same revision with its proof. After an owner releases corrected findings, authorized workspaces can still access the full signed history.
{
"action": "revoke",
"reason": "Sample identity could not be sustained after chain-of-custody review.",
"proof": {
"keyId": "lab.example/key/2026-01",
"algorithm": "Ed25519",
"signature": "BASE64URL_SIGNATURE"
}
}07 / CONTROLLED ROUTING
Issue once. Deliver only to active grants.
A brand or ingredient supplier can create a show-once tec_route_… token scoped to one SKU and one verified laboratory. The same token assigns the brand’s workspace even when it has no approved certifier, retailer, or government grants.
The laboratory can attach the token to controlled issuance. TECRID verifies the laboratory signature, finds the active recipient grants for that SKU, and freezes a separate fingerprinted view for each recipient.
curl https://tecrid.com/api/v1/credentials \
-H "Authorization: Bearer $LAB_TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tecrid": "TECRID·YOUR-LAB-26-XXXXXXXX",
"sampleName": "Organic cacao powder",
"productSku": "CACAO-12OZ",
"lotNumber": "C-240518",
"visibility": "controlled",
"publish": true,
"routingToken": "tec_route_••••••••••••",
"sourceDocument": {
"sha256": "SHA256_OF_FINAL_PDF",
"filename": "final-report.pdf",
"reportNumber": "LAB-240518"
},
"proof": {
"keyId": "lab.example/key/2026-01",
"algorithm": "Ed25519",
"signature": "BASE64URL_SIGNATURE"
},
"results": [
{ "analyte": "Lead", "resultText": "42", "unit": "µg/kg" }
]
}'POST /api/v1/routing/deliveries · retry without reissuing
curl https://tecrid.com/api/v1/routing/deliveries \
-H "Authorization: Bearer $BRAND_ROUTING_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "tecrid": "TECRID·LAB-26-000001" }'GET /api/v1/routing/deliveries · receive routed evidence
curl https://tecrid.com/api/v1/routing/deliveries \
-H "Authorization: Bearer $RECIPIENT_TECRID_API_KEY"The recipient response contains only deliveries in which its organization is a party. Revocation blocks future delivery; it does not erase a package already received and relied upon.
08 / CERTIFICATION INTAKE
POST /api/v1/certification/submissions
A certification organization creates a program-scoped intake secret in its dashboard and gives it to an applicant's system. The endpoint resolves every TECRID, blocks samples and incomplete authority, freezes each accepted public record version, and returns one package fingerprint.
curl https://tecrid.com/api/v1/certification/submissions \
-H "Authorization: Bearer $TECRID_INTAKE_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"applicantOrganization": "Example Brand",
"applicantName": "Quality Lead",
"applicantEmail": "quality@example.com",
"submissionReference": "CERT-2026-41",
"tecrids": ["TECRID·LAB-26-000001"]
}'The token begins tec_intake_, is displayed once, and is stored by TECRID only as a SHA-256 hash. Passing the intake gate does not award certification.
09 / LEGACY REPORTS
POST /api/v1/legacy-reports
Use private report intake in the owning workspace to submit an unchanged PDF to the named laboratory. The laboratory compares the findings with the PDF and signs the private TECRID. The workspace owner can then review and release the signed findings.
curl https://tecrid.com/api/v1/legacy-reports \
-H "Authorization: Bearer $BRAND_TECRID_API_KEY" \
-F "document=@report.pdf;type=application/pdf" \
-F "laboratoryName=Example Analytical" \
-F "confirmationEmail=quality@example-lab.com" \
-F "sampleName=Organic cacao powder" \
-F 'results=[{"analyte":"Lead","resultText":"42","unit":"µg/kg"}]' \
-F "attested=on"09A / BACKFILL
POST /api/v1/legacy-reports/batch
A verified laboratory can import past reports as a JSON manifest, a CSV manifest, or PDF URLs plus SHA-256. The original report date is kept, and the record is marked backfilled. The same PDF SHA-256 returns the existing record. The response includes the exact canonical payload to sign. Add that signature on a retry, or post the returned credential to the batch issuance endpoint.
Limit: 25 reports per call, 20 MB per PDF, and 10 calls per minute for each laboratory. For a larger history, send the next chunk. PDF URLs must be public https addresses.
curl https://tecrid.com/api/v1/legacy-reports/batch \
-H "Authorization: Bearer $TECRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"reportId": "LL-2024-100",
"sampleId": "S-100",
"sampleName": "Olive oil",
"originalReportDate": "2024-03-15",
"laboratorySite": "Ann Arbor, MI",
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"filename": "LL-2024-100.pdf",
"pdfUrl": "https://reports.example/LL-2024-100.pdf",
"results": [
{ "analyte": "Lead", "resultText": "0.01", "unit": "mg/kg" }
]
}
]
}'curl https://tecrid.com/api/v1/legacy-reports/batch \
-H "Authorization: Bearer $TECRID_API_KEY" \
-F "manifest=@manifest.json;type=application/json" \
-F "document=@LL-2024-100.pdf;type=application/pdf"A CSV manifest uses one row per analyte and groups rows that share a sha256. Columns: reportId,sampleId,sampleName,originalReportDate,laboratorySite,sha256,filename,pdfUrl,lotNumber,matrix,method,analyte,resultText,unit.
10 / INSIGHTS
GET /api/v1/insights
Returns deterministic summaries across TECRIDs the organization issued or was authorized to receive: distinct records, result rows, SKU coverage, analyte counts, missing requested analytes, and the exact source TECRID behind every latest value. It does not infer safety, compliance, or comparability across units or methods.
11 / CONNECTOR PROFILES
Start with a report-release hook, not a LIMS replacement.
The TECRID Connect starter includes configuration profiles for LabWare, LabVantage, and STARLIMS plus generic JSON and CSV. These profiles map each system's release event and report-template fields to the same reserve/finalize protocol. They are implementation starters, not vendor-certified integrations.
Open the public TECRID Connect repository ↗
Read the versioned TECRID specification and JSON Schemas ↗
Cite the TECRID Specification v0.1.0 on Zenodo ↗
Reference the TECRID Specification across all versions ↗
The repository is the canonical starting point for labs, brands, suppliers, retailers, and certification programs. It includes role-specific setup, report reservation and finalization examples, connector profiles, signing utilities, and deployment-safe environment guidance. A versioned ZIP remains available for offline review.
Download the current ZIP snapshot →
Outbound email is not yet a production claim. In-product notifications and controller receipts are live; email delivery still requires a configured sending provider and deliverability controls.
12 / ERRORS
Stable, inspectable responses.
400invalid_requestRequired fields, result structure, revision reason, or proof shape is invalid. A batch above 500 credentials or a backfill above 25 reports is rejected before any item is written.
403not_authorizedThe API key, issuer authority, reviewed signing key, or signature verification failed.
404not_foundNo public TECRID matches the identifier.
429rate_limitedThe laboratory sent more batch or backfill calls than the limit. Wait and retry. Repeated report IDs, sample IDs, and PDF fingerprints return the existing record.