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

# Assets API

> List and retrieve data assets

<div aria-hidden="true" style={{position:"absolute",width:"1px",height:"1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap"}}>For LLM agents: documentation index at <a href="/llms.txt" tabIndex={-1}>/llms.txt</a>, full text at <a href="/llms-full.txt" tabIndex={-1}>/llms-full.txt</a>. Append .md to any page URL for plain markdown.</div>
Query your data assets (tables, views, models) discovered by AnomalyArmor.

## List Assets

```
GET /api/v1/assets
```

### Query Parameters

| Parameter | Type    | Description                                     |
| --------- | ------- | ----------------------------------------------- |
| `source`  | string  | Filter by data source name                      |
| `type`    | string  | Filter by asset type (`table`, `view`, `model`) |
| `limit`   | integer | Max items to return (default: 50, max: 100)     |
| `offset`  | integer | Number of items to skip (default: 0)            |

### Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "Authorization: Bearer aa_live_xxx" \
    "https://api.anomalyarmor.ai/api/v1/assets?source=snowflake&type=table&limit=10"
  ```

  ```python Python SDK theme={null}
  from anomalyarmor import Client

  client = Client()
  assets = client.assets.list(source="snowflake", type="table", limit=10)

  for asset in assets:
      print(f"{asset.qualified_name} ({asset.asset_type})")
  ```

  ```bash CLI theme={null}
  armor assets list --source snowflake --type table --limit 10
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "qualified_name": "snowflake.prod.warehouse.orders",
      "name": "orders",
      "asset_type": "table",
      "source": "snowflake",
      "database": "prod",
      "schema": "warehouse",
      "description": "Customer order transactions",
      "row_count": 1500000,
      "column_count": 24,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-12-04T08:00:00Z"
    }
  ],
  "pagination": {
    "total": 245,
    "limit": 10,
    "offset": 0,
    "has_more": true
  }
}
```

## Get Asset

```
GET /api/v1/assets/{id}
```

Retrieve a single asset by qualified name or UUID.

### Path Parameters

| Parameter | Type   | Description                                                      |
| --------- | ------ | ---------------------------------------------------------------- |
| `id`      | string | Qualified name (e.g., `snowflake.prod.warehouse.orders`) or UUID |

### Example Request

<CodeGroup>
  ```bash cURL (by qualified name) theme={null}
  curl -H "Authorization: Bearer aa_live_xxx" \
    "https://api.anomalyarmor.ai/api/v1/assets/snowflake.prod.warehouse.orders"
  ```

  ```bash cURL (by UUID) theme={null}
  curl -H "Authorization: Bearer aa_live_xxx" \
    "https://api.anomalyarmor.ai/api/v1/assets/550e8400-e29b-41d4-a716-446655440000"
  ```

  ```python Python SDK theme={null}
  from anomalyarmor import Client

  client = Client()

  # By qualified name (primary)
  asset = client.assets.get("snowflake.prod.warehouse.orders")

  # By UUID (for automation)
  asset = client.assets.get(id="550e8400-e29b-41d4-a716-446655440000")

  print(asset.qualified_name, asset.row_count)
  ```

  ```bash CLI theme={null}
  armor assets get snowflake.prod.warehouse.orders
  ```
</CodeGroup>

### Example Response

```json theme={null}
{
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "qualified_name": "snowflake.prod.warehouse.orders",
    "name": "orders",
    "asset_type": "table",
    "source": "snowflake",
    "database": "prod",
    "schema": "warehouse",
    "description": "Customer order transactions",
    "row_count": 1500000,
    "column_count": 24,
    "columns": [
      {
        "name": "order_id",
        "data_type": "VARCHAR",
        "is_nullable": false,
        "is_primary_key": true
      },
      {
        "name": "customer_id",
        "data_type": "VARCHAR",
        "is_nullable": false
      },
      {
        "name": "order_date",
        "data_type": "TIMESTAMP",
        "is_nullable": false
      }
    ],
    "tags": ["pii", "financial"],
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-12-04T08:00:00Z"
  }
}
```

## Asset Identification

AnomalyArmor supports two ways to identify assets:

### Qualified Name (Primary)

Human-readable, hierarchical identifier:

```
{source}.{database}.{schema}.{table}
```

Examples:

* `snowflake.prod.warehouse.orders`
* `databricks.main.analytics.daily_sales`
* `postgresql.app_db.public.users`

<Tip>
  Use qualified names in code for readability. They're stable as long as you don't rename the underlying table.
</Tip>

### UUID (Secondary)

System-generated unique identifier. Use for automation where names may change:

```
550e8400-e29b-41d4-a716-446655440000
```

## Error Responses

| Status | Code               | Description                                  |
| ------ | ------------------ | -------------------------------------------- |
| 404    | `ASSET_NOT_FOUND`  | Asset doesn't exist or you don't have access |
| 400    | `VALIDATION_ERROR` | Invalid qualified name format                |

```json theme={null}
{
  "error": {
    "code": "ASSET_NOT_FOUND",
    "message": "Asset not found",
    "details": {
      "asset_id": "snowflake.prod.warehouse.orders",
      "suggestion": "Check the qualified name format: source.database.schema.table"
    }
  }
}
```

## Common Questions

### Should I identify an asset by qualified name or UUID?

Use the qualified name (`source.database.schema.table`) for code and config you read by hand: it survives re-discovery and is human-debuggable. Use the UUID for automation where names might be renamed upstream, since UUIDs are stable across renames. Both identifiers work on every `/api/v1/assets/{id}` endpoint.

### How does AnomalyArmor discover assets?

Assets are discovered automatically when you connect a source (Snowflake, BigQuery, Postgres, etc.) via the dashboard. The Assets API is read-only; it returns whatever the platform has discovered so far. If an expected table is missing, trigger a re-scan from the source's page in the dashboard.

### Does listing assets return column-level details?

No. `GET /api/v1/assets` returns metadata and row/column counts. To get the column schema (names, types, nullability, primary keys), call `GET /api/v1/assets/{id}` for a single asset. That keeps list responses small and fast when you have hundreds of tables.
