> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infraudit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API endpoints for cloud resources — GET /resources

> List and retrieve the cloud resources that InfraAudit has discovered across your providers. Filter by provider ID, resource type, region, and sync status.

The resources endpoints give you access to InfraAudit's cloud resource inventory. Resources are discovered automatically during provider syncs. You can filter by provider, resource type, region, and status, and drill into per-resource configuration snapshots, drifts, vulnerabilities, recommendations, and cost history.

Base path: `/api/v1/resources`

***

## GET /resources — list resources

Returns a paginated list of cloud resources across all connected providers.

```http theme={null}
GET /api/v1/resources
Authorization: Bearer <token>
```

### Query parameters

<ParamField query="provider_id" type="integer">
  Filter by provider ID.
</ParamField>

<ParamField query="type" type="string">
  Filter by resource type, for example `ec2_instance`, `s3_bucket`, or `rds_instance`.
</ParamField>

<ParamField query="region" type="string">
  Filter by cloud region, for example `us-east-1`.
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `active`, `stopped`, or `deleted`.
</ParamField>

<ParamField query="page" type="integer" default="1">
  Page number.
</ParamField>

<ParamField query="per_page" type="integer" default="20">
  Results per page. Maximum is 100.
</ParamField>

### Response

```json theme={null}
{
  "data": [
    {
      "id": 1,
      "external_id": "i-0abc123def456",
      "name": "web-server-01",
      "resource_type": "ec2_instance",
      "provider_id": 1,
      "region": "us-east-1",
      "status": "active",
      "tags": { "env": "production" },
      "last_seen_at": "2024-01-15T06:00:00Z"
    }
  ],
  "meta": {
    "total": 247,
    "page": 1,
    "per_page": 20
  }
}
```

<ResponseField name="data" type="array">
  Array of resource objects.
</ResponseField>

<ResponseField name="data[].id" type="integer">
  Internal resource ID.
</ResponseField>

<ResponseField name="data[].external_id" type="string">
  The resource's identifier in the cloud provider, for example an EC2 instance ID or S3 bucket name.
</ResponseField>

<ResponseField name="data[].resource_type" type="string">
  The resource type string, for example `ec2_instance`.
</ResponseField>

<ResponseField name="data[].status" type="string">
  Current status: `active`, `stopped`, or `deleted`.
</ResponseField>

<ResponseField name="data[].tags" type="object">
  Cloud tags as key-value pairs.
</ResponseField>

***

## GET /resources/{id} — get resource

Returns the full resource record including the current configuration snapshot.

```http theme={null}
GET /api/v1/resources/{id}
Authorization: Bearer <token>
```

***

## GET /resources/{id}/config — get configuration snapshot

Returns the raw configuration snapshot JSON for the resource.

```http theme={null}
GET /api/v1/resources/{id}/config
Authorization: Bearer <token>
```

***

## Additional per-resource endpoints

| Endpoint                                     | Description                                                           |
| -------------------------------------------- | --------------------------------------------------------------------- |
| `GET /api/v1/resources/{id}/drifts`          | List drift findings for this resource                                 |
| `GET /api/v1/resources/{id}/vulnerabilities` | List vulnerability findings for this resource                         |
| `GET /api/v1/resources/{id}/recommendations` | List AI-generated recommendations for this resource                   |
| `GET /api/v1/resources/{id}/cost`            | Get cost history for this resource (query param: `months`, default 6) |
