Altimate AI SUBSCRIPTIONS API
The SUBSCRIPTIONS API from Altimate AI — 10 operation(s) for subscriptions.
The SUBSCRIPTIONS API from Altimate AI — 10 operation(s) for subscriptions.
openapi: 3.1.0
info:
title: Fast ACCOUNT_COSTS SUBSCRIPTIONS API
version: 0.1.0
tags:
- name: SUBSCRIPTIONS
paths:
/subscriptions/metrics:
get:
tags:
- SUBSCRIPTIONS
summary: List Metrics
description: "Get all available metrics from the v2 registry.\n\nArgs:\n category: Optional category filter\n\nReturns:\n List of metric definitions"
operationId: list_metrics_subscriptions_metrics_get
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: category
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by category (e.g., 'warehouse')
title: Category
description: Filter by category (e.g., 'warehouse')
responses:
'200':
description: List of available metrics
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MetricDefinitionResponse'
title: Response List Metrics Subscriptions Metrics Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/subscriptions/metrics/filters/{filter_name}/options:
get:
tags:
- SUBSCRIPTIONS
summary: Get Metric Filter Options
description: "Get available options for a specific filter dimension.\n\nUses the FilterOptionsProvider pattern to fetch RBAC-filtered options\nfor different entity types (warehouse, instance, etc.).\n\nSupports both PostgreSQL-based filters (warehouse, instance) and\nClickHouse-based filters (user, role, query_type, database, schema,\nexecution_status, warehouse_size, cluster).\n\nArgs:\n filter_name: Name of the filter dimension (e.g., 'warehouse', 'user', 'role')\n metric_name: Optional metric name to filter options based on metric context\n (e.g., instance filter will only return Snowflake instances\n for Snowflake metrics)\n\nReturns:\n List of available options for the filter"
operationId: get_metric_filter_options_subscriptions_metrics_filters__filter_name__options_get
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: filter_name
in: path
required: true
schema:
type: string
title: Filter Name
- name: metric_name
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Optional metric name to filter options based on metric context (e.g., for 'instance' filter, only return Snowflake instances for Snowflake metrics)
title: Metric Name
description: Optional metric name to filter options based on metric context (e.g., for 'instance' filter, only return Snowflake instances for Snowflake metrics)
responses:
'200':
description: Available filter options for the specified dimension
content:
application/json:
schema:
$ref: '#/components/schemas/MetricFilterOptionsResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/subscriptions/filters:
get:
tags:
- SUBSCRIPTIONS
summary: Get Subscription Filters
description: 'Get available filter options for the subscription list.
Returns distinct values for subscription_type, category, created_by, and destinations
based on existing subscriptions the user has access to.'
operationId: get_subscription_filters_subscriptions_filters_get
responses:
'200':
description: Available filter options for subscriptions
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionFiltersResponse'
security:
- HTTPBearer: []
- HTTPBearer: []
/subscriptions/summary:
get:
tags:
- SUBSCRIPTIONS
summary: Get Subscription Summary
description: 'Get subscription summary statistics.
Returns the total number of subscriptions for the user,
plus placeholder values for alerts triggered and reports sent.
Supports filtering by subscription_type, category, and date range.'
operationId: get_subscription_summary_subscriptions_summary_get
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: subscription_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Filter by type: ''alert'' or ''report'''
title: Subscription Type
description: 'Filter by type: ''alert'' or ''report'''
- name: category
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by metric category
title: Category
description: Filter by metric category
- name: search
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Search by subscription name
title: Search
description: Search by subscription name
- name: start_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by start date (ISO 8601 format)
title: Start Date
description: Filter by start date (ISO 8601 format)
- name: end_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by end date (ISO 8601 format)
title: End Date
description: Filter by end date (ISO 8601 format)
responses:
'200':
description: Subscription summary statistics
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionSummaryResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/subscriptions:
post:
tags:
- SUBSCRIPTIONS
summary: Create Subscription
description: "Create a new subscription (alert or report).\n\nSupports both provider-based metrics and custom SQL.\n\nArgs:\n request: Subscription creation request\n\nReturns:\n Created subscription details"
operationId: create_subscription_subscriptions_post
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionCreateRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'400':
description: Invalid subscription configuration
'403':
description: Entity access denied
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
get:
tags:
- SUBSCRIPTIONS
summary: List Subscriptions
description: "Get paginated list of subscriptions with optional filters.\n\nArgs:\n subscription_type: Filter by subscription type\n status_filter: Filter by status\n entity_type: Filter by entity type\n search: Search by name (case-insensitive)\n category: Filter by metric category\n start_date: Filter subscriptions created after this date\n end_date: Filter subscriptions created before this date\n sort_by: Field to sort by\n sort_order: Sort direction (asc/desc)\n\nReturns:\n Paginated subscriptions"
operationId: list_subscriptions_subscriptions_get
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: subscription_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Filter by type: ''alert'' or ''report'''
title: Subscription Type
description: 'Filter by type: ''alert'' or ''report'''
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Filter by status: ''active'' or ''inactive'''
title: Status
description: 'Filter by status: ''active'' or ''inactive'''
- name: entity_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by entity type
title: Entity Type
description: Filter by entity type
- name: search
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Search by subscription name
title: Search
description: Search by subscription name
- name: category
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by metric category
title: Category
description: Filter by metric category
- name: start_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by start date (ISO 8601 format)
title: Start Date
description: Filter by start date (ISO 8601 format)
- name: end_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by end date (ISO 8601 format)
title: End Date
description: Filter by end date (ISO 8601 format)
- name: sort_by
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Sort by field: ''created_at'', ''name'''
default: created_at
title: Sort By
description: 'Sort by field: ''created_at'', ''name'''
- name: sort_order
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Sort order: ''asc'' or ''desc'''
default: desc
title: Sort Order
description: 'Sort order: ''asc'' or ''desc'''
- name: page
in: query
required: false
schema:
type: integer
minimum: 1
description: Page number
default: 1
title: Page
description: Page number
- name: size
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
description: Page size
default: 50
title: Size
description: Page size
responses:
'200':
description: Paginated list of subscriptions
content:
application/json:
schema:
$ref: '#/components/schemas/Page_SubscriptionResponse_'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/subscriptions/templates:
get:
tags:
- SUBSCRIPTIONS
summary: Get Subscription Templates
description: "Get available subscription templates.\n\nReturns:\n List of templates with preset configurations"
operationId: get_subscription_templates_subscriptions_templates_get
responses:
'200':
description: List of available subscription templates
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionTemplatesResponse'
security:
- HTTPBearer: []
- HTTPBearer: []
/subscriptions/{subscription_id}:
get:
tags:
- SUBSCRIPTIONS
summary: Get Subscription
description: "Get a single subscription by ID.\n\nArgs:\n subscription_id: Subscription ID\n\nReturns:\n Subscription details with execution history"
operationId: get_subscription_subscriptions__subscription_id__get
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: subscription_id
in: path
required: true
schema:
type: integer
title: Subscription Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'404':
description: Subscription not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- SUBSCRIPTIONS
summary: Delete Subscription
description: "Delete a subscription.\n\nArgs:\n subscription_id: Subscription ID\n\nReturns:\n Success confirmation"
operationId: delete_subscription_subscriptions__subscription_id__delete
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: subscription_id
in: path
required: true
schema:
type: integer
title: Subscription Id
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Delete Subscription Subscriptions Subscription Id Delete
'404':
description: Subscription not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/subscriptions/{subscription_id}/history:
get:
tags:
- SUBSCRIPTIONS
summary: Get Subscription History
description: "Get execution history for a subscription.\n\nArgs:\n subscription_id: Subscription ID\n page: Page number\n size: Items per page\n status_filter: Optional status filter\n start_date: Optional start date filter (ISO 8601 format)\n end_date: Optional end date filter (ISO 8601 format)\n\nReturns:\n Paginated list of execution history items"
operationId: get_subscription_history_subscriptions__subscription_id__history_get
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: subscription_id
in: path
required: true
schema:
type: integer
title: Subscription Id
- name: page
in: query
required: false
schema:
type: integer
minimum: 1
description: Page number
default: 1
title: Page
description: Page number
- name: size
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
description: Items per page
default: 10
title: Size
description: Items per page
- name: status
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: 'Filter by status: triggered, pending, failed, skipped'
title: Status
description: 'Filter by status: triggered, pending, failed, skipped'
- name: start_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by start date (ISO 8601 format)
title: Start Date
description: Filter by start date (ISO 8601 format)
- name: end_date
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by end date (ISO 8601 format)
title: End Date
description: Filter by end date (ISO 8601 format)
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionHistoryResponse'
'404':
description: Subscription not found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/subscriptions/preview:
post:
tags:
- SUBSCRIPTIONS
summary: Get Subscription Preview
description: "Get a preview of what the subscription will look like.\n\nGenerates real-time preview based on the metric configuration,\nshowing actual data from the selected metrics and filters.\n\nArgs:\n request: Preview request with subscription_type and metric_config\n\nReturns:\n Preview items with markdown and charts based on real data"
operationId: get_subscription_preview_subscriptions_preview_post
requestBody:
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/SubscriptionPreviewRequest'
- type: 'null'
title: Request
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionPreviewResponse'
'400':
description: Invalid preview request
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
/subscriptions/{subscription_id}/update:
post:
tags:
- SUBSCRIPTIONS
summary: Update Subscription
description: "Update an existing subscription.\n\nArgs:\n subscription_id: Subscription ID\n request: Update request with fields to modify\n\nReturns:\n Updated subscription details"
operationId: update_subscription_subscriptions__subscription_id__update_post
deprecated: true
security:
- HTTPBearer: []
- HTTPBearer: []
parameters:
- name: subscription_id
in: path
required: true
schema:
type: integer
title: Subscription Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionUpdateRequest'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionResponse'
'404':
description: Subscription not found
'400':
description: Invalid update data
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
SubscriptionTemplatesResponse:
properties:
items:
items:
$ref: '#/components/schemas/SubscriptionTemplate'
type: array
title: Items
description: List of available templates
total:
type: integer
title: Total
description: Total number of templates
type: object
required:
- items
- total
title: SubscriptionTemplatesResponse
description: Response schema for subscription templates list.
SubscriptionPreviewRequest:
properties:
subscription_type:
type: string
title: Subscription Type
description: 'Subscription type: ''alert'' or ''report'''
name:
anyOf:
- type: string
- type: 'null'
title: Name
description: Subscription name for preview display
default: Preview
metric_config:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Metric Config
description: Metric configuration for alert preview. Required for alerts, ignored for reports.
type: object
required:
- subscription_type
title: SubscriptionPreviewRequest
description: Request schema for subscription preview.
example:
metric_config:
category: warehouse
filters:
- key: warehouse
value:
- COMPUTE_WH
metric_name: warehouse_daily_cost
params:
aggregation: sum
comparison_type: relative_value
date_range: previous_day
threshold_type: exceeds
threshold_value: 1000
name: My Cost Alert
subscription_type: alert
SubscriptionTemplate:
properties:
id:
type: string
title: Id
description: Unique template identifier
name:
type: string
title: Name
description: Template name
description:
type: string
title: Description
description: Template description
subscription_type:
type: string
title: Subscription Type
description: 'Subscription type: report or alert'
entity_type:
type: string
title: Entity Type
description: Entity type (e.g., 'warehouse', 'query')
entity_config:
additionalProperties: true
type: object
title: Entity Config
description: Entity configuration (e.g., warehouse_ids, instance_id)
metric_config:
additionalProperties: true
type: object
title: Metric Config
description: Full metric configuration with params, filters, category, metric_name
schedule_config:
additionalProperties: true
type: object
title: Schedule Config
description: Default schedule configuration (cron, timezone)
notifier_config:
items:
additionalProperties: true
type: object
type: array
title: Notifier Config
description: Default notification configurations (can be empty)
type: object
required:
- id
- name
- description
- subscription_type
- entity_type
- entity_config
- metric_config
- schedule_config
title: SubscriptionTemplate
description: 'Schema for a subscription template.
Templates are pre-configured subscriptions that can be loaded into the form.
They contain all the subscription fields except the name (user provides that).'
SubscriptionExecutionRun:
properties:
id:
type: string
title: Id
status:
type: string
title: Status
timestamp:
type: string
format: date-time
title: Timestamp
alert_triggered:
anyOf:
- type: boolean
- type: 'null'
title: Alert Triggered
message:
anyOf:
- type: string
- type: 'null'
title: Message
type: object
required:
- id
- status
- timestamp
title: SubscriptionExecutionRun
description: Schema for a subscription execution run (for UI display).
SubscriptionPreviewResponse:
properties:
items:
items:
$ref: '#/components/schemas/PreviewItem'
type: array
title: Items
description: List of preview items to render
generated_at:
type: string
title: Generated At
description: ISO 8601 timestamp when preview was generated
type: object
required:
- items
- generated_at
title: SubscriptionPreviewResponse
description: Response schema for subscription preview.
SubscriptionUpdateRequest:
properties:
name:
anyOf:
- type: string
maxLength: 255
minLength: 1
- type: 'null'
title: Name
description:
anyOf:
- type: string
maxLength: 1000
- type: 'null'
title: Description
subscription_type:
anyOf:
- type: string
- type: 'null'
title: Subscription Type
description: 'Type of subscription: ''alert'' or ''report'''
entity_type:
anyOf:
- type: string
- type: 'null'
title: Entity Type
description: Entity type (e.g., 'warehouse', 'query', 'accounts')
entity_config:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Entity Config
metric_config:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Metric Config
schedule_config:
anyOf:
- additionalProperties: true
type: object
- type: 'null'
title: Schedule Config
notifier_config:
anyOf:
- items:
additionalProperties: true
type: object
type: array
- type: 'null'
title: Notifier Config
alert_message:
anyOf:
- type: string
- type: 'null'
title: Alert Message
status:
anyOf:
- type: string
- type: 'null'
title: Status
type: object
title: SubscriptionUpdateRequest
description: Request schema for updating an existing subscription.
PreviewItem:
properties:
type:
type: string
title: Type
description: 'Item type: markdown or chart'
content:
anyOf:
- type: string
- type: 'null'
title: Content
description: Markdown content if type is markdown
chart:
anyOf:
- $ref: '#/components/schemas/PreviewChartData'
- type: 'null'
description: Chart data if type is chart
type: object
required:
- type
title: PreviewItem
description: Schema for a single preview item (markdown or chart).
SubscriptionHistoryResponse:
properties:
items:
items:
$ref: '#/components/schemas/SubscriptionHistoryItem'
type: array
title: Items
description: List of execution history items
total:
type: integer
title: Total
description: Total number of history items
page:
type: integer
title: Page
description: Current page number
default: 1
size:
type: integer
title: Size
description: Number of items per page
default: 10
type: object
required:
- items
- total
title: SubscriptionHistoryResponse
description: Response schema for subscription execution history.
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
PreviewChartData:
properties:
type:
type: string
title: Type
description: 'Chart type: bar, line, area, pie'
data:
items:
additionalProperties: true
type: object
type: array
title: Data
description: Chart data points
x_key:
type: string
title: X Key
description: Key for x-axis
y_key:
type: string
title: Y Key
description: Key for y-axis
title:
anyOf:
- type: string
- type: 'null'
title: Title
description: Chart title
x_label:
anyOf:
- type: string
- type: 'null'
title: X Label
description: X-axis label
y_label:
anyOf:
- type: string
- type: 'null'
title: Y Label
description: Y-axis label
type: object
required:
- type
- data
- x_key
- y_key
title: PreviewChartData
description: Schema for chart data in preview.
Page_SubscriptionResponse_:
properties:
items:
items:
$ref: '#/components/schemas/SubscriptionResponse'
type: array
title: Items
total:
anyOf:
- type: integer
minimum: 0.0
- type: 'null'
title: Total
page:
anyOf:
- type: integer
minimum: 1.0
- type: 'null'
title: Page
size:
anyOf:
- type: integer
minimum: 1.0
- type: 'null'
title: Size
pages:
anyOf:
- type: integer
minimum: 0.0
- type: 'null'
title: Pages
type: object
required:
- items
- total
- page
- size
title: Page[SubscriptionResponse]
SubscriptionFiltersResponse:
properties:
subscription_types:
items:
$ref: '#/components/schemas/app__schemas__subscriptions__FilterOption'
type: array
title: Subscription Types
description: Available subscription types (alert, report)
categories:
items:
$ref: '#/components/schemas/app__schemas__subscriptions__FilterOption'
type: array
title: Categories
description: Available metric categories
created_by:
items:
$ref: '#/components/schemas/app__schemas__subscriptions__FilterOption'
type: array
title: Created By
description: Users who have created subscriptions
destinations:
items:
$ref: '#/components/schemas/app__schemas__subscriptions__FilterOption'
type: array
title: Destinations
description: Available notification destinations
type: object
required:
- subscription_types
- categories
- created_by
- destinations
title: SubscriptionFiltersResponse
description: Response schema for subscription filter options.
SubscriptionSummaryResponse:
properties:
totalSubscriptions:
type: integer
title: Totalsubscriptions
description: Total number of subscriptions for the user
alertsTriggered:
type: integer
title: Alertstriggered
description: Number of alerts triggered (placeholder)
reportsSent:
type: integer
title: Reportssent
description: Number of reports sent (placeholder)
type: object
required:
- totalSubscriptions
- alertsTriggered
- reportsSent
title: SubscriptionSummaryResponse
description: Response schema for subscription summary statistics.
SubscriptionResponse:
properties:
id:
type: integer
tit
# --- truncated at 32 KB (46 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/altimate-ai/refs/heads/main/openapi/altimate-ai-subscriptions-api-openapi.yml