Skip to main content
GET
/
api
/
v1
/
assets
/
{asset_id}
/
freshness
Get Asset Freshness Overview
curl --request GET \
  --url https://api.anomalyarmor.ai/api/v1/assets/{asset_id}/freshness
{
  "success": true,
  "data": null,
  "message": "<string>",
  "error": {},
  "meta": {}
}
Check whether data is fresh or stale. Use this to gate pipelines, build monitoring dashboards, or verify SLA compliance.

When to Use

  • Pipeline gating: Fail jobs if upstream data is stale
  • Dashboards: Show freshness status in monitoring tools
  • SLA tracking: Verify data meets freshness requirements
  • Alerting integration: Build custom alert workflows

SDK & CLI Examples

from anomalyarmor import Client
from anomalyarmor.exceptions import StalenessError

client = Client(api_key="aa_live_xxx")

# Check freshness for a single asset
freshness = client.freshness.get("snowflake.prod.public.orders")
print(f"Status: {freshness.status}")
print(f"Last updated: {freshness.last_updated}")
print(f"SLA threshold: {freshness.sla_threshold}")

# Require fresh data (raises StalenessError if stale)
try:
    client.freshness.require_fresh("snowflake.prod.public.orders")
    print("Data is fresh, safe to proceed")
except StalenessError as e:
    print(f"Data is stale! Last update: {e.last_updated}")

Parameters

ParameterTypeDescription
asset_idstringAsset ID or qualified name

Response

{
  "asset": "snowflake.prod.public.orders",
  "status": "fresh",
  "last_updated": "2024-01-15T08:30:00Z",
  "sla_threshold": "2h",
  "sla_status": "within_sla",
  "checked_at": "2024-01-15T09:00:00Z",
  "timestamp_column": "created_at",
  "data_age_minutes": 30
}

Response Fields

FieldDescription
statusfresh, stale, or unknown
last_updatedTimestamp of most recent data in the table
sla_thresholdConfigured freshness SLA (e.g., “2h”, “24h”)
sla_statuswithin_sla, warning, or violated
checked_atWhen this freshness check ran
timestamp_columnColumn used to determine freshness
data_age_minutesHow old the data is in minutes

Status Values

StatusMeaning
freshData updated within SLA threshold
staleData older than SLA threshold
unknownNo timestamp column configured or no data

Error Responses

StatusMeaning
401Invalid or missing API key
404Asset not found
422No freshness configuration for this asset
429Rate limit exceeded

Path Parameters

asset_id
string<uuid>
required

Query Parameters

page
integer
default:1

Page number (1-based)

Required range: x >= 1
page_size
integer
default:20

Number of tables per page

Required range: 1 <= x <= 100
status_filters
string

Comma-separated status filters (ready,not_ready,unknown,error)

schema_filters
string

Comma-separated schema filters

tag_filters
string

Comma-separated tag filters

search_query
string

Search query for table names

Response

Successful Response

Standard API response format.

success
boolean
required
data
unknown
message
string | null
error
Error · object
meta
Meta · object