REST API

Automate scans and read results with the Webforta API.

The API is available on Pro and Business plans. Create keys under API keys. Keys are scoped (read, scan), can expire, and are shown only once.

Authentication

curl -H "Authorization: Bearer wf_xxxxxxxx_..." https://webforta.com/api/v1/websites

Endpoints

  • GET /api/v1/websites - list websites (scope: read)
  • GET /api/v1/websites/{id} - website detail with open finding counts (read)
  • GET /api/v1/websites/{id}/scans - scan history, paginated with ?page= and ?per_page= (read)
  • POST /api/v1/websites/{id}/scans - start a scan on a verified website; returns 202 (scan)
  • GET /api/v1/scans/{id} - scan status, observations and findings (read)

Errors and limits

Errors use JSON: {"error": {"code": "...", "message": "..."}}. Each key is limited to 300 requests per 5 minutes; scan starts share your organization’s scan limits and monthly quota.

Scan after every deploy (GitHub Actions)

Start a scan when your site is deployed and fail the pipeline if it finds anything critical or high. Create a key with the read and scan scopes, store it as the repository secret WEBFORTA_API_KEY, and put the website ID (from the website's address in the dashboard, starting with web_) in WEBFORTA_WEBSITE_ID. Findings you marked as accepted risk or false positive do not fail the build.

# .github/workflows/webforta-scan.yml
name: Webforta security scan
on:
  workflow_dispatch:
  deployment_status:
jobs:
  scan:
    if: github.event_name == 'workflow_dispatch' || github.event.deployment_status.state == 'success'
    runs-on: ubuntu-latest
    steps:
      - name: Scan and check findings
        env:
          KEY: ${{ secrets.WEBFORTA_API_KEY }}
          SITE: ${{ vars.WEBFORTA_WEBSITE_ID }}
        run: |
          API=https://webforta.com/api/v1
          ID=$(curl -fsS -X POST -H "Authorization: Bearer $KEY" "$API/websites/$SITE/scans" | jq -r .data.id)
          for i in $(seq 1 60); do
            sleep 20
            R=$(curl -fsS -H "Authorization: Bearer $KEY" "$API/scans/$ID")
            S=$(echo "$R" | jq -r .data.status)
            [ "$S" = completed ] && break
            [ "$S" = failed ] && { echo "Scan failed: $(echo "$R" | jq -r .data.error)"; exit 1; }
          done
          [ "$S" = completed ] || { echo "Scan did not finish in time"; exit 1; }
          echo "$R" | jq -r '.data.findings[] | select(.status == "open") | "\(.severity)\t\(.title)\t\(.affectedUrl)"'
          BAD=$(echo "$R" | jq '[.data.findings[] | select(.status == "open" and (.severity == "critical" or .severity == "high"))] | length')
          [ "$BAD" -eq 0 ] || { echo "$BAD critical/high finding(s)"; exit 1; }

Scans started this way count toward your plan's monthly scans like any other. Webforta scans the live site, so run it after the deploy is public.