Skip to content

Audit API

The Lawwwing Audit API allows you to create audit jobs and retrieve their execution results.

Base URL

https://audit.lawwwing.com/api/v1

All endpoints require authentication via the Authorization header.

Authentication Required

Every request must include a valid Authorization header. If the header is missing or invalid, the API will return 401 Unauthorized.

Available endpoints

Method Endpoint Description
GET /ping/ Test endpoint to verify authentication
POST /jobs/ Create an audit job
GET /jobs/{job_id}/ Retrieve an audit job

Authentication

All endpoints require token authentication.

curl https://audit.lawwwing.com/api/v1/jobs/ \
  -H "Authorization: Token <YOUR_TOKEN>"

Tip

Store your API token securely. Never expose it in frontend applications or public repositories.

API Conventions

  • All endpoints use trailing slashes.
  • All responses are JSON.
  • Resource identifiers are UUIDs.
  • If the target URL has no protocol, https:// is automatically prepended.

Job Lifecycle

pending
started
   ├────────────► processed
   └────────────► error
Status Description
pending The audit job has been accepted and its queued waiting to be processed.
started The audit is currently being executed.
processed The audit completed successfully and the result field is available.
error The audit could not be completed. The result field may contain error details.

Endpoints

Test Authentication

GET /api/v1/ping/

Returns a simple response that you can use to verify that your Authorization token is valid.

Responses

Status Description
200 Authentication is valid
401 Unauthorized
curl https://audit.lawwwing.com/api/v1/ping/ \
  -H "Authorization: Token <YOUR_TOKEN>"
{
  "message": "pong"
}

Create Audit Job

POST /api/v1/jobs/

Creates a new audit job.

Request Body

Field Type Required Description
target string URL or domain to audit
pipeline string No Pipeline identifier. Uses the default pipeline if omitted.
sync boolean No Defaults to false. When true, execution happens during the request.

Note

To obtain the list of available pipelines, including their identifiers and functionality, please contact the Lawwwing support team.

Responses

Status Description
201 Job created
400 Validation error
401 Unauthorized
429 Audit limit exceeded
curl -X POST https://audit.lawwwing.com/api/v1/jobs/ \
  -H "Authorization: Token <YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "target": "example.com",
    "pipeline": "default",
    "sync": false
  }'
{
  "id": "00000000-0000-0000-0000-000000000000",
  "status": "pending",
  "target": "https://example.com",
  "created": "2026-07-02T12:00:00Z",
  "result": {}
}

Note

The result field remains empty until the audit finishes.


Get Audit Job

GET /api/v1/jobs/{job_id}/

Returns the details of an existing audit job.

Path Parameters

Parameter Type Description
job_id UUID Audit job identifier

Responses

Status Description
200 Job retrieved
401 Unauthorized or not the owner
404 Job not found
curl https://audit.lawwwing.com/api/v1/jobs/00000000-0000-0000-0000-000000000000/ \
  -H "Authorization: Token <YOUR_TOKEN>"
{
  "id": "00000000-0000-0000-0000-000000000000",
  "status": "completed",
  "target": "https://example.com",
  "created": "2026-07-02T12:00:00Z",
  "result": {}
}

Info

The structure of result depends on the pipeline used, but it is always returned as a JSON object.


Errors

Validation errors follow the standard field-based format.

{
  "target": [
    "Enter a valid URL or domain."
  ]
}

Common status codes:

Status Meaning
400 Validation error
401 Authentication failed
404 Resource not found
429 Audit limit exceeded

Integration Guide

  1. Authenticate using your API token.
  2. Create an audit job with POST /jobs/.
  3. Store the returned job ID.
  4. Poll GET /jobs/{job_id}/ until the status is processed or error.
  5. Process the result object once the job completes.

Rate limiting

When receiving a 429 Too Many Requests response, implement exponential backoff before retrying requests. Also consider talking to Lawwwing support to request a higher audit limit if needed.


Example Workflow

Create Job
Receive Job ID
Poll Job Status
     ├────────► processed → Read result
     └────────► error → Handle error