Check

Compliance verification and analysis runs

The Check endpoints verify whether your project documents satisfy specific requirements. Two approaches: quick single-requirement verification, or structured multi-requirement audit runs.


POST /api/v2/check/verify

Verify a single compliance requirement. Synchronous — returns a verdict immediately. Can take up to 5 minutes for complex requirements.

Authentication: Bearer token required

Request body:

FieldTypeRequiredDescription
project_iduuidYesProject to check against
requirementstringYesThe requirement to verify (max 5,000 characters)
handbook_idsuuid[]NoLimit check to specific handbooks. Omit to use all project knowledge

Example request:

curl -X POST https://api.pyramid-ai.com/api/v2/check/verify \
-H "Authorization: Bearer pai_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "7f9c8d2a-1b3e-4c5d-8e9f-0a1b2c3d4e5f",
"requirement": "All electrical installations must comply with AS/NZS 3000 wiring standards"
}'

Example response 200 OK:

{
"success": true,
"data": {
"verdict": "COMPLIANT",
"confidence": 0.92,
"evidence": "Section 4.2 of the Electrical Safety Specification states: 'All wiring installations shall comply with AS/NZS 3000:2018 including amendments.'",
"explanation": "The project documentation explicitly references compliance with AS/NZS 3000 in the Electrical Safety Specification. The specification mandates that all subcontractors certify their work against this standard.",
"recommendation": null,
"sources": [
{
"handbook_id": "hb-uuid-1",
"node_id": "node-uuid-1",
"title": "Electrical-Safety-Specification.pdf",
"start_page": 8,
"end_page": 9
}
],
"handbook": {
"id": "hb-uuid-1",
"name": "Electrical Safety Specification"
}
},
"request_id": "..."
}

Response fields:

FieldTypeDescription
verdictstringCOMPLIANT, CONTRADICTS, or NOT_FOUND
confidencenumberHow certain the AI is (0 to 1). Below 0.7 suggests insufficient evidence
evidencestringVerbatim quote from the source document supporting the verdict
explanationstringPlain-language reasoning for the decision
recommendationstring | nullSuggested action if non-compliant. Null if compliant
sourcesarrayDocuments and pages referenced
sources[].titlestringSource document name
sources[].start_pageinteger | nullStarting page of the relevant section
sources[].end_pageinteger | nullEnding page of the relevant section
handbookobjectWhich handbook was checked against

Verdict values:

VerdictMeaning
COMPLIANTRequirement is satisfied by project documentation
CONTRADICTSProject documentation contradicts the requirement
NOT_FOUNDNo evidence for or against — documents may not cover this topic

POST /api/v2/check/runs

Create a compliance check run. Define a set of requirements to check as a batch. Does not start processing — call the trigger endpoint when ready.

Authentication: Bearer token required

Request body:

FieldTypeRequiredDescription
project_iduuidYesProject to check against
namestringYesRun name (e.g., “Q2 2026 Fire Safety Audit”)
requirementsarrayYesArray of requirement objects (1–1,000)
requirements[].textstringYesRequirement text (max 5,000 characters)
requirements[].metadataobjectNoOptional metadata
handbook_idsuuid[]NoLimit check to specific handbooks

Example request:

curl -X POST https://api.pyramid-ai.com/api/v2/check/runs \
-H "Authorization: Bearer pai_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "7f9c8d2a-1b3e-4c5d-8e9f-0a1b2c3d4e5f",
"name": "Q2 2026 Fire Safety Audit",
"requirements": [
{"text": "The site must have a documented fire safety plan"},
{"text": "Fire extinguishers must be inspected monthly"},
{"text": "Emergency evacuation routes must be posted on every floor"},
{"text": "Fire drills must be conducted quarterly"}
]
}'

Example response 201 Created:

{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Q2 2026 Fire Safety Audit",
"org_id": "iPwoNDP1ribwqCTkvlEyiA6DtGZdYe0k",
"project_id": "7f9c8d2a-1b3e-4c5d-8e9f-0a1b2c3d4e5f",
"status": "pending",
"total_requirements": 4,
"processed_requirements": 0,
"passed_requirements": 0,
"failed_requirements": 0,
"created_at": "2026-05-22T10:00:00Z",
"updated_at": "2026-05-22T10:00:00Z"
},
"request_id": "..."
}

POST /api/v2/check/runs/{id}/trigger

Start processing a check run. The system works through each requirement, checking it against project documents.

Authentication: Bearer token required

Path parameters:

ParameterTypeDescription
iduuidRun ID

Request body:

FieldTypeRequiredDescription
reprocessbooleanNoRe-check requirements that were already completed (default false)
skip_breakdownbooleanNoSkip sub-requirement breakdown for faster results (default false)

Example request:

curl -X POST https://api.pyramid-ai.com/api/v2/check/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/trigger \
-H "Authorization: Bearer pai_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{}'

Example response 200 OK:

{
"success": true,
"data": {
"run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"task_id": "task_xyz789",
"status": "processing"
},
"request_id": "..."
}

Error responses:

StatusCodeWhen
409CONFLICTRun is already being processed

GET /api/v2/check/runs

List all compliance check runs. Supports pagination.

Authentication: Bearer token required

Query parameters:

ParameterTypeDefaultDescription
project_iduuidFilter by project
limitinteger50Maximum results (max 200)
offsetinteger0Results to skip

GET /api/v2/check/runs/{id}

Get a check run with full results, including all requirements and their verdicts.

Authentication: Bearer token required

Path parameters:

ParameterTypeDescription
iduuidRun ID

Example response 200 OK:

{
"success": true,
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Q2 2026 Fire Safety Audit",
"status": "completed",
"total_requirements": 4,
"processed_requirements": 4,
"passed_requirements": 3,
"failed_requirements": 1,
"processing_started_at": "2026-05-22T10:01:00Z",
"processing_completed_at": "2026-05-22T10:04:30Z",
"requirements": [
{
"id": "req-uuid-1",
"run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"text": "The site must have a documented fire safety plan",
"order_index": 0,
"status": "completed",
"sub_requirements": []
}
]
},
"request_id": "..."
}

Run status values:

StatusMeaning
pendingCreated but not yet triggered
processingCurrently checking requirements
completedAll requirements checked
stoppedManually stopped before completion
failedProcessing failed (system error)

GET /api/v2/check/runs/{id}/requirements

Get the individual requirement-level results from a run. Each requirement includes its verdict, sub-requirements, and evidence.

Authentication: Bearer token required

Path parameters:

ParameterTypeDescription
iduuidRun ID

Example response 200 OK:

{
"success": true,
"data": [
{
"id": "req-uuid-1",
"run_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"text": "The site must have a documented fire safety plan",
"order_index": 0,
"status": "completed",
"sub_requirements": [
{
"id": "subreq-uuid-1",
"requirement_id": "req-uuid-1",
"text": "A fire safety plan document must exist",
"justification": "The Safety Management Plan (Section 3.1) includes a comprehensive fire safety plan...",
"score": 0.94,
"status": "comply",
"sources": null
}
],
"created_at": "2026-05-22T10:00:00Z",
"updated_at": "2026-05-22T10:03:00Z"
}
],
"request_id": "..."
}

Requirement fields:

FieldTypeDescription
textstringThe original requirement text
order_indexintegerPosition in the run (0-based)
statusstringpending, processing, or completed
sub_requirementsarrayBroken-down sub-checks with individual verdicts
sub_requirements[].justificationstringEvidence and reasoning for this sub-requirement
sub_requirements[].scorenumberConfidence score (0 to 1)
sub_requirements[].statusstringcomply, not-comply, or pending