Skip to main content

Integration flow

Audience

Integrators running a full pipeline: discover resources, upload evidence, run an assessment, fetch the report.

Prerequisites

Base URL: https://api.air.thalus.ai

For concepts, discovery limits, and report structure, see Concepts.

Overview

1. Verify authentication

curl -sS 'https://api.air.thalus.ai/' \
-H 'Authorization: Bearer <rawKey>'

Expect 200 with "status": "ok".

2. Discover domain and project

Default: list by pid (no slugs required).

curl -sS 'https://api.air.thalus.ai/domains/' \
-H 'Authorization: Bearer <rawKey>'

Save pid as &lt;domainPid&gt;, then:

curl -sS 'https://api.air.thalus.ai/domains/<domainPid>/projects' \
-H 'Authorization: Bearer <rawKey>'

Save the target row's pid as &lt;projectPid&gt;. Pagination: ?page=1&pageSize=20&search=chatbot.

Optional: slug lookup when CI config already has portal slugs — see Concepts — Slugs vs pids.

3. Upload a document

Presigned flow (see Uploads for limits and failures).

Init:

curl -sS -X POST 'https://api.air.thalus.ai/projects/<projectPid>/documents/upload-init' \
-H 'Authorization: Bearer <rawKey>' \
-H 'Content-Type: application/json' \
-d '{"filename":"system-overview.pdf","contentType":"application/pdf"}'

Save uploadUrl and the storage key from the response.

PUT file bytes to uploadUrl (no Authorization header; same Content-Type).

Complete:

curl -sS -X POST 'https://api.air.thalus.ai/projects/<projectPid>/documents/upload-complete' \
-H 'Authorization: Bearer <rawKey>' \
-H 'Content-Type: application/json' \
-d '{
"s3Key": "<storage key from init>",
"filename": "system-overview.pdf",
"contentType": "application/pdf"
}'

Save sourcePid from the response for polling.

4. Poll extraction

curl -sS 'https://api.air.thalus.ai/projects/<projectPid>/documents' \
-H 'Authorization: Bearer <rawKey>'

Find the row where pid matches sourcePid. Poll until status is connected (or error — check lastError). See Async jobs for intervals.

When ready, list artifacts:

curl -sS 'https://api.air.thalus.ai/projects/<projectPid>/artifacts' \
-H 'Authorization: Bearer <rawKey>'

5. Start an assessment

Up to five artifactPids per run.

curl -sS -X POST 'https://api.air.thalus.ai/assessments/projects/<projectPid>' \
-H 'Authorization: Bearer <rawKey>' \
-H 'Content-Type: application/json' \
-d '{
"name": "CI assessment",
"artifactPids": ["<artf_pid>"]
}'

Expect 202. Save assessmentPid.

6. Poll and fetch report

curl -sS 'https://api.air.thalus.ai/assessments/<assessmentPid>' \
-H 'Authorization: Bearer <rawKey>'

When status is completed (or reportAvailable is true):

curl -sS 'https://api.air.thalus.ai/assessments/<assessmentPid>/report' \
-H 'Authorization: Bearer <rawKey>'

Report sections: see Concepts — Assessment report structure. On failure: GET /assessments/&lt;assessmentPid&gt;/stages.

Troubleshooting

SymptomLikely causeWhat to do
404 on project or assessmentKey is for a different domainMint a key in the correct domain
403 — missing scopeKey lacks required scopeNew key with scopes from Authentication
402 on start assessmentInsufficient org creditsContact your org admin
409 on upload-completeStale or duplicate storage keyRe-run init and PUT
Source stuck in processingLarge file or extraction errorCheck lastError; see Uploads
Assessment failedPipeline errorGET /assessments/&lt;assessmentPid&gt;/stages

More status codes: Errors.