Start an export or a report
curl --request POST \ --url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/export-jobs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "csv_topics", "params": {} }'csv_topics, csv_assets, csv_inspections: the app’s CSV exports. as_built_csv: one row per element with its as-built dates. report_md: the inspection report in Markdown. report_pdf: the PDF report with each failed step’s first photo (the organisation’s PDF report). handover: the handover package, a ZIP of the BCF file, the CSV files, the report and the finding photos with manifest.json. Each kind needs the project role the app’s export of it needs: admin for the CSV exports, as_built_csv and handover; inspector for report_pdf, and for report_md where the organisation has the PDF report, admin otherwise.
Answers 202 with the job; poll getExportJob until status is no longer queued or running, then download its files. Today the job is built within about 20 seconds while the call runs, a handover package up to 100 MB; a larger project answers refused, and so does a job that is not stored within 25 seconds. report_pdf draws from the project’s 20 PDF reports an hour, handover from its 20 BCF exports an hour and as_built_csv from its 20 as-built files an hour, all shared with the app; the CSV exports draw from 20 an hour and report_md from 20 an hour (429). A refused or failed job gives its draw back. A repeat with the same Idempotency-Key and body returns the first job with 200; after a timeout or 503, repeat with the same key and read the job.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”A repeat with the same key and body returns the first answer instead of writing again. Keys are per integration and project.
Request Bodyrequired
Section titled “Request Bodyrequired”The body of createExportJob.
object
csv_topics, csv_assets, csv_inspections: the app’s CSV exports. as_built_csv: one row per element with its as-built dates. report_md: the inspection report in Markdown. report_pdf: the PDF report with each failed step’s first photo (the organisation’s PDF report). handover: the handover package, a ZIP of the BCF file, the CSV files, the report and the finding photos with manifest.json. Each kind needs the project role the app’s export of it needs: admin for the CSV exports, as_built_csv and handover; inspector for report_pdf, and for report_md where the organisation has the PDF report, admin otherwise.
object
The report’s language; default the organisation’s
For as_built_csv and handover: the template whose latest passed inspection dates each stage; a stage left out stays empty
object
Responses
Section titled “Responses”The job an earlier call with the same Idempotency-Key started
An export job.
object
What a job exports.
Poll while queued or running. done: download each file. refused: message says why (too large, too slow). failed: start it again with a new Idempotency-Key; a job cut off before it ends reads failed a minute after it started. expired: the files are gone. New statuses may come.
The parameters of an export job.
object
fi or en.
object
What the files hold, by kind: rows, findings, photos
Files that stop at their row limit
Files a handover package left out because they could not be built in time
EXPORT_REFUSED or EXPORT_FAILED
When the files go; 24 hours after the job is done
Download file n with getExportJobFile and file=n
A file of an export job.
object
Hex SHA-256 of the file
Example
{ "kind": "csv_topics", "status": "queued", "params": { "language": "fi" }}The job
An export job.
object
What a job exports.
Poll while queued or running. done: download each file. refused: message says why (too large, too slow). failed: start it again with a new Idempotency-Key; a job cut off before it ends reads failed a minute after it started. expired: the files are gone. New statuses may come.
The parameters of an export job.
object
fi or en.
object
What the files hold, by kind: rows, findings, photos
Files that stop at their row limit
Files a handover package left out because they could not be built in time
EXPORT_REFUSED or EXPORT_FAILED
When the files go; 24 hours after the job is done
Download file n with getExportJobFile and file=n
A file of an export job.
object
Hex SHA-256 of the file
Example
{ "kind": "csv_topics", "status": "queued", "params": { "language": "fi" }}Invalid body, parameters or Idempotency-Key
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}Missing, malformed, expired or revoked token
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE below the role the kind needs; FEATURE_OFF for report_pdf where the organisation lacks the PDF report; PUBLIC_API_DISABLED
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}No such project, job or template
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}RESOURCE_DELETED: what this Idempotency-Key created has since been deleted; details.id names it
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}IDEMPOTENCY_KEY_REUSED: the key was used with another body
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}RATE_LIMITED; wait for Retry-After seconds
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}