Skip to main content
A baseline is a snapshot of a resource’s configuration at a specific point in time. InfraAudit uses baselines as the reference state for drift detection — any deviation from the baseline is reported as a drift finding. Base path: /api/v1/baselines

POST /baselines — create a baseline

Captures the current configuration of a resource as a new baseline.
POST /api/v1/baselines
Authorization: Bearer <token>
Content-Type: application/json

Request body

resource_id
integer
required
The ID of the resource to baseline.
{
  "resource_id": 15
}

Response 201

{
  "id": 7,
  "resource_id": 15,
  "configuration": { "...": "current resource config snapshot" },
  "captured_at": "2024-01-15T14:00:00Z",
  "created_by": 1
}
id
integer
Internal baseline ID.
configuration
object
The full resource configuration snapshot at the time the baseline was captured.
captured_at
string
ISO 8601 timestamp of when the baseline was captured.

GET /baselines — list baselines

Returns all baselines for a resource.
GET /api/v1/baselines?resource_id={resource_id}
Authorization: Bearer <token>

Query parameters

resource_id
integer
required
The resource to list baselines for.

GET /baselines/ — get baseline

Returns the full baseline record including the configuration snapshot.
GET /api/v1/baselines/{id}
Authorization: Bearer <token>

GET /baselines//compare/ — compare two baselines

Returns a JSON diff between two baselines for the same resource. Useful for understanding how a resource’s configuration has changed over time.
GET /api/v1/baselines/{id}/compare/{other_id}
Authorization: Bearer <token>

Response

{
  "baseline_a": 5,
  "baseline_b": 7,
  "diff": [
    {
      "path": "encryption.enabled",
      "baseline_a_value": true,
      "baseline_b_value": false
    }
  ]
}

DELETE /baselines/ — delete baseline

Deletes a baseline. Returns 204 No Content.
DELETE /api/v1/baselines/{id}
Authorization: Bearer <token>
You cannot delete the only baseline for a resource that has active drift detection enabled. Capture a new baseline first, or disable drift detection for the resource before deleting.