Log in or sign up

    Borehole Analysis Pro API — v1.5

    Upload a borehole log and retrieve the extracted results as structured data, AGS4, CSV, JSON or a formatted report.

    Quickstart

    No SDKs. Plain HTTP; examples in curl and Python.

    Base URL

    https://api.smartcivilapps.com/api/v1/borehole

    Authentication

    Every request carries an API key issued against your Borehole Analysis Pro subscription.

    Authorization: Bearer sca_1f4c9e2b7a8d3c5e6b04a9f18d2c7e35b06a4d9f28c1e5b7

    API keys are server-side credentials. Do not ship one to a browser or mobile client, and do not commit one. Rotate by creating a new key and revoking the old one.

    Exception: the progress stream is authenticated by a ticket in its query string. See Live progress.

    Without a usable key:

    # No usable Authorization header
    {
      "error": "Authentication failed",
      "message": "An API key is required: send it as Authorization: Bearer sca_…",
      "code": "MISSING_API_KEY"
    }
    
    # Unknown or revoked key
    {
      "error": "Authentication failed",
      "message": "Invalid or revoked API key",
      "code": "INVALID_API_KEY"
    }

    Where keys come from

    1. On your Borehole Analysis Pro subscription in the Dashboard, choose Manage API access, which opens the API Keys page.
    2. Turn on Enable API access. No keys can be created until it is on. On an organisation seat, your organisation administrator sets it.
    3. Choose Create Key, name it, and copy the key — it is shown once and never again.

    Up to 5 active keys per subscription. A revoked key stops working immediately.

    Your first call

    curl -s https://api.smartcivilapps.com/api/v1/borehole/usage \
      -H "Authorization: Bearer $SCA_API_KEY"

    Response:

    # abridged — see the reference for the full record
    {
      "success": true,
      "data": {
        "usage": {
          "documents_processed": 12,
          "boreholes_processed": 47,
          "page_limit": 200,
          "pages_remaining": 106,
          "month_year": "2026-09",
          "topup_total": 100,
          "topup_used": 0,
          "topup_remaining": 100,
          "topup_packages": [
            {
              "id": "aaaaaaaa-0000-4000-8000-000000000006",
              "pages_total": 100,
              "pages_used": 0,
              "pages_remaining": 100,
              "purchased_at": "2026-08-01T00:00:00.000Z",
              "expires_at": "2027-08-01T00:00:00.000Z"
            }
          ],
          "next_expiry": { "date": "2027-08-01T00:00:00.000Z", "pages_expiring": 100 }
        }
      }
    }

    Python:

    # pip install requests
    import os
    import sys
    
    import requests
    
    BASE = "https://api.smartcivilapps.com/api/v1/borehole"
    
    API_KEY = os.environ.get("SCA_API_KEY")
    if not API_KEY:
        sys.exit("SCA_API_KEY is not set. Create a key at https://smartcivilapps.com/api-keys")
    
    HEADERS = {"Authorization": f"Bearer {API_KEY}"}
    
    r = requests.get(f"{BASE}/usage", headers=HEADERS, timeout=30)
    r.raise_for_status()
    
    usage = r.json()["data"]["usage"]
    print(usage["pages_remaining"], "of", usage["page_limit"], "pages left this month")
    print("plus", usage["topup_remaining"], "from top-ups")

    Conventions

    • Every request with a body sends JSON and Content-Type: application/json.
    • Request fields are camelCase.
    • Stored records come back snake_case; computed fields are camelCase. So POST /uploads returns uploadId and POST /jobs returns jobId, while reading either record gives id.
    • Timestamps are ISO 8601 in UTC.
    • Every successful response has the shape { "success": true, "data": … }, except the two DELETEs, which return message and no data, and the progress stream, which is text/event-stream.
    • Every response carries an X-Request-Id header. Quote it when you contact us.
    • Ignore fields you do not recognise. New ones are added without a version change.
    • There is no sandbox. Every key is live and every completed job consumes allowance.
    EndpointPayload inside data
    POST /uploadsdata.uploadId, data.uploadUrl
    GET /uploadsdata (array)
    GET /uploads/{id}data
    DELETE /uploads/{id}no data; message
    POST /jobsdata.jobId, data.queuePosition, data.estimatedWait, data.template
    GET /jobsdata.jobs
    GET /jobs/{id}data.job
    DELETE /jobs/{id}no data; message
    POST /jobs/{id}/stream-ticketdata.ticket, data.expiresIn
    GET /jobs/{id}/streamtext/event-stream; no envelope
    GET /jobs/{id}/datadata.extractedData
    GET /jobs/{id}/export/ags, /csv, /jsondata.downloadUrl, data.filename, plus one contents list
    GET /templatesdata (array)
    POST /jobs/{id}/generate-reportdata.reportStatus, data.templateId, data.reportLanguage
    GET /jobs/{id}/reportdata.report (a string)
    GET /jobs/{id}/docx-urldata.downloadUrl, data.expiresIn, data.format, data.templateId
    POST /jobs/{id}/regenerate-with-templatedata.downloadUrl, data.templateId, data.templateName, data.reportId, data.generationTimeMs
    POST /jobs/{jobId}/reportsdata.downloadUrl, data.reportId, data.cached, data.generationTimeMs, data.success
    GET /usagedata.usage
    GET /topupdata.topup
    GET /subscriptiondata.subscription
    GET /languagesdata.languages

    The processing flow

    How the API is used

    • One file is one upload. POST /uploads returns an uploadId and a storage URL; the bytes go to storage, not through the API. Uploads are the only files the API accepts.
    • One job is one extraction of one upload. POST /jobs names the upload by uploadId. One upload can back several jobs.
    • Ids are the handles. Store uploadId and jobId when you receive them.
    • To recover them: GET /uploads lists every upload from the last 7 days with filename, file_size and status; GET /jobs lists every job from the last 7 days with upload_id, file_name and status.
    1. POST /uploads                  → an upload id and a storage URL
    2. PUT  <the storage URL>         → the file bytes, straight to storage
    3. GET  /uploads/{uploadId}       → poll until status is "validated"
    4. POST /jobs                     → an extraction job id
    5. GET  /jobs/{jobId}             → poll until status is "completed"
    6. GET  /jobs/{jobId}/data        → the structured result
       GET  /jobs/{jobId}/export/ags  → AGS4, CSV or JSON download URL

    Allowance is counted per page, not per document: a 12-page file consumes 12. Every job is deleted 7 days after it is created, along with its exports and reports. Store your results as soon as a job completes.

    There are no webhooks. Poll GET /jobs/{id} or use the progress stream.

    The whole flow in Python

    """
    Borehole Analysis Pro API v1 — complete example.
    
        pip install requests
        export SCA_API_KEY=sca_...
        python extract.py site-investigation-BH01.pdf
    """
    import os
    import sys
    import time
    
    import requests
    
    BASE = "https://api.smartcivilapps.com/api/v1/borehole"
    
    API_KEY = os.environ.get("SCA_API_KEY")
    if not API_KEY:
        sys.exit("SCA_API_KEY is not set. Create a key at https://smartcivilapps.com/api-keys")
    
    HEADERS = {"Authorization": f"Bearer {API_KEY}"}
    
    ALLOWED_EXTENSIONS = {"pdf", "png", "jpg", "jpeg", "ags"}
    
    VALIDATION_POLL_SECONDS = 5
    JOB_POLL_SECONDS = 10
    VALIDATION_TIMEOUT_SECONDS = 300
    JOB_TIMEOUT_SECONDS = 1800       # processing p90 is 209 s; queue wait is extra
    
    
    def error_code(body):
        """The specific code: nested when the endpoint nests, top-level otherwise."""
        nested = body.get("error")
        if isinstance(nested, dict) and nested.get("code"):
            return nested["code"]
        return body.get("code")
    
    
    class ApiError(RuntimeError):
        def __init__(self, status, body):
            self.status = status
            self.body = body or {}
            self.code = error_code(self.body)
            super().__init__(f"HTTP {status} {self.code}: {self.body}")
    
    
    def _json(response):
        try:
            return response.json()
        except ValueError:
            return {}
    
    
    # Not waitable: retrying these in a loop cannot make them succeed.
    UNWAITABLE = ("QUOTA_EXCEEDED", "CONCURRENCY_LIMIT_EXCEEDED", "QUEUE_LIMIT_EXCEEDED")
    
    MAX_5XX_RETRIES = 3
    MAX_RATE_LIMIT_WAITS = 10
    
    
    def call(method, path, **kwargs):
        """One API request, with the retry policy from the Errors section."""
        rate_limit_waits = 0
        server_error_retries = 0
        while True:
            r = requests.request(method, BASE + path, headers=HEADERS, timeout=30, **kwargs)
    
            # 401 is permanent: bad, revoked or missing key, or inactive account.
            if r.status_code == 401:
                raise ApiError(401, _json(r))
    
            if r.status_code == 429:
                body = _json(r)
                code = error_code(body)
                if code in UNWAITABLE:
                    raise ApiError(429, body)
                if rate_limit_waits >= MAX_RATE_LIMIT_WAITS:
                    raise ApiError(429, body)
                rate_limit_waits += 1
                wait = int(body.get("retryAfter") or 15)
                print(f"rate limited ({code}); sleeping {wait}s", file=sys.stderr)
                time.sleep(wait)
                continue
    
            # UPLOAD_NOT_READY / JOB_NOT_COMPLETED / INVALID_STATE: poll the resource, then call again.
            # Any other 4xx: the request is wrong. Do not retry.
            if 400 <= r.status_code < 500:
                raise ApiError(r.status_code, _json(r))
    
            # 5xx: up to 3 retries, backing off 1, 2 then 4 seconds.
            if r.status_code >= 500:
                if server_error_retries >= MAX_5XX_RETRIES:
                    raise ApiError(r.status_code, _json(r))
                time.sleep(2 ** server_error_retries)
                server_error_retries += 1
                continue
    
            return r.json()
    
    
    def request_upload(path):
        """Step 1 — reserve an upload and get a storage URL. Valid for 5 minutes."""
        extension = os.path.splitext(path)[1].lstrip(".").lower()
        if extension not in ALLOWED_EXTENSIONS:
            sys.exit(f"unsupported file type: .{extension}")
        body = {"filename": os.path.basename(path)}
        data = call("POST", "/uploads", json=body)["data"]
        return data["uploadId"], data["uploadUrl"]
    
    
    def put_file(upload_url, path):
        """Step 2 — the bytes go straight to storage. No Authorization header here."""
        with open(path, "rb") as handle:
            r = requests.put(upload_url, data=handle, timeout=300)
        r.raise_for_status()
    
    
    def wait_for_validation(upload_id):
        """Step 3 — poll until the file has been checked."""
        deadline = time.time() + VALIDATION_TIMEOUT_SECONDS
        while time.time() < deadline:
            upload = call("GET", f"/uploads/{upload_id}")["data"]
            status = upload["status"]
            if status == "validated":
                return upload
            if status == "failed":
                raise RuntimeError("validation failed: " + str(upload["validation_error"]))
            # "pending" and "uploaded" are transitional.
            time.sleep(VALIDATION_POLL_SECONDS)
        raise TimeoutError("upload was not validated in time")
    
    
    def create_job(upload_id, output_language="auto"):
        """Step 4 — start extraction. Returns as soon as the job is queued.
    
        There is no idempotency key: after a 5xx here, find any job that was
        created before sending the request again.
        """
        body = {"uploadId": upload_id, "outputLanguage": output_language}
        try:
            data = call("POST", "/jobs", json=body)["data"]
        except ApiError as exc:
            if exc.status < 500:
                raise
            existing = [
                job for job in call("GET", "/jobs")["data"]["jobs"]
                if job["upload_id"] == upload_id
            ]
            if existing:
                print(f"5xx on create; job {existing[0]['id']} already exists", file=sys.stderr)
                return existing[0]["id"], 0
            data = call("POST", "/jobs", json=body)["data"]
        print(f"queued at position {data['queuePosition']}")
        return data["jobId"], data["estimatedWait"]
    
    
    def wait_for_job(job_id, estimated_wait=0):
        """Step 5 — poll until the job is finished."""
        deadline = time.time() + min(estimated_wait + 900, JOB_TIMEOUT_SECONDS)
        while time.time() < deadline:
            job = call("GET", f"/jobs/{job_id}")["data"]["job"]
            status = job["status"]
            if status == "completed":
                return job
            if status in ("failed", "terminal"):
                raise RuntimeError(f"job {status}: {job.get('error_message')}")
            print(f"{status} {job['progress']}%")
            time.sleep(JOB_POLL_SECONDS)
        raise TimeoutError("job did not finish in time")
    
    
    def get_data(job_id):
        """Step 6a — the structured result."""
        return call("GET", f"/jobs/{job_id}/data")["data"]["extractedData"]
    
    
    def download_export(job_id, fmt="ags", out_dir="."):
        """Step 6b — fmt is "ags", "csv" or "json". The URL is a direct storage link."""
        export = call("GET", f"/jobs/{job_id}/export/{fmt}")["data"]
        r = requests.get(export["downloadUrl"], timeout=300)
        r.raise_for_status()
        target = os.path.join(out_dir, os.path.basename(export["filename"]))
        with open(target, "wb") as handle:
            handle.write(r.content)
        return target
    
    
    def main(source):
        upload_id, upload_url = request_upload(source)
        put_file(upload_url, source)
        wait_for_validation(upload_id)
    
        job_id, estimated_wait = create_job(upload_id)
        print("job", job_id)
        wait_for_job(job_id, estimated_wait)
    
        data = get_data(job_id)
        metadata = data["extractionMetadata"]
        print("unit system:", metadata["unitSystem"])   # "metric" or "imperial"
        print("boreholes:", len(data["boreholes"]))
    
        print("wrote", download_export(job_id, "ags"))
    
    
    if __name__ == "__main__":
        if len(sys.argv) != 2:
            sys.exit("usage: python extract.py <file.pdf|.png|.jpg|.jpeg|.ags>")
        main(sys.argv[1])

    The same steps in curl

    Step 1 — request an upload URL

    curl -s -X POST https://api.smartcivilapps.com/api/v1/borehole/uploads \
      -H "Authorization: Bearer $SCA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"filename":"site-investigation-BH01.pdf"}'
    
    {
      "success": true,
      "data": {
        "uploadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091203Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=7b1c0d4e9a2f5386bc47e0d19f8a63c25d704be18f39a6c07d2b5481e93f6a0c",
        "uploadId": "aaaaaaaa-0000-4000-8000-000000000002"
      }
    }

    Step 2 — send the file

    The bytes go straight to storage, not through the API. Do not send your key on this request; no other headers are required. Success is HTTP 200 with an empty body; after 5 minutes the URL returns 403 with an XML body from storage, and you request a new one.

    # No Authorization header — this goes straight to storage.
    curl -s -X PUT "$UPLOAD_URL" --upload-file site-investigation-BH01.pdf
    
    # Empty body, HTTP 200.

    Step 3 — poll until validated

    Uploading triggers a check of size, type and, for PDFs, page count. Poll every 5 seconds until status is validated or failed. Branch on status; validation_error is free text for display.

    curl -s https://api.smartcivilapps.com/api/v1/borehole/uploads/aaaaaaaa-0000-4000-8000-000000000002 \
      -H "Authorization: Bearer $SCA_API_KEY"
    
    {
      "success": true,
      "data": {
        "id": "aaaaaaaa-0000-4000-8000-000000000002",
        "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
        "filename": "site-investigation-BH01.pdf",
        "file_path": "borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf",
        "file_size": 2458112,
        "content_type": "application/pdf",
        "status": "validated",
        "validation_error": null,
        "created_at": "2026-09-02T09:12:03.000Z",
        "expires_at": "2026-09-09T09:12:03.000Z",
        "page_count": 12
      }
    }

    Step 4 — create the job

    curl -s -X POST https://api.smartcivilapps.com/api/v1/borehole/jobs \
      -H "Authorization: Bearer $SCA_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"uploadId":"aaaaaaaa-0000-4000-8000-000000000002","outputLanguage":"auto"}'
    
    {
      "success": true,
      "data": {
        "jobId": "aaaaaaaa-0000-4000-8000-000000000003",
        "queuePosition": 1,
        "estimatedWait": 25,
        "template": null
      }
    }

    Step 5 — poll until completed

    Poll every 10 seconds. Processing itself takes 2 to 4 minutes — measured p50 154 s, p90 209 s, longest 237 s — and estimatedWait seconds of queue wait come on top of that. status ends at completed, failed or terminal — treat the last two alike and read error_message. A job that fails consumes no allowance.

    curl -s https://api.smartcivilapps.com/api/v1/borehole/jobs/aaaaaaaa-0000-4000-8000-000000000003 \
      -H "Authorization: Bearer $SCA_API_KEY"
    
    # abridged — see the reference for the full record
    {
      "success": true,
      "data": {
        "job": {
          "id": "aaaaaaaa-0000-4000-8000-000000000003",
          "upload_id": "aaaaaaaa-0000-4000-8000-000000000002",
          "file_name": "site-investigation-BH01.pdf",
          "status": "processing",
          "progress": 45,
          "error_message": null,
          "extracted_data": null,
          "report_status": null,
          "report_error_message": null,
          "output_language": "auto",
          "detected_language": "en",
          "created_at": "2026-09-02T09:13:00.000Z",
          "completed_at": null,
          "expires_at": "2026-09-09T09:13:00.000Z"
        }
      }
    }

    Step 6 — fetch the results

    Before you parse any number, read extractionMetadata.unitSystem. No depth or elevation in the payload carries its own unit — they are all in metres when it is "metric" and feet when it is "imperial".

    curl -s https://api.smartcivilapps.com/api/v1/borehole/jobs/aaaaaaaa-0000-4000-8000-000000000003/data \
      -H "Authorization: Bearer $SCA_API_KEY"
    
    {
      "success": true,
      "data": {
        "extractedData": {
          "boreholes": [],
          "extractionMetadata": {
            "confidence": 0.92,
            "model": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
            "promptVersion": "v7.0.1",
            "unitSystem": "metric"
          }
        }
      }
    }
    
    curl -s https://api.smartcivilapps.com/api/v1/borehole/jobs/aaaaaaaa-0000-4000-8000-000000000003/export/ags \
      -H "Authorization: Bearer $SCA_API_KEY"
    
    {
      "success": true,
      "data": {
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/exports/aaaaaaaa-0000-4000-8000-000000000003/v1/data_export.ags?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091640Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=2e5b90c1a7d34f68b012e9d5c8a4f37160bd29e4c5017a8f3b6d90c2e478a15b",
        "filename": "Northg-aaaaa_data_export.ags",
        "groupsGenerated": ["PROJ","TRAN","LOCA","GEOL","SAMP","GCHM","WSTD"]
      }
    }
    
    # The download URL is a direct storage link, valid for 24 hours.
    curl -s -o export.ags "$DOWNLOAD_URL"

    Extracted data

    The payload at data.extractedData of GET /jobs/{id}/data. Depths and elevations are in the unit named by extractionMetadata.unitSystem.

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "extractedData": {
          "projectInfo": {
            "projectName": "Northgate Interchange Ground Investigation",
            "client": "Northgate Regional Transport Authority",
            "location": "Northgate Interchange, A41 at Mill Lane",
            "drillingContractor": "Vale Drilling Services Ltd",
            "drillingDates": { "start": "2026-07-14", "end": "2026-07-18" },
            "reportDate": "2026-08-03",
            "reportNumber": "NGI-2026-0417"
          },
          "siteDescription": {
            "description": "Level made-ground platform on the north verge of the A41.",
            "topography": "Flat, falling gently to the south-east",
            "vegetation": "Rough grass with scattered hawthorn scrub",
            "surfaceConditions": "Compacted granular haul road over topsoil"
          },
          "boreholes": [
            {
              "id": "BH-01",
              "name": "BH-01",
              "location": {
                "description": "North verge, 12 m east of chainage 1450",
                "coordinates": {
                  "lat": 52.4831,
                  "lng": -1.9027,
                  "easting": 407412.5,
                  "northing": 287905.2,
                  "system": "EPSG:27700"
                },
                "elevation": 96.4,
                "coordinateSystem": "WGS84"
              },
              "totalDepth": 12.5,
              "drillingMethod": "Cable percussion",
              "layers": [
                {
                  "depthFrom": 0,
                  "depthTo": 0.6,
                  "elevationTop": 96.4,
                  "elevationBase": 95.8,
                  "description": "MADE GROUND: brown sandy gravel with brick and concrete fragments",
                  "soilType": "GM",
                  "layerName": "Made Ground",
                  "detailedDescription": {
                    "color": "brown",
                    "moisture": "slightly moist",
                    "consistency": null,
                    "density": "loose",
                    "plasticity": null,
                    "origin": "anthropogenic"
                  },
                  "sptData": [],
                  "properties": {}
                },
                {
                  "depthFrom": 0.6,
                  "depthTo": 4.2,
                  "elevationTop": 95.8,
                  "elevationBase": 92.2,
                  "description": "Firm brown slightly sandy CLAY with occasional fine gravel",
                  "soilType": "CL",
                  "layerName": "Glacial Till",
                  "detailedDescription": {
                    "color": "brown",
                    "moisture": "moist",
                    "consistency": "firm",
                    "density": null,
                    "plasticity": "low to medium",
                    "origin": "glacial"
                  },
                  "sptData": [
                    {
                      "depth": 1.5,
                      "depthTop": 1.5,
                      "depthBase": 1.95,
                      "nValue": 9,
                      "blowCounts": "2-3-2-2-2-3",
                      "sampleId": "BH01-S1",
                      "sampleType": "SS",
                      "recoveryPercent": 92,
                      "condition": "Disturbed",
                      "sampleDescription": "Firm brown slightly sandy CLAY with occasional fine gravel"
                    },
                    {
                      "depth": 3.0,
                      "depthTop": 3.0,
                      "depthBase": 3.45,
                      "nValue": 14,
                      "blowCounts": "3-4-3-3-4-4",
                      "sampleId": "BH01-S2",
                      "sampleType": "SS",
                      "recoveryPercent": 88,
                      "condition": "Disturbed",
                      "sampleDescription": "Firm brown slightly sandy CLAY with occasional fine gravel"
                    }
                  ],
                  "properties": { "moistureContent": 18.4 }
                },
                {
                  "depthFrom": 4.2,
                  "depthTo": 12.5,
                  "elevationTop": 92.2,
                  "elevationBase": 83.9,
                  "description": "Dense grey fine to coarse SAND and GRAVEL",
                  "soilType": "SW",
                  "layerName": "River Terrace Deposits",
                  "detailedDescription": {
                    "color": "grey",
                    "moisture": "wet",
                    "consistency": null,
                    "density": "dense",
                    "plasticity": "non-plastic",
                    "origin": "fluvial"
                  },
                  "sptData": [
                    {
                      "depth": 6.0,
                      "depthTop": 6.0,
                      "depthBase": 6.45,
                      "nValue": 34,
                      "blowCounts": "6-8-8-8-9-9",
                      "sampleId": "BH01-S3",
                      "sampleType": "SS",
                      "recoveryPercent": 74,
                      "condition": "Disturbed",
                      "sampleDescription": "Dense grey fine to coarse SAND and GRAVEL"
                    }
                  ],
                  "properties": {}
                }
              ],
              "groundwater": {
                "encountered": true,
                "depths": [
                  { "depth": 4.5, "date": "2026-07-14", "condition": "Seepage" },
                  { "depth": 3.9, "date": "2026-07-15", "condition": "Rising" }
                ],
                "monitoringWells": [
                  { "wellId": "BH-01-STP", "depth": 12.0, "waterLevel": 3.7, "date": "2026-07-25" }
                ]
              },
              "testingData": [
                {
                  "type": "Pocket Penetrometer",
                  "depth": 2.4,
                  "value": 105,
                  "units": "kPa",
                  "sampleType": "Undisturbed"
                }
              ],
              "laboratoryTests": [
                {
                  "sampleId": "BH01-S1",
                  "boreholeId": "BH-01",
                  "depth": 1.5,
                  "testType": "Atterberg Limits",
                  "testMethod": "BS 1377-2:2022",
                  "sampleType": "Disturbed",
                  "results": { "liquidLimit": 38, "plasticLimit": 21, "plasticityIndex": 17 }
                },
                {
                  "sampleId": "BH01-S3",
                  "boreholeId": "BH-01",
                  "depth": 6.0,
                  "testType": "Grain Size Analysis",
                  "testMethod": "BS 1377-2:2022",
                  "sampleType": "Disturbed",
                  "results": { "gravelPercent": 41.2, "sandPercent": 55.6, "finesPercent": 3.2, "d60": 4.8, "d10": 0.21 }
                }
              ]
            },
            {
              "id": "BH-02",
              "name": "BH-02",
              "location": {
                "description": "South verge, 40 m west of chainage 1450",
                "coordinates": {
                  "lat": 52.4826,
                  "lng": -1.9041,
                  "easting": 407318.9,
                  "northing": 287849.6,
                  "system": "EPSG:27700"
                },
                "elevation": 95.1,
                "coordinateSystem": "WGS84"
              },
              "totalDepth": 10.0,
              "drillingMethod": "Cable percussion",
              "layers": [
                {
                  "depthFrom": 0,
                  "depthTo": 0.3,
                  "elevationTop": 95.1,
                  "elevationBase": 94.8,
                  "description": "TOPSOIL: dark brown silty sand with rootlets",
                  "soilType": "SM",
                  "layerName": "Topsoil",
                  "detailedDescription": {
                    "color": "dark brown",
                    "moisture": "moist",
                    "consistency": null,
                    "density": "very loose",
                    "plasticity": "non-plastic",
                    "origin": "residual"
                  },
                  "sptData": [],
                  "properties": {}
                },
                {
                  "depthFrom": 0.3,
                  "depthTo": 5.8,
                  "elevationTop": 94.8,
                  "elevationBase": 89.3,
                  "description": "Stiff grey-brown CLAY with occasional chalk fragments",
                  "soilType": "CH",
                  "layerName": "Glacial Till",
                  "detailedDescription": {
                    "color": "grey-brown",
                    "moisture": "moist",
                    "consistency": "stiff",
                    "density": null,
                    "plasticity": "high",
                    "origin": "glacial"
                  },
                  "sptData": [
                    {
                      "depth": 2.0,
                      "depthTop": 2.0,
                      "depthBase": 2.45,
                      "nValue": 18,
                      "blowCounts": "4-5-4-4-5-5",
                      "sampleId": "BH02-S1",
                      "sampleType": "SS",
                      "recoveryPercent": 95,
                      "condition": "Disturbed",
                      "sampleDescription": "Stiff grey-brown CLAY with occasional chalk fragments"
                    },
                    {
                      "depth": 4.5,
                      "depthTop": 4.5,
                      "depthBase": 4.95,
                      "nValue": 23,
                      "blowCounts": "5-6-5-6-6-6",
                      "sampleId": "BH02-S2",
                      "sampleType": "SS",
                      "recoveryPercent": 91,
                      "condition": "Disturbed",
                      "sampleDescription": "Stiff grey-brown CLAY with occasional chalk fragments"
                    }
                  ],
                  "properties": { "moistureContent": 22.7 }
                },
                {
                  "depthFrom": 5.8,
                  "depthTo": 10.0,
                  "elevationTop": 89.3,
                  "elevationBase": 85.1,
                  "description": "Weak white structureless CHALK, grade D",
                  "soilType": "R",
                  "layerName": "Chalk",
                  "detailedDescription": {
                    "color": "white",
                    "moisture": "moist",
                    "consistency": null,
                    "density": null,
                    "plasticity": null,
                    "origin": "sedimentary rock"
                  },
                  "sptData": [
                    {
                      "depth": 8.0,
                      "depthTop": 8.0,
                      "depthBase": 8.3,
                      "nValue": null,
                      "blowCounts": "20-25-50 for 100mm",
                      "sampleId": "BH02-S3",
                      "sampleType": "CR",
                      "recoveryPercent": 68,
                      "condition": "Refusal",
                      "sampleDescription": "Weak white structureless CHALK, grade D"
                    }
                  ],
                  "properties": {}
                }
              ],
              "groundwater": {
                "encountered": false,
                "depths": [],
                "monitoringWells": []
              },
              "testingData": [],
              "laboratoryTests": [
                {
                  "sampleId": "BH02-S2",
                  "boreholeId": "BH-02",
                  "depth": 4.5,
                  "testType": "Triaxial",
                  "testMethod": "BS 1377-7:1990",
                  "sampleType": "Undisturbed",
                  "results": { "cohesionKpa": 62, "frictionAngleDeg": 24, "cellPressureKpa": 100 }
                }
              ]
            }
          ],
          "unattributedLaboratoryTests": [],
          "dataAvailability": {
            "hasSPTData": true,
            "hasGroundwater": true,
            "hasLabTests": true,
            "hasGrainSizeDistribution": true,
            "hasAtterbergLimits": true,
            "hasSitePlan": false,
            "hasRegionalGeology": false
          },
          "extractionMetadata": {
            "confidence": 0.92,
            "model": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
            "promptVersion": "v7.0.1",
            "unitSystem": "metric"
          }
        }
      }
    }

    extractedData

    FieldTypePresenceMeaning
    boreholesarrayalwaysOne entry per borehole in the document, in document order.
    extractionMetadataobjectalwaysModel, prompt version and the document’s unit system.
    projectInfoobjectoptionalProject, client and drilling metadata from the title block.
    siteDescriptionobjectoptionalNarrative description of the site.
    unattributedLaboratoryTestsarrayoptionalLaboratory tests that could not be assigned to a borehole. Each borehole’s own tests are at boreholes[].laboratoryTests.
    dataAvailabilityobjectoptionalBooleans saying which classes of data the document carried.
    sitePlananyoptionalSite-plan content captured with the whole-document pass. Its shape is not part of the v1 contract.
    uiStringsobjectoptionalReport and chart labels in the output language.
    _columnOrder, _renames, _deletedobjectoptionalEdit-history metadata. Every key beginning with an underscore is internal; ignore it.

    boreholes[]

    FieldTypePresenceMeaning
    idstringalwaysBorehole identifier as printed on the log, for example "BH-01".
    namestringoptionalDisplay name. Usually the same as id.
    locationobjectalwaysWhere the borehole was sunk. See the next table.
    totalDepthnumberoptional, nullableDepth to the base of the borehole.
    drillingMethodstringoptional, nullableFor example "Cable percussion", "Rotary open hole".
    layersarrayalwaysStrata, shallowest first.
    groundwaterobjectoptionalStrikes and installations. See below.
    testingDataarrayoptionalIn-situ tests not tied to one layer. See below.
    laboratoryTestsarrayoptionalLaboratory tests on samples from this borehole. See below.

    boreholes[].location

    FieldTypePresenceMeaning
    descriptionstringalwaysPosition as printed on the log.
    coordinatesobjectoptional, nullableAny subset of lat, lng, easting, northing, system. A geographic pair and a projected pair can both be present; system names the projected CRS.
    elevationnumberoptional, nullableCollar level.
    coordinateSystemstringoptional, nullableCRS for lat/lng. WGS84 when absent.

    boreholes[].layers[]

    FieldTypePresenceMeaning
    depthFromnumberalwaysDepth to the top of the layer.
    depthTonumberalwaysDepth to the base of the layer.
    elevationTopnumberoptional, nullableLevel of the layer top. Takes precedence over the collar elevation when both are present.
    elevationBasenumberoptional, nullableLevel of the layer base.
    descriptionstringalwaysStratum description as printed.
    soilTypestringalways, nullableUSCS symbol: PT, OH, OL, CH, CL, CL-ML, ML, MH, SC, SM, SP, SW, SP-SM, SC-SM, GC, GM, GP, GW, GP-GM, TS or R.
    layerNamestringoptionalFormation or unit name.
    detailedDescriptionobjectoptionalcolor, moisture, consistency, density, plasticity, origin — each a string or null.
    sptDataarrayoptionalSPT and sample records within the layer.
    propertiesobjectoptionalAny further printed properties, keyed by name.

    boreholes[].layers[].sptData[]

    FieldTypePresenceMeaning
    depthnumberalwaysTest depth.
    depthTopnumberoptionalDepth at the start of the drive.
    depthBasenumberoptionalDepth at the end of the drive.
    nValuenumberalways, nullableSPT N. The N the log prints; else computed from the blow counts by their form (3 or 4 counts: 2nd + 3rd; UK 5 or 6 counts: the four test counts). null when neither gives one, for example on refusal.
    blowCountsstringoptionalBlow counts as printed, in order, joined with hyphens, for example "2-3-2-2-2-3".
    sampleIdstringoptionalSample reference.
    sampleTypestringoptionalST, SS, CR, TW, BS, AS or RS.
    recoveryPercentnumberoptionalRecovery, 0–100.
    conditionstringoptionalUndisturbed, Disturbed, Remoulded, Refusal or Rock core.
    sampleDescriptionstringalways, nullableThe part of the layer's description that applies to this sample. null when none applies. Kept current after each edit in Review.
    unitsobjectoptionalUnit per field on this row, keyed by field name, as printed on the document.
    units_inferredarrayoptionalField names from units above whose unit was not printed and was inferred instead.

    boreholes[].groundwater

    FieldTypePresenceMeaning
    encounteredbooleanalwaysWhether water was struck.
    depthsarrayoptionalOne entry per strike: depth (number), date (string or null), condition (Static, Rising, Falling, Perched, Seepage or Dry).
    monitoringWellsarrayoptionalOne entry per installation: wellId, depth, waterLevel, date.

    boreholes[].testingData[]

    FieldTypePresenceMeaning
    typestringalwaysVane (Field), Pocket Penetrometer, Dynamic Penetration, SPT, CPT, Pressuremeter or Plate load.
    depthnumberalwaysTest depth.
    valuenumberalwaysMeasured value, in units.
    unitsstringalwayskPa, MPa, blows/ft, blows/300mm or blows/100mm.
    units_inferredarrayoptionalPresent as ["value"] when units above was not printed and was inferred instead.
    sampleTypestringoptional, nullableUndisturbed, Disturbed, Remoulded, Rock core or Bag sample.

    boreholes[].laboratoryTests[]

    FieldTypePresenceMeaning
    sampleIdstringalwaysSample reference. Matches sptData[].sampleId where the log ties them.
    boreholeIdstringalways, nullableThe id of the borehole the sample came from. Null when the record could not be assigned to a borehole (shown under Unattributed).
    depthnumberalwaysSample depth.
    testTypestringalwaysGrain Size Analysis, Atterberg Limits, Consolidation, Permeability, Triaxial, Direct Shear, CBR, Proctor or Moisture Content.
    testMethodstringoptional, nullableStandard used, as printed.
    sampleTypestringoptional, nullableUndisturbed, Disturbed, Remoulded, Rock core or Bag sample.
    resultsobjectalwaysResult values keyed by name. The keys vary by testType.
    unitsobjectoptionalUnit per results key, as printed on the document.
    units_inferredarrayoptionalresults keys from units above whose unit was not printed and was inferred instead.

    extractionMetadata

    FieldTypePresenceMeaning
    confidencenumberalways0–1, job level. A placeholder, not a per-field measure.
    modelstringalwaysThe extraction model id.
    promptVersionstringalwaysThe extraction prompt version.
    unitSystem"metric" | "imperial"optionalmetric = metres, imperial = feet. Applies to every depth and elevation in the payload.

    projectInfo

    FieldTypePresenceMeaning
    projectNamestringoptional, nullableProject title.
    clientstringoptional, nullableClient name.
    locationstringoptional, nullableSite location.
    drillingContractorstringoptional, nullableContractor who sank the boreholes.
    drillingDatesobjectoptionalstart and end, each a string or null.
    reportDatestringoptional, nullableDate on the source report.
    reportNumberstringoptional, nullableReport reference.

    siteDescription

    FieldTypePresenceMeaning
    descriptionstringoptional, nullableNarrative site description.
    topographystringoptional, nullableLandform and slope.
    vegetationstringoptional, nullableGround cover.
    surfaceConditionsstringoptional, nullableSurfacing at the boreholes.

    unattributedLaboratoryTests[]

    FieldTypePresenceMeaning
    sampleIdstringalwaysSample reference. Matches sptData[].sampleId where the log ties them.
    boreholeIdstringalways, nullableThe id of the borehole the sample came from. Null when the record could not be assigned to a borehole (shown under Unattributed).
    depthnumberalwaysSample depth.
    testTypestringalwaysGrain Size Analysis, Atterberg Limits, Consolidation, Permeability, Triaxial, Direct Shear, CBR, Proctor or Moisture Content.
    testMethodstringoptional, nullableStandard used, as printed.
    sampleTypestringoptional, nullableUndisturbed, Disturbed, Remoulded, Rock core or Bag sample.
    resultsobjectalwaysResult values keyed by name. The keys vary by testType.
    unitsobjectoptionalUnit per results key, as printed on the document.
    units_inferredarrayoptionalresults keys from units above whose unit was not printed and was inferred instead.

    dataAvailability

    FieldTypePresenceMeaning
    hasSPTDatabooleanoptionalSPT results were found.
    hasGroundwaterbooleanoptionalGroundwater observations were found.
    hasLabTestsbooleanoptionalLaboratory results were found.
    hasGrainSizeDistributionbooleanoptionalGrain-size results were found.
    hasAtterbergLimitsbooleanoptionalAtterberg results were found.
    hasSitePlanbooleanoptionalA site plan was found.
    hasRegionalGeologybooleanoptionalRegional geology text was found.

    Further has* flags may appear. The named string sets above are the vocabulary the extraction uses; any object may carry keys these tables do not list.

    Reports

    A report is built from a job that has finished extraction. It consumes no allowance and can be repeated with different templates.

    1. Pick a template. GET /templates — take the id.
    2. Queue the build. POST /jobs/{id}/generate-report returns immediately with {"reportStatus": "generating"}.
    3. Poll the job and watch report_status on GET /jobs/{id}. It moves generating → available, or → failed, normally in under a minute. report_status is tracked separately from status, which stays completed throughout.
    4. Download it. GET /jobs/{id}/docx-url returns a storage URL valid for 24 hours.
    5. Rebuild with a different template. POST /jobs/{id}/regenerate-with-template returns the new download URL in the same response.
    # Continues the flow script above: reuses call, job_id and time.
    # Built from a completed job; consumes no allowance.
    from datetime import datetime, timezone
    
    REPORT_TIMEOUT_SECONDS = 300
    
    
    def _report_time(value):
        return datetime.fromisoformat(value.replace("Z", "+00:00")) if value else None
    
    
    templates = call("GET", "/templates")["data"]
    template_id = templates[0]["id"]
    
    post_time = datetime.now(timezone.utc)
    call("POST", f"/jobs/{job_id}/generate-report",
         json={"templateId": template_id, "reportLanguage": "en"})
    # -> {"success": true, "data": {"reportStatus": "generating", ...}}
    
    # A regeneration starts from "available", so wait for the new report: confirm
    # report_status has moved to "generating", or report_generated_at has moved past
    # post_time, before trusting the next "available" as the new report.
    deadline = time.time() + REPORT_TIMEOUT_SECONDS
    while True:
        if time.time() >= deadline:
            raise TimeoutError("report generation did not start in time")
        job = call("GET", f"/jobs/{job_id}")["data"]["job"]
        generated_at = _report_time(job["report_generated_at"])
        if job["report_status"] == "generating" or (generated_at and generated_at > post_time):
            break
        time.sleep(2)
    
    # Poll the job and watch report_status, not status.
    while True:
        if time.time() >= deadline:
            raise TimeoutError("report was not generated in time")
        job = call("GET", f"/jobs/{job_id}")["data"]["job"]
        if job["report_status"] == "available":
            break
        if job["report_status"] == "failed":
            raise RuntimeError(job.get("report_error_message"))
        time.sleep(5)
    
    docx = call("GET", f"/jobs/{job_id}/docx-url")["data"]
    print(docx["downloadUrl"], "valid for", docx["expiresIn"], "seconds")

    POST /jobs/{jobId}/reports builds a report synchronously and returns the download URL directly.

    • Takes templateId and format ("pdf" or "docx").
    • Writes only to its own record — reportId, the storage key and generationTimeMs. It does not set report_status or docx_report_s3_key on the job.
    • Renders in whatever language is already stored on the job. There is no reportLanguage field on this endpoint.
    • No server-side generation timeout. generationTimeMs in the example is a measured value, not a bound — apply the 30-second client timeout from Errors.

    Endpoint reference

    Paths are relative to https://api.smartcivilapps.com/api/v1/borehole. Except where noted, every request needs the Authorization: Bearer sca_… header. Every endpoint can also return the 401 codes, 429 RATE_LIMIT_EXCEEDED and 500 INTERNAL_ERROR (the three exports return 500 EXPORT_ERROR instead); the tables below list endpoint-specific errors only. Every endpoint except POST /jobs/{jobId}/reports, GET /templates and the Account group returns 403 SUBSCRIPTION_REQUIRED without an active Borehole Analysis Pro subscription. Every endpoint with a path or body parameter, except POST /jobs/{jobId}/reports, returns 400 VALIDATION_ERROR when it is malformed; details[] names the field.

    Uploads

    POST
    /uploads

    Reserve an upload and return a storage URL to PUT the file to. Does not start processing.

    Request body

    NameTypeRequiredDescription
    filenamestringyes1–255 characters, ending in .pdf, .png, .jpg, .jpeg or .ags (case-insensitive). Only the extension is constrained; any UTF-8 name is accepted.
    • The returned uploadUrl is valid for 5 minutes and may be retried within that window.
    • The PUT to uploadUrl needs no headers. The file type is checked from the stored bytes and the size is measured from the stored object; both are written to the upload record at validation.
    • Storage PUT responses: 200 with an empty body on success. After 5 minutes, 403 with an XML body from storage, not the JSON envelope — request a new URL.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "uploadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091203Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=7b1c0d4e9a2f5386bc47e0d19f8a63c25d704be18f39a6c07d2b5481e93f6a0c",
        "uploadId": "aaaaaaaa-0000-4000-8000-000000000002"
      }
    }

    Errors

    StatusCodeMeaning
    400VALIDATION_ERRORA body field failed validation. Read details[].
    403SUBSCRIPTION_REQUIREDNo active Borehole Analysis Pro subscription.
    500UPLOAD_URL_GENERATION_FAILEDThe storage URL could not be generated. Retry.
    GET
    /uploads

    List your uploads and their validation status.

    • file_size is a JSON number, not a numeric string.
    • The whole list in one response: every upload from the last 7 days, newest first. No paging.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": [
        {
          "id": "aaaaaaaa-0000-4000-8000-000000000002",
          "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
          "filename": "site-investigation-BH01.pdf",
          "file_path": "borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf",
          "file_size": 2458112,
          "content_type": "application/pdf",
          "status": "validated",
          "validation_error": null,
          "created_at": "2026-09-02T09:12:03.000Z",
          "expires_at": "2026-09-09T09:12:03.000Z",
          "page_count": 12
        }
      ]
    }

    Errors

    StatusCodeMeaning
    403SUBSCRIPTION_REQUIREDNo active Borehole Analysis Pro subscription.
    GET
    /uploads/{id}

    Read one upload. Poll this while the file is validated.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe uploadId returned by POST /uploads.
    • Validation checks size, type and, for PDFs, page count.
    • status is one of pending, uploaded, validated, failed. pending and uploaded are transitional; branch on validated or failed, never on the text of validation_error. (uploaded is declared in the type; validation writes validated or failed directly.)
    • On failed, validation_error carries the reason, for example "Document has 63 pages, exceeding the 50-page limit. Please split it into smaller files.", "Invalid file type. Allowed: pdf, png, jpg, jpeg, ags" or "File is empty".
    • file_size is null until the upload is validated.
    • page_count is the pages this upload uses from your allowance, set when validation completes. A job created from it reserves that figure; the charge at completion is the job's pages_consumed.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "id": "aaaaaaaa-0000-4000-8000-000000000002",
        "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
        "filename": "site-investigation-BH01.pdf",
        "file_path": "borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf",
        "file_size": 2458112,
        "content_type": "application/pdf",
        "status": "validated",
        "validation_error": null,
        "created_at": "2026-09-02T09:12:03.000Z",
        "expires_at": "2026-09-09T09:12:03.000Z",
        "page_count": 12
      }
    }

    Errors

    StatusCodeMeaning
    400VALIDATION_ERRORid is not a UUID.
    404UPLOAD_NOT_FOUNDUnknown upload, or it belongs to another account.

    Upload record fields

    FieldTypePresenceMeaning
    idstring (uuid)alwaysUpload identifier.
    user_idstring (uuid)alwaysInternal; not for client use.
    filenamestringalwaysOriginal filename.
    file_pathstringalwaysInternal; not for client use.
    file_sizenumber, nullablealways, nullableBytes; null until the upload is validated.
    content_typestring, nullableoptional, nullableDetected from the stored bytes.
    statusstringalwayspending, uploaded, validated or failed.
    validation_errorstring, nullableoptional, nullableFailure reason when status is failed.
    created_atstring (ISO 8601)alwaysWhen the upload was created.
    expires_atstring (ISO 8601)always7 days after created_at.
    page_countnumber, nullablealways, nullablePages this upload uses from your allowance; null until the upload is validated.
    DELETE
    /uploads/{id}

    Delete an upload and its stored file. Allowed at any time.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe uploadId.
    • Jobs created from the upload keep their data, exports and reports. Their Compare source and the original-logs report appendix become unavailable. A job still processing may fail or be incomplete.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "message": "Upload deleted successfully"
    }

    Errors

    StatusCodeMeaning
    404UPLOAD_NOT_FOUNDUnknown upload, or already deleted.
    500DELETE_FAILEDThe stored file could not be removed. Retry.

    Jobs

    POST
    /jobs

    Start processing a validated upload. Consumes quota once extraction succeeds.

    Request body

    NameTypeRequiredDescription
    uploadIdstring (uuid)yesAn upload whose status is validated.
    outputLanguagestringnoDefaults to "auto" (detect from the document). One of auto, en, de, fr, es, it, pt, nl, pl, sv, da, no, fi, cs, el, ro, hu.
    templateIdstring (uuid)noPre-selects a report template.
    • One upload can back several jobs. Re-posting the same uploadId creates a new jobId. There is no idempotency key.
    • queuePosition is 1-based: the number of pending jobs queued ahead of yours, plus one.
    • estimatedWait is queuePosition × 25 seconds. It is an estimate, not a guarantee.
    • template is null when you send no templateId; otherwise {"id","name","type"} for the template you named.

    Response

    HTTP/1.1 201 Created
    
    {
      "success": true,
      "data": {
        "jobId": "aaaaaaaa-0000-4000-8000-000000000003",
        "queuePosition": 1,
        "estimatedWait": 25,
        "template": null
      }
    }

    Errors

    StatusCodeMeaning
    400UPLOAD_NOT_READYThe upload is not validated yet. Body echoes uploadStatus and validationError.
    400FILE_NOT_FOUND_IN_S3The stored file is gone. Upload again.
    400TEMPLATE_NOT_FOUNDtemplateId is unknown or not available to you.
    404UPLOAD_NOT_FOUNDUnknown upload, or it belongs to another account.
    429QUOTA_EXCEEDEDMonthly page allowance and top-ups exhausted, and the usage meter is off. Body carries your counts.
    429CONCURRENCY_LIMIT_EXCEEDED2 jobs are already running.
    429QUEUE_LIMIT_EXCEEDED5 jobs are already queued.
    503QUEUE_UNAVAILABLEThe job could not be queued and nothing was created.
    GET
    /jobs

    List your jobs, newest first.

    Query parameters

    NameTypeRequiredDescription
    limitintegernoDefault 50, capped at 100.
    offsetintegernoDefault 0.
    • Default 50 per page, maximum 100. Page with offset until a page comes back shorter than limit. Jobs are deleted 7 days after creation, so the list never grows beyond that window.
    • This list omits the six heavy columns: extracted_data, extracted_data_original, report_content, ui_strings, grounding_map and section_map. When tracking several jobs, poll this list once rather than GET /jobs/{id} per job.
    • upload_id is the uploadId the job was created from. Use it to find jobs you may already have created for an upload.
    • boreholes_consumed is the number of boreholes charged to your allowance for this job, set when the job completes; null before completion.
    • pages_consumed is the number of pages charged to your allowance for this job, set when the job completes; null before completion.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "jobs": [
          {
            "id": "aaaaaaaa-0000-4000-8000-000000000003",
            "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
            "subscription_id": "aaaaaaaa-0000-4000-8000-000000000004",
            "org_app_subscription_id": null,
            "upload_id": "aaaaaaaa-0000-4000-8000-000000000002",
            "file_name": "site-investigation-BH01.pdf",
            "file_path": "borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf",
            "file_size": 2458112,
            "source_s3_key": null,
            "status": "completed",
            "progress": 100,
            "processing_time_ms": 168420,
            "error_message": null,
            "output_language": "auto",
            "detected_language": "en",
            "template_id": "a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071",
            "docx_report_s3_key": "reports/aaaaaaaa-0000-4000-8000-000000000003/a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071_report.docx",
            "report_status": "available",
            "report_language": "en",
            "report_progress": 100,
            "report_generated_at": "2026-09-02T09:17:44.000Z",
            "report_error_message": null,
            "version": 1,
            "boreholes_consumed": 2,
            "pages_consumed": 12,
            "created_at": "2026-09-02T09:13:00.000Z",
            "completed_at": "2026-09-02T09:16:12.000Z",
            "updated_at": "2026-09-02T09:17:44.000Z",
            "expires_at": "2026-09-09T09:13:00.000Z"
          }
        ]
      }
    }
    GET
    /jobs/{id}

    Read one job.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • status is one of pending, processing, completed, failed, terminal. terminal means the job exhausted its 3 processing attempts, or a worker died mid-processing and the job was reconciled at startup. Treat failed and terminal alike as final failure and read error_message.
    • error_message is free text, with no machine-readable code. Common values: "System pressure: …" (the server shed load), "This document is approximately 7 page(s), but you only have 3 remaining (45/200 monthly used, 2 reserved by other jobs). Please try a smaller document or purchase additional pages." (the document needs more allowance than you hold and the usage meter is off), "reconciled: worker died mid-processing", or the underlying failure text.
    • progress is 0–100.
    • output_language is the value you sent as outputLanguage, "auto" when you sent none. detected_language is the language extraction resolved for the job — the document language when outputLanguage is "auto" — and is null until extraction resolves it.
    • report_status tracks report generation separately from status, and is one of null, generating, available, failed. On failed, report_error_message carries the reason.
    • This response is the whole stored row: the columns GET /jobs returns plus extracted_data, extracted_data_original, report_content, ui_strings, grounding_map and section_map. On completion extracted_data holds the same payload GET /jobs/{id}/data returns. Until then the six heavy columns are null, so polling this endpoint for one job is cheap.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "job": {
          "id": "aaaaaaaa-0000-4000-8000-000000000003",
          "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
          "subscription_id": "aaaaaaaa-0000-4000-8000-000000000004",
          "org_app_subscription_id": null,
          "upload_id": "aaaaaaaa-0000-4000-8000-000000000002",
          "file_name": "site-investigation-BH01.pdf",
          "file_path": "borehole/aaaaaaaa-0000-4000-8000-000000000001/uploads/aaaaaaaa-0000-4000-8000-000000000002/site-investigation-BH01.pdf",
          "file_size": 2458112,
          "source_s3_key": null,
          "status": "processing",
          "progress": 45,
          "processing_time_ms": null,
          "error_message": null,
          "extracted_data": null,
          "extracted_data_original": null,
          "report_content": null,
          "ui_strings": null,
          "grounding_map": null,
          "section_map": null,
          "output_language": "auto",
          "detected_language": "en",
          "template_id": null,
          "docx_report_s3_key": null,
          "report_status": null,
          "report_language": null,
          "report_progress": null,
          "report_generated_at": null,
          "report_error_message": null,
          "version": 1,
          "boreholes_consumed": null,
          "pages_consumed": null,
          "created_at": "2026-09-02T09:13:00.000Z",
          "completed_at": null,
          "updated_at": "2026-09-02T09:13:00.000Z",
          "expires_at": "2026-09-09T09:13:00.000Z"
        }
      }
    }

    Errors

    StatusCodeMeaning
    400VALIDATION_ERRORid is not a UUID.
    404NOT_FOUND{"error":"Not found","message":"Job not found or access denied","code":"NOT_FOUND"}

    Job record fields

    FieldTypePresenceMeaning
    idstring (uuid)alwaysJob identifier.
    user_idstring (uuid)alwaysInternal; not for client use.
    subscription_idstring (uuid), nullablealways, nullableInternal; not for client use.
    org_app_subscription_idstring (uuid), nullablealways, nullableInternal; not for client use.
    upload_idstring (uuid)alwaysThe uploadId the job was created from.
    file_namestringalwaysOriginal filename.
    file_pathstringalwaysInternal; not for client use.
    file_sizenumberalwaysFile size in bytes.
    source_s3_keystring, nullablealways, nullableInternal; not for client use.
    statusstringalwayspending, processing, completed, failed or terminal.
    progressnumberalways0–100.
    processing_time_msnumber, nullableoptional, nullableExtraction duration once completed; null before.
    error_messagestring, nullablealways, nullableFailure reason. Free text, no code.
    extracted_dataobject, nullableoptional, nullableThe structured extraction result; see Extracted data. Null until completion.
    extracted_data_originalobject, nullableoptional, nullableThe extraction as originally produced, before edits. Powers the Compare feature.
    report_contentstring, nullableoptional, nullableThe generated report text. Read it via GET /jobs/{id}/report, not this field.
    ui_stringsobject, nullableoptional, nullableInternal; not for client use.
    grounding_mapobject, nullableoptional, nullableInternal; not for client use.
    section_mapobject, nullableoptional, nullableInternal; not for client use.
    output_languagestringalwaysThe value sent as outputLanguage, "auto" when none was sent.
    detected_languagestring, nullableoptional, nullableThe language extraction resolved for the job.
    template_idstring (uuid), nullableoptional, nullableThe report template in use, if any.
    docx_report_s3_keystring, nullablealways, nullableInternal; not for client use.
    report_statusstring, nullablealways, nullablenull, generating, available or failed.
    report_languagestring, nullableoptional, nullableThe language the report was rendered in.
    report_progressnumber, nullableoptional, nullable0–100 during report generation.
    report_generated_atstring (ISO 8601), nullableoptional, nullableSet when report_status becomes available.
    report_error_messagestring, nullableoptional, nullableFailure reason when report_status is failed.
    versionnumberalwaysInternal; not for client use.
    boreholes_consumednumber, nullableoptional, nullableBoreholes charged to your allowance for this job; null before completion.
    pages_consumednumber, nullableoptional, nullablePages charged to your allowance for this job; null before completion.
    created_atstring (ISO 8601)alwaysWhen the job was created.
    completed_atstring (ISO 8601), nullableoptional, nullableSet when the job reaches completed, failed or terminal.
    updated_atstring (ISO 8601)alwaysLast write to this row.
    expires_atstring (ISO 8601)always7 days after created_at.
    DELETE
    /jobs/{id}

    Delete a job and everything stored with it, including the upload it came from and the stored file. Quota already consumed is not returned.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • Other jobs created from the same upload keep their data; their Compare source and report appendix become unavailable.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "message": "Job deleted successfully"
    }

    Errors

    StatusCodeMeaning
    404NOT_FOUNDUnknown job, or it belongs to another account.
    POST
    /jobs/{id}/stream-ticket

    Mint a single-use ticket for the progress stream. Authenticated with your API key; the stream is authenticated with the ticket.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • expiresIn is 60 seconds. Mint the ticket immediately before you connect, not in advance.
    • A ticket that has never been connected still occupies one of your 4 stream slots until it expires.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "ticket": "9f2c81a04e7b46d3ab15c8f2740e6b93",
        "expiresIn": 60
      }
    }

    Errors

    StatusCodeMeaning
    404NOT_FOUNDUnknown job, or it belongs to another account.
    429STREAM_LIMIT_EXCEEDED{"error":"Too many concurrent streams","message":"Maximum 4 concurrent progress streams allowed.","code":"STREAM_LIMIT_EXCEEDED","retryAfter":60}
    GET
    /jobs/{id}/stream

    Server-Sent Events progress stream. Send the ticket in the query string; do not send your API key on this request.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.

    Query parameters

    NameTypeRequiredDescription
    ticketstringyesA 32-character ticket from POST /jobs/{id}/stream-ticket. Consumed on first connection.
    • Every event except report_progress and keep-alives also carries job, the full job record GET /jobs/{id} returns.

    Response (text/event-stream)

    HTTP/1.1 200 OK
    Content-Type: text/event-stream
    
    data: {"type":"init","job":{"id":"aaaaaaaa-0000-4000-8000-000000000003","status":"processing","progress":0}}
    
    # job abridged
    data: {"type":"progress","jobId":"aaaaaaaa-0000-4000-8000-000000000003","progress":45,"status":"processing","job":{ … }}
    
    # job abridged
    data: {"type":"extraction_complete","jobId":"aaaaaaaa-0000-4000-8000-000000000003","progress":100,"status":"completed","job":{ … }}
    
    : keep-alive

    Errors

    StatusCodeMeaning
    401INVALID_STREAM_TICKETMissing, expired, already-used, or wrong-job ticket.
    404NOT_FOUNDJob not found or access denied.

    Data & exports

    GET
    /jobs/{id}/data

    The structured extraction result for a completed job, including any edits made to it since.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • Field by field: see Extracted data.
    • boreholes and extractionMetadata are always present. projectInfo, siteDescription, unattributedLaboratoryTests and dataAvailability are optional.
    • Depths and elevations carry no unit of their own. Read extractionMetadata.unitSystem first ("metric" = metres, "imperial" = feet) and apply it to every depth in the payload. There is no thickness field; thickness is depthTo − depthFrom.
    • Before extraction finishes this returns 404, not a 4xx naming the job state. Branch on GET /jobs/{id}.status instead.
    • These three 404s share the code NOT_FOUND. Do not parse message; check GET /jobs/{id}.status. A completed job with no data is a support case.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "extractedData": {
          "boreholes": [],
          "extractionMetadata": {
            "confidence": 0.92,
            "model": "eu.anthropic.claude-haiku-4-5-20251001-v1:0",
            "promptVersion": "v7.0.1",
            "unitSystem": "metric"
          }
        }
      }
    }

    Errors

    StatusCodeMeaning
    404NOT_FOUND{"error":"Not found","message":"Data not ready. Job is still processing.","code":"NOT_FOUND"} while the job is not completed.
    404NOT_FOUNDmessage "No extracted data available" — the job completed but stored nothing.
    404NOT_FOUNDmessage "Job not found or access denied" — unknown job, or it belongs to another account.
    GET
    /jobs/{id}/export/ags

    Build an AGS4 file from the job and return a download URL for it.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • downloadUrl is a direct storage link valid for 24 hours. Fetch it without an Authorization header.
    • The file is UTF-8 with CRLF line endings and no byte-order mark.
    • filename is {ProjectStub}-{jobIdPrefix}_data_export.{ext} — up to 6 alphanumeric characters from projectInfo.projectName (or "Export" when it is absent) plus the first 5 characters of the jobId. The URL’s object name differs.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/exports/aaaaaaaa-0000-4000-8000-000000000003/v1/data_export.ags?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091640Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=2e5b90c1a7d34f68b012e9d5c8a4f37160bd29e4c5017a8f3b6d90c2e478a15b",
        "filename": "Northg-aaaaa_data_export.ags",
        "groupsGenerated": ["PROJ","TRAN","LOCA","GEOL","SAMP","GCHM","WSTD"]
      }
    }

    Errors

    StatusCodeMeaning
    400JOB_NOT_COMPLETEDExtraction has not finished. Body echoes currentStatus.
    400NO_EXTRACTED_DATAThe job holds no data to export.
    403ACCESS_DENIEDThe job belongs to another account.
    404JOB_NOT_FOUNDUnknown job.
    500EXPORT_ERRORExport generation failed.
    GET
    /jobs/{id}/export/csv

    Build a ZIP of CSV tables from the job and return a download URL for it.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • downloadUrl is a direct storage link valid for 24 hours. Fetch it without an Authorization header.
    • Each CSV inside the ZIP is UTF-8 with a leading byte-order mark and CRLF line endings.
    • Every CSV table has two header lines: the column headings, then a units row — the unit under each column that has one, blank elsewhere.
    • in_situ_tests.csv: one row per test result. Borehole_ID, Test_Type, Depth, Sample_ID, Sample_Type; the SPT columns (N_Value, Blow_Counts, Seating_Blows, Main_Blows, Recovery_Percent, Condition, Sample_Description); one column per field test present, headed by the test name (Pocket_Penetrometer, …); Depth_Unit. A row fills only its own test's columns.
    • laboratory_tests.csv: one row per record. Borehole_ID, Sample_ID, Sample_Depth, Test_Type, Test_Method, Sample_Type; one column per result key of each test type present, headed Test_Type.key (Atterberg_Limits.liquidLimit); Depth_Unit.
    • geological_layers.csv, borehole_locations.csv, groundwater.csv, project_info.csv: the columns as before, with the units row showing the depth unit under every depth, elevation and water-level column.
    • filename is {ProjectStub}-{jobIdPrefix}_data_export.{ext} — up to 6 alphanumeric characters from projectInfo.projectName (or "Export" when it is absent) plus the first 5 characters of the jobId. The URL’s object name differs.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/exports/aaaaaaaa-0000-4000-8000-000000000003/v1/data_export.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091645Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=51a0c73de8b924f6017cd35ba9e4820f6d3b17ce095a2f84b60d1e7392ca4058",
        "filename": "Northg-aaaaa_data_export.zip",
        "filesIncluded": ["project_info.csv","borehole_locations.csv","geological_layers.csv"]
      }
    }

    Errors

    StatusCodeMeaning
    400JOB_NOT_COMPLETEDExtraction has not finished. Body echoes currentStatus.
    400NO_EXTRACTED_DATAThe job holds no data to export.
    403ACCESS_DENIEDThe job belongs to another account.
    404JOB_NOT_FOUNDUnknown job.
    500EXPORT_ERRORExport generation failed.
    GET
    /jobs/{id}/export/json

    Build a JSON file from the job and return a download URL for it.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • downloadUrl is a direct storage link valid for 24 hours. Fetch it without an Authorization header.
    • The file is UTF-8 with no byte-order mark.
    • filename is {ProjectStub}-{jobIdPrefix}_data_export.{ext} — up to 6 alphanumeric characters from projectInfo.projectName (or "Export" when it is absent) plus the first 5 characters of the jobId. The URL’s object name differs.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/exports/aaaaaaaa-0000-4000-8000-000000000003/v1/data_export.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091649Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=b840c15e73d92a6f0148ce5b3fa27d906e14b8c25703df9a1b6e0c48532ad7f61",
        "filename": "Northg-aaaaa_data_export.json",
        "sectionsIncluded": ["project_info","borehole_locations","geological_layers","groundwater","laboratory_tests"]
      }
    }

    Errors

    StatusCodeMeaning
    400JOB_NOT_COMPLETEDExtraction has not finished. Body echoes currentStatus.
    400NO_EXTRACTED_DATAThe job holds no data to export.
    403ACCESS_DENIEDThe job belongs to another account.
    404JOB_NOT_FOUNDUnknown job.
    500EXPORT_ERRORExport generation failed.

    Reports & templates

    GET
    /templates

    List the report templates available to you: shared templates plus your own.

    • styles is the template’s extracted look: fonts, colors, headingStyles, paragraphStyle, pageLayout and tableStyle.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": [
        {
          "id": "a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071",
          "name": "Modern Professional",
          "description": "Clean layout for client-facing reports",
          "template_type": "system",
          "thumbnail_key": "thumbnails/system/modern-professional.png",
          "thumbnail_url": "https://smartcivilapps.com/thumbnails/system/modern-professional.png",
          "styles": {
            "fonts": { "heading": "Calibri", "body": "Calibri" },
            "colors": { "primary": "#1F4E79", "heading": "#1F4E79", "text": "#212121" },
            "headingStyles": {
              "h1": { "fontSize": 18, "bold": true, "color": "#1F4E79" },
              "h2": { "fontSize": 14, "bold": true, "color": "#1F4E79" },
              "h3": { "fontSize": 12, "bold": true }
            },
            "paragraphStyle": { "fontSize": 11, "lineSpacing": 1.15, "alignment": "justify" },
            "pageLayout": {
              "size": "A4",
              "orientation": "portrait",
              "margins": { "top": 25, "right": 20, "bottom": 25, "left": 25 }
            },
            "tableStyle": { "headerBackground": "#1F4E79", "headerColor": "#FFFFFF", "borderColor": "#BFBFBF" }
          },
          "usage_count": 128,
          "created_at": "2026-01-14T10:02:11.000Z"
        }
      ]
    }
    POST
    /jobs/{id}/generate-report

    Queue report generation for a completed job. Returns immediately.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.

    Request body

    NameTypeRequiredDescription
    templateIdstring (uuid)noA template id from GET /templates. Defaults to the job's existing template, then to the default shared template.
    reportLanguagestringnoDefaults to the job's output language. One of en, de, fr, es, it, pt, nl, pl, sv, da, no, fi, cs, el, ro, hu.
    • Poll GET /jobs/{id} and watch report_status until it is available, then fetch the file from GET /jobs/{id}/docx-url.
    • Calling this again on a job whose report_status is available regenerates the report.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "reportStatus": "generating",
        "templateId": "a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071",
        "reportLanguage": "en"
      }
    }

    Errors

    StatusCodeMeaning
    403ACCESS_DENIEDThe job belongs to another account.
    404JOB_NOT_FOUNDUnknown job.
    404VALIDATION_ERRORTemplate not found or not available to you. The nested code is VALIDATION_ERROR even though the status is 404.
    409INVALID_STATEExtraction has not finished, or a report is already being generated.
    500INTERNAL_ERRORNo default template is configured, or the report could not be queued.
    GET
    /jobs/{id}/report

    Read the generated report content for a job.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • data.report is a string — the job’s stored report text, not an object. Its internal structure is not part of the v1 contract; for the formatted document use GET /jobs/{id}/docx-url.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "report": "# Northgate Interchange Ground Investigation\n\n## 1. Executive Summary\n\nTwo cable-percussion boreholes were sunk to 12.5 m and 10.0 m below existing ground level.\n"
      }
    }

    Errors

    StatusCodeMeaning
    404NOT_FOUND{"error":"Not found","message":"Report not ready. Job is still processing.","code":"NOT_FOUND"}
    404NOT_FOUNDmessage "No report available" — the job completed but no report has been generated.
    404NOT_FOUNDmessage "Job not found or access denied" — unknown job, or it belongs to another account.
    GET
    /jobs/{id}/docx-url

    Get a download URL for the generated .docx report.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.
    • expiresIn is in seconds — the URL is valid for 24 hours. Fetch it without an Authorization header.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/reports/aaaaaaaa-0000-4000-8000-000000000003/a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071_report.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T091755Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=6c02f9a41d7b385e0ca6b1f294d80e37519bd6ac0834e7f21b95c0d6a4e8371f",
        "expiresIn": 86400,
        "format": "docx",
        "templateId": "a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071"
      }
    }

    Errors

    StatusCodeMeaning
    400JOB_NOT_COMPLETEDExtraction has not finished. Body echoes currentStatus.
    403ACCESS_DENIEDThe job belongs to another account.
    404JOB_NOT_FOUNDUnknown job.
    404DOCX_NOT_AVAILABLENo report has been generated for this job yet.
    POST
    /jobs/{id}/regenerate-with-template

    Rebuild the .docx for a job that already has a report, using a different template. Reuses the extraction; consumes no quota.

    Path parameters

    NameTypeRequiredDescription
    idstring (uuid)yesThe jobId.

    Request body

    NameTypeRequiredDescription
    templateIdstring (uuid)yesA template id from GET /templates.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/reports/aaaaaaaa-0000-4000-8000-000000000003/a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071_report.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T092012Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=af37105c8e2b64d90371fb5a2c8e40d61b9a7c0524ef836b1d0a97c4e582b361",
        "templateId": "a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071",
        "templateName": "Modern Professional",
        "reportId": "aaaaaaaa-0000-4000-8000-000000000007",
        "generationTimeMs": 4820
      }
    }

    Errors

    StatusCodeMeaning
    403ACCESS_DENIEDThe job belongs to another account.
    404JOB_NOT_FOUNDUnknown job.
    404VALIDATION_ERRORTemplate not found or not available to you. The nested code is VALIDATION_ERROR even though the status is 404.
    409INVALID_STATEThe job has no report yet, one is already being generated, or extraction has not finished.
    500INTERNAL_ERRORThe rebuild failed; report_status is set to failed.
    POST
    /jobs/{jobId}/reports

    Build a report synchronously and return its download URL in the same response.

    Path parameters

    NameTypeRequiredDescription
    jobIdstring (uuid)yesThe jobId.

    Request body

    NameTypeRequiredDescription
    templateIdstring (uuid)yesA template id from GET /templates.
    formatstringyesEither "pdf" or "docx".
    • The path parameter is {jobId} on this endpoint, {id} everywhere else.
    • data carries its own success field. Read data.downloadUrl, not data.success.
    • cached is true when the same job, template and format were built before and the stored file was reused.
    • The URL grants access to the file until it expires. Treat it as a secret: do not log or share it.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "success": true,
        "reportId": "aaaaaaaa-0000-4000-8000-000000000007",
        "downloadUrl": "https://smartcivilapps.com.s3.eu-central-1.amazonaws.com/reports/aaaaaaaa-0000-4000-8000-000000000003/a1b2c3d4-5e6f-4708-9a1b-2c3d4e5f6071_report.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAEXAMPLE1234567%2F20260902%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20260902T092310Z&X-Amz-Expires=86400&X-Amz-SignedHeaders=host&X-Amz-Signature=d51ca8067b23e9f4105d7c6b28a3ef90417c5b6d0e82a39f7b1450c6de297a38",
        "cached": false,
        "generationTimeMs": 4820
      }
    }

    Errors

    StatusCodeMeaning
    400BAD_REQUEST"Template ID is required", or format is not "pdf" or "docx".
    400BAD_REQUESTThe job has no extracted data or report content yet (message "Job data incomplete - missing extracted_data or report_content").
    403FORBIDDENThe job belongs to another account.
    404NOT_FOUNDUnknown job or template.
    500INTERNAL_ERROR"Failed to generate report".

    Account

    GET
    /usage

    Your allowance for the current month.

    • Remaining capacity is pages_remaining + topup_remaining.
    • documents_processed counts files; boreholes_processed counts boreholes.
    • month_year is the current UTC calendar month. Counters reset because a new month starts a new record: on 1 October at 00:00 UTC, documents_processed, boreholes_processed and pages_processed read 0 again. The response carries no reset timestamp — next_expiry is a top-up expiry date, not a monthly reset.
    • meter_on is true while the usage meter is switched on in the web application. With the meter on, jobs are not refused for lack of pages: the pages used after pages_remaining and topup_remaining are spent are counted in metered_pages and billed monthly to your saved card. metered_pages and metered_amount are this month's figures and read 0 when no pages have been metered this month.
    • On an organisation seat the administrator of your organisation switches the meter on, meter_on and metered_pages are as above, and metered_amount is always 0: your organisation is invoiced for the metered pages and no amount is billed to you.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "usage": {
          "id": "aaaaaaaa-0000-4000-8000-000000000005",
          "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
          "subscription_id": "aaaaaaaa-0000-4000-8000-000000000004",
          "org_app_subscription_id": null,
          "documents_processed": 12,
          "boreholes_processed": 47,
          "pages_processed": 94,
          "total_cost_cents": 913,
          "page_limit": 200,
          "pages_remaining": 106,
          "month_year": "2026-09",
          "topup_total": 100,
          "topup_used": 0,
          "topup_remaining": 100,
          "topup_packages": [
            {
              "id": "aaaaaaaa-0000-4000-8000-000000000006",
              "pages_total": 100,
              "pages_used": 0,
              "pages_remaining": 100,
              "purchased_at": "2026-08-01T00:00:00.000Z",
              "expires_at": "2027-08-01T00:00:00.000Z"
            }
          ],
          "next_expiry": { "date": "2027-08-01T00:00:00.000Z", "pages_expiring": 100 },
          "meter_on": false,
          "metered_pages": 0,
          "metered_amount": 0,
          "created_at": "2026-09-01T00:04:12.000Z",
          "updated_at": "2026-09-02T09:16:12.000Z"
        }
      }
    }

    Usage record fields

    FieldTypePresenceMeaning
    idstring (uuid)optionalInternal; not for client use. Present once a usage row exists for the month.
    user_idstring (uuid)optionalInternal; not for client use.
    subscription_idstring (uuid), nullableoptional, nullableInternal; not for client use.
    org_app_subscription_idstring (uuid), nullableoptional, nullableInternal; not for client use.
    documents_processednumberalwaysFiles processed this month.
    boreholes_processednumberalwaysBoreholes processed this month.
    pages_processednumberalwaysPages used this month from your monthly allowance.
    total_cost_centsnumberalwaysInternal; not for client use.
    page_limitnumberalwaysYour monthly allowance, in pages: 200 unless your plan includes more.
    pages_remainingnumberalwaysPages left in the monthly allowance.
    month_yearstringalwaysThe current UTC calendar month, "YYYY-MM".
    created_atstring (ISO 8601), nullableoptional, nullablePresent once a usage row exists for the month.
    updated_atstring (ISO 8601), nullableoptional, nullablePresent once a usage row exists for the month.
    topup_totalnumberalwaysTotal top-up pages purchased and not yet expired.
    topup_usednumberalwaysTop-up pages consumed.
    topup_remainingnumberalwaystopup_total minus topup_used.
    topup_packagesarrayalwaysOne entry per active top-up package.
    next_expiryobject, nullablealways, nullableDate and count of the next top-up pages to expire; null when none are due.
    meter_onbooleanalwaystrue while your usage meter is switched on. With it on, pages beyond your monthly allowance and top-ups are metered and billed, and QUOTA_EXCEEDED is not returned. On an organisation seat the administrator of your organisation switches the meter on.
    metered_pagesnumberalwaysPages metered this month: the pages used beyond your monthly allowance and top-ups while the meter was on. On an organisation seat these pages are invoiced to your organisation.
    metered_amountnumberalwaysThe amount for metered_pages this month at the meter rate in force when each page was counted, in the currency of your subscription. Billed monthly to your saved card. Always 0 on an organisation seat: your organisation is invoiced for the metered pages and no amount is billed to you.
    GET
    /topup

    Your top-up package balances and the current top-up price. Top-ups are bought in the web application, not through this API.

    • topup_price is the administrator-set price per top-up in topup_currency, and is null when no price is configured. topup_currency falls back to "EUR".

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "topup": {
          "topup_total": 100,
          "topup_used": 0,
          "topup_remaining": 100,
          "topup_packages": [
            {
              "id": "aaaaaaaa-0000-4000-8000-000000000006",
              "pages_total": 100,
              "pages_used": 0,
              "pages_remaining": 100,
              "purchased_at": "2026-08-01T00:00:00.000Z",
              "expires_at": "2027-08-01T00:00:00.000Z"
            }
          ],
          "next_expiry": { "date": "2027-08-01T00:00:00.000Z", "pages_expiring": 100 },
          "topup_price": null,
          "topup_currency": "EUR"
        }
      }
    }
    GET
    /subscription

    Your Borehole Analysis Pro access.

    • via is "individual" for a personal subscription or "organization" for an organisation seat. id is null on a personal subscription. org_name is sent only for a seat; grace_period_days_remaining only for a seat whose organisation is in a billing grace period. grace_type is sent only while a grace period applies, extras_grace_days_remaining only with grace_type extras_addition; grace_type extras_addition means only extra pages may be removed.
    • status is always "active" — the endpoint returns 404 when you have no access.
    • pending_payment_status is null, "retry" — access continues while a failed renewal payment is retried — or "awaiting_authentication" — a bank authentication is outstanding.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "subscription": {
          "id": null,
          "user_id": "aaaaaaaa-0000-4000-8000-000000000001",
          "status": "active",
          "expires_at": "2027-01-31T23:59:59.000Z",
          "via": "individual",
          "in_grace_period": false,
          "pending_payment_status": null
        }
      }
    }

    Errors

    StatusCodeMeaning
    404NOT_FOUND{"error":"Not found","message":"No active borehole subscription found","code":"NOT_FOUND"}
    GET
    /languages

    The output languages you can pass as outputLanguage or reportLanguage.

    • auto is included, for outputLanguage only. reportLanguage takes this list without auto.

    Response

    HTTP/1.1 200 OK
    
    {
      "success": true,
      "data": {
        "languages": [
          { "code": "auto", "name_english": "Auto-detect", "name_native": "Auto-detect" },
          { "code": "en", "name_english": "English", "name_native": "English" },
          { "code": "de", "name_english": "German", "name_native": "Deutsch" }
          # abridged — 14 more languages
        ]
      }
    }

    Live progress

    Progress as Server-Sent Events, in two steps: mint a ticket with your API key, then open the stream with that ticket in the query string.

    # 1. Mint a ticket with your key. It lasts 60 seconds and is used once.
    curl -s -X POST https://api.smartcivilapps.com/api/v1/borehole/jobs/aaaaaaaa-0000-4000-8000-000000000003/stream-ticket \
      -H "Authorization: Bearer $SCA_API_KEY"
    
    {"success":true,"data":{"ticket":"9f2c81a04e7b46d3ab15c8f2740e6b93","expiresIn":60}}
    
    # 2. Open the stream with the ticket. No Authorization header on this request.
    curl -N "https://api.smartcivilapps.com/api/v1/borehole/jobs/aaaaaaaa-0000-4000-8000-000000000003/stream?ticket=9f2c81a04e7b46d3ab15c8f2740e6b93"
    
    data: {"type":"init","job":{"id":"aaaaaaaa-0000-4000-8000-000000000003","status":"processing","progress":0}}
    
    # job abridged
    data: {"type":"progress","jobId":"aaaaaaaa-0000-4000-8000-000000000003","progress":45,"status":"processing","job":{ … }}
    
    # job abridged
    data: {"type":"extraction_complete","jobId":"aaaaaaaa-0000-4000-8000-000000000003","progress":100,"status":"completed","job":{ … }}
    
    : keep-alive
    • A ticket lasts 60 seconds and is consumed by the first connection. Reusing it returns 401.
    • Up to 4 streams per account may be open at once. A minted-but-unused ticket holds a slot until it lapses; a 5th mint returns 429 STREAM_LIMIT_EXCEEDED.
    • The server never closes the stream — after the last event it keeps sending : keep-alive comment lines every 30 seconds. Detect completion yourself and disconnect.
    • extraction_complete does not carry the extracted data. Fetch it from GET /jobs/{id}/data when you see it.

    Event types

    typeMeaning
    initAlways the first event. Carries job, the current job record.
    progressExtraction advanced. Carries jobId, progress, status and job.
    extraction_completeExtraction finished successfully. Fetch the data and disconnect.
    extraction_failedExtraction failed. Read error_message on the job.
    report_progressReport generation advanced.
    report_completeThe report is ready. Fetch it from GET /jobs/{id}/docx-url.
    report_failedReport generation failed.

    Ignore any type you do not recognise.

    Limits

    LimitValueWhat happensHow to recover
    Requests per API key120 per minute429 RATE_LIMIT_EXCEEDED with retryAfter in secondsSleep for retryAfter, then continue.
    Upload requests30 per hour per account429 RATE_LIMIT_EXCEEDED on POST /uploads, with retryAfterSleep for retryAfter.
    Jobs running at once2 per account429 CONCURRENCY_LIMIT_EXCEEDED (no retryAfter)Wait for a running job to finish, then submit the next one.
    Jobs queued5 per account429 QUEUE_LIMIT_EXCEEDED (no retryAfter)Drain the queue before submitting more.
    Monthly pagespage_limit from GET /usage (200 unless your plan includes more), counted per page429 QUOTA_EXCEEDED, with pagesUsed, pageLimit, remaining, topupRemaining and monthYear. Not returned while the usage meter is on: the pages beyond your allowance and top-ups are metered and billed.Buy top-ups, switch the usage meter on in the web application (on an organisation seat, ask the administrator of your organisation), or wait for the next month. Never retry this in a loop.
    Concurrent progress streams4 per account429 STREAM_LIMIT_EXCEEDED with retryAfter 60Close a stream you no longer need, or wait 60 seconds for unused tickets to lapse.
    Active API keys5 per subscriptionKey creation is refused on the API Keys pageRevoke a key you no longer use, then create the new one.
    Rejected key attemptsLimited per address429 "Too many invalid API key attempts from this address"Fix the credential. Valid keys keep working from that address; only unknown keys are refused.
    Stream ticket lifetime60 seconds, single use401 INVALID_STREAM_TICKETMint a fresh ticket immediately before opening the connection.
    Upload URL lifetime5 minutesThe PUT to storage returns 403 with an XML bodyRequest a new upload URL. That costs one of your 30 uploads per hour.
    File size10 MB per file400 VALIDATION_ERROR on POST /uploads, or the upload is marked failedSplit or compress the document.
    Page count50 pages per PDF (50 passes, 51 is rejected)The upload reaches status failed with the page count in validation_errorSplit the document into smaller files.
    Result retention7 days per jobThe job, its exports and its source document are permanently deletedStore results in your own system as soon as a job completes. Nothing is recoverable afterwards.

    The blanket per-address limiter sends RateLimit-Policy, RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset on every response, plus Retry-After on a 429. The per-key limit, the upload limit and the stream cap send no headers — read retryAfter from the JSON body.

    Errors

    Every error response carries a code and a message. Match on code, never on message text. Where error is an object, its code is the specific one. Every response also carries the same id in the X-Request-Id header, and unmatched routes and unhandled errors repeat it as requestId in the body.

    # Most errors are flat:
    {
      "error": "Too many requests",
      "message": "Maximum 120 requests per minute per key.",
      "code": "RATE_LIMIT_EXCEEDED",
      "retryAfter": 57
    }
    
    # The report endpoints nest theirs. The top-level code comes from the
    # HTTP status; the nested code is the specific one.
    {
      "success": false,
      "error": {
        "code": "VALIDATION_ERROR",
        "message": "Template not found or access denied"
      },
      "code": "NOT_FOUND"
    }
    
    # Validation failures itemise every problem:
    {
      "error": "Validation failed",
      "message": "The provided data is invalid",
      "code": "VALIDATION_ERROR",
      "details": [
        { "field": "filename", "message": "Invalid file extension. Allowed: pdf, png, jpg, jpeg, ags", "code": "invalid_string" }
      ],
      "target": "body"
    }

    Error codes

    CodeStatusMeaningWhat to do
    MISSING_API_KEY401No usable Authorization: Bearer sca_… header on the request.Add the header. Never retry.
    INVALID_API_KEY401The key is unknown or has been revoked.Issue a new key. Never retry.
    API_KEY_SUBSCRIPTION_INACTIVE401The subscription behind the key is not currently active.Stop; contact us via the Contact button or info@smartcivilapps.com, quoting the X-Request-Id. Never retry.
    USER_NOT_FOUND401The account behind the key no longer exists.Stop; contact us via the Contact button or info@smartcivilapps.com, quoting the X-Request-Id. Never retry.
    USER_INACTIVE401The account is not active.Stop; contact us via the Contact button or info@smartcivilapps.com, quoting the X-Request-Id. Never retry.
    EMAIL_NOT_VERIFIED401The account email address is unverified.Complete verification in the web application. Never retry.
    INVALID_STREAM_TICKET401Stream ticket missing, expired, already used, or minted for a different job.Mint a new ticket and reconnect.
    SUBSCRIPTION_REQUIRED403No active Borehole Analysis Pro subscription.Stop; contact us via the Contact button or info@smartcivilapps.com, quoting the X-Request-Id. Never retry.
    ACCESS_DENIED403The job belongs to another account.Check the id. Never retry.
    FORBIDDEN403On POST /jobs/{jobId}/reports: the job belongs to another account.Check the id. Never retry.
    VALIDATION_ERROR400A path parameter or body field failed validation. details[] itemises each failure.Fix the request and resend. Never retry unchanged.
    VALIDATION_ERROR404On generate-report and regenerate-with-template: the template was not found or is not available to you. The status is 404; the nested code is VALIDATION_ERROR.Pick an id from GET /templates. Never retry unchanged.
    BAD_REQUEST400On POST /jobs/{jobId}/reports: templateId is missing, or format is not "pdf" or "docx".Fix the request and resend. Never retry unchanged.
    UPLOAD_NOT_READY400The upload is not validated yet; uploadStatus and validationError are echoed back.Keep polling GET /uploads/{id}.
    FILE_NOT_FOUND_IN_S3400The uploaded file is no longer in storage.Start again from POST /uploads. Never retry unchanged.
    TEMPLATE_NOT_FOUND400templateId is unknown or not available to you.Pick an id from GET /templates. Never retry unchanged.
    JOB_NOT_COMPLETED400An export or docx-url was requested before extraction finished. currentStatus is echoed back.Keep polling GET /jobs/{id}.
    NO_EXTRACTED_DATA400The job holds no data to export.Check the job did not fail. Never retry unchanged.
    UPLOAD_NOT_FOUND404Unknown upload, or it belongs to another account.Check the id. Never retry.
    JOB_NOT_FOUND404Unknown job, or it belongs to another account.Check the id. Never retry.
    NOT_FOUND404The requested job, data, report or subscription does not exist or is not ready. Read message.Check the id, or keep polling if you expect it to appear.
    DOCX_NOT_AVAILABLE404No report has been generated for this job yet.Call POST /jobs/{id}/generate-report first.
    INVALID_STATE409The job is not in a state that allows this call.Read message; wait for the job or report to finish, then call again.
    RATE_LIMIT_EXCEEDED429A rate limit was hit — per-key requests, uploads per hour, or rejected key attempts.Sleep retryAfter seconds (15 if absent), then retry.
    QUOTA_EXCEEDED429Monthly page allowance and top-ups exhausted, and the usage meter is off.Not waitable. Stop. Buy top-ups, switch the usage meter on in the web application (on an organisation seat, ask the administrator of your organisation), or wait for the next month.
    CONCURRENCY_LIMIT_EXCEEDED4292 jobs are already running.Not waitable. Wait on a job you already have in flight.
    QUEUE_LIMIT_EXCEEDED4295 jobs are already queued.Not waitable. Wait on a job you already have in flight.
    STREAM_LIMIT_EXCEEDED4294 progress streams are already open or reserved.Sleep retryAfter (60) seconds, then retry, or close a stream.
    UPLOAD_URL_GENERATION_FAILED500The storage URL could not be generated.Retry up to 3 times, backing off 1, 2 then 4 seconds.
    QUEUE_UNAVAILABLE503On POST /jobs: the job could not be queued; nothing was created.Retry up to 3 times, backing off 1, 2 then 4 seconds.
    EXPORT_ERROR500Export generation failed.Retry up to 3 times, backing off 1, 2 then 4 seconds. Then contact us via the Contact button or info@smartcivilapps.com, quoting the X-Request-Id.
    INTERNAL_ERROR500Unexpected server error.Retry up to 3 times, backing off 1, 2 then 4 seconds. On POST /jobs, list jobs for the uploadId first.
    NOT_FOUND404Unknown path or method: {"error":"API endpoint not found","message":…,"requestId":…,"code":"NOT_FOUND"}.Check the path and method. Never retry.

    Retry guidance

    • 401 — never retry.
    • Other 4xx — never resend unchanged. Three are retried by waiting for a state change, not by resending: UPLOAD_NOT_READY, JOB_NOT_COMPLETED and INVALID_STATE — poll the resource and call again when its status moves.
    • 429 — sleep for retryAfter seconds, 15 if it is absent, then retry. Except QUOTA_EXCEEDED, CONCURRENCY_LIMIT_EXCEEDED and QUEUE_LIMIT_EXCEEDED, which are not waitable: stop, and act on the cause.
    • 5xx — retry up to 3 times, backing off 1, 2 then 4 seconds.
    • Never retry POST /jobs after a 5xx without first listing jobs for that uploadId. There is no idempotency key, so a blind retry can create a second job and consume the allowance twice.
    • Set a client timeout of about 30 seconds on the synchronous calls. Extraction is asynchronous: do not time it out on the client, poll instead.

    Version

    This is v1.5, at /api/v1/borehole. The path version stays v1. The minor version changes when a field is renamed or removed; new fields may appear without one. Every change is listed in the changelog.

    Changelog

    • 1.5 — 19 October 2026. GET /usage on an organisation seat: meter_on is true while the administrator of your organisation has switched the usage meter on for you, and 429 QUOTA_EXCEEDED is not returned then; metered_pages is the pages you used beyond your monthly allowance and top-ups this month; metered_amount is always 0 — your organisation is invoiced for metered pages and no amount is billed to you. Personal subscriptions are unchanged.
    • 1.4 — 13 October 2026. GET /usage: meter_on, metered_pages and metered_amount report your usage meter. While the meter is on, pages beyond your monthly allowance and any top-ups are counted as metered pages and billed monthly to your saved card, and 429 QUOTA_EXCEEDED is not returned: a job is not refused, and does not fail, for lack of pages. The meter is switched on and off in the web application and covers every job of the subscription, including jobs made with an API key. With the meter off nothing changes.
    • 1.3 — 9 October 2026. GET /usage: page_limit is your own monthly allowance — 200 unless your plan includes extra pages; pages_processed counts the pages you used from it this month, pages_remaining follows. 429 QUOTA_EXCEEDED: pageLimit and pagesUsed follow the same. GET /subscription: grace_type ("access" or "extras_addition") is sent while a grace period applies, extras_grace_days_remaining only with grace_type extras_addition; extras_addition means only your extra pages may be removed — in_grace_period is unchanged.
    • 1.2, N values — 5 October 2026. SPT nValue: where the log prints no N, the system computes it from the blow counts by their form. blowCounts are written with hyphens. CSV/JSON Seating_Blows and Main_Blows, AGS4 ISPT_SEAT and ISPT_MAIN: the seating and main (test) drive blows by the same reading.
    • 1.2, new fields — 5 October 2026. SPT entries carry sampleDescription: the part of the layer's description that applies to the sample, or null. CSV export: in_situ_tests.csv has Sample_Description. AGS4 export: SAMP carries SAMP_DESC; GEOL_DESC and SAMP_DESC are written in ASCII, line breaks as "; ".
    • 1.2 — 22 September 2026. Laboratory records sit under their borehole: boreholes[].laboratoryTests, each record's boreholeId nullable; records no borehole claimed are in unattributedLaboratoryTests; the job-wide laboratoryTests list is removed. SPT, in-situ testing and laboratory entries carry units and units_inferred. GET /subscription: pending_payment_status. CSV export: every table has a units row under its headings; in_situ_tests.csv has one column block per test and laboratory_tests.csv one row per record with one block per test type — the Units, Parameter_Name, Value, Unit and Unit_Inferred columns are gone.
    • 1.1 — 8 September 2026. The allowance is metered in document pages, 200 per month, instead of boreholes. GET /usage: page_limit, pages_remaining and pages_processed replace borehole_limit and boreholes_remaining; documents_processed and boreholes_processed are unchanged. GET /usage and GET /topup: top-up packages carry pages_total, pages_used, pages_remaining instead of boreholes_total, boreholes_used, boreholes_remaining; next_expiry.pages_expiring replaces boreholes_expiring; a top-up is 200 pages. Jobs: pages_consumed. Uploads: page_count. 429 QUOTA_EXCEEDED: pagesUsed and pageLimit replace boreholesUsed and boreholeLimit. Existing balances were converted at 100 boreholes = 200 pages.
    • 1.0 — 4 September 2026. First release.
    Feedback