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.
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¶
| 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 |
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 |
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 |
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.
Common status codes:
| Status | Meaning |
|---|---|
| 400 | Validation error |
| 401 | Authentication failed |
| 404 | Resource not found |
| 429 | Audit limit exceeded |
Integration Guide¶
- Authenticate using your API token.
- Create an audit job with
POST /jobs/. - Store the returned job ID.
- Poll
GET /jobs/{job_id}/until the status isprocessedorerror. - Process the
resultobject 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.