Altimate AI METABASE API

The METABASE API from Altimate AI — 6 operation(s) for metabase.

OpenAPI Specification

altimate-ai-metabase-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Fast ACCOUNT_COSTS METABASE API
  version: 0.1.0
tags:
- name: METABASE
paths:
  /metabase/auth/metabase/token:
    post:
      tags:
      - METABASE
      summary: Generate Metabase Token
      description: "Generate a signed JWT token for Metabase embedded analytics.\n\nThis endpoint creates\
        \ a JWT token that can be used with Metabase's\nembedded analytics feature to authenticate users\
        \ and control access\nto dashboards and data.\n\nArgs:\n    request: MetabaseJWTRequest containing\
        \ optional groups and expiration\n    current_user: The authenticated user from the request\n\n\
        Returns:\n    dict: Contains the signed JWT token with user info from request"
      operationId: generate_metabase_token_metabase_auth_metabase_token_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetabaseJWTRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetabaseJWTResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
      - HTTPBearer: []
  /metabase/dashboards:
    get:
      tags:
      - METABASE
      summary: Get Tenant Dashboards
      description: "Get paginated dashboards from local database with advanced filtering and sorting.\n\
        \nThis endpoint fetches dashboard metadata from the local database\nthat was previously synced\
        \ from Metabase by the sync worker.\n\nArgs:\n    page: Page number (starts from 1)\n    page_size:\
        \ Number of dashboards per page (max 100)\n    search: Search term for dashboard name/description\n\
        \    tags: Filter by specific tags\n    collection_ids: Filter by collection IDs\n    collection_names:\
        \ Filter by collection names\n    created_after: ISO date string - filter dashboards created after\
        \ this date\n    created_before: ISO date string - filter dashboards created before this date\n\
        \    updated_after: ISO date string - filter dashboards updated after this date\n    updated_before:\
        \ ISO date string - filter dashboards updated before this date\n    has_description: Filter dashboards\
        \ with/without descriptions\n    archived: Include/exclude archived dashboards\n    sort_by: Sort\
        \ by field: name, created_at, updated_at, collection_name\n    sort_order: Sort order: asc, desc\n\
        \nReturns:\n    dict: Contains the filtered, sorted, and paginated dashboards for the current\
        \ tenant"
      operationId: get_tenant_dashboards_metabase_dashboards_get
      security:
      - HTTPBearer: []
      - HTTPBearer: []
      parameters:
      - name: page
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Page number (starts from 1)
          default: 1
          title: Page
        description: Page number (starts from 1)
      - name: page_size
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          description: Number of dashboards per page (max 100)
          default: 10
          title: Page Size
        description: Number of dashboards per page (max 100)
      - name: search
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Search term for dashboard name/description
          title: Search
        description: Search term for dashboard name/description
      - name: tags
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          description: Filter by specific tags
          title: Tags
        description: Filter by specific tags
      - name: collection_ids
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: integer
          - type: 'null'
          description: Filter by collection IDs
          title: Collection Ids
        description: Filter by collection IDs
      - name: collection_names
        in: query
        required: false
        schema:
          anyOf:
          - type: array
            items:
              type: string
          - type: 'null'
          description: Filter by collection names
          title: Collection Names
        description: Filter by collection names
      - name: created_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: ISO date string - filter dashboards created after this date
          title: Created After
        description: ISO date string - filter dashboards created after this date
      - name: created_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: ISO date string - filter dashboards created before this date
          title: Created Before
        description: ISO date string - filter dashboards created before this date
      - name: updated_after
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: ISO date string - filter dashboards updated after this date
          title: Updated After
        description: ISO date string - filter dashboards updated after this date
      - name: updated_before
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: ISO date string - filter dashboards updated before this date
          title: Updated Before
        description: ISO date string - filter dashboards updated before this date
      - name: has_description
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: Filter dashboards with/without descriptions
          title: Has Description
        description: Filter dashboards with/without descriptions
      - name: archived
        in: query
        required: false
        schema:
          anyOf:
          - type: boolean
          - type: 'null'
          description: Include/exclude archived dashboards
          title: Archived
        description: Include/exclude archived dashboards
      - name: sort_by
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: 'Sort by field: name, created_at, updated_at, collection_name'
          default: updated_at
          title: Sort By
        description: 'Sort by field: name, created_at, updated_at, collection_name'
      - name: sort_order
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: 'Sort order: asc, desc'
          default: desc
          title: Sort Order
        description: 'Sort order: asc, desc'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /metabase/sync-dashboard-metadata:
    post:
      tags:
      - METABASE
      summary: Sync Dashboard Metadata
      description: "Sync Metabase dashboard metadata from Airflow DAG to local database.\n\nThis endpoint\
        \ receives collections and dashboards data from an Airflow DAG\nand stores the metadata in the\
        \ local PostgreSQL database for the specified tenant.\n\nArgs:\n    request: SyncDashboardMetadataRequest\
        \ containing tenant, collections, dashboards, and fetch timestamp\n\nReturns:\n    SyncDashboardMetadataResponse\
        \ with sync operation results"
      operationId: sync_dashboard_metadata_metabase_sync_dashboard_metadata_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncDashboardMetadataRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/SyncDashboardMetadataResponse'
                - $ref: '#/components/schemas/SyncDashboardMetadataErrorResponse'
                title: Response Sync Dashboard Metadata Metabase Sync Dashboard Metadata Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      deprecated: true
      security:
      - HTTPBearer: []
      - HTTPBearer: []
  /metabase/dashboards/{dashboard_id}:
    get:
      tags:
      - METABASE
      summary: Get Dashboard By Id
      description: "Get a specific dashboard by ID from the local database.\n\nThis endpoint retrieves\
        \ dashboard metadata for a specific dashboard ID\nthat was previously synced from Metabase.\n\n\
        Args:\n    dashboard_id: The ID of the dashboard to retrieve\n\nReturns:\n    MetabaseDashboardDetail\
        \ with dashboard information"
      operationId: get_dashboard_by_id_metabase_dashboards__dashboard_id__get
      security:
      - HTTPBearer: []
      - HTTPBearer: []
      parameters:
      - name: dashboard_id
        in: path
        required: true
        schema:
          type: integer
          title: Dashboard Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetabaseDashboardDetail'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /metabase/dashboards/sync-all:
    post:
      tags:
      - METABASE
      summary: Trigger Sync All Dashboards
      description: 'Trigger the Celery worker to sync Metabase dashboards for all tenants.


        Returns HTTP 202 with queued task id so the UI can track it.'
      operationId: trigger_sync_all_dashboards_metabase_dashboards_sync_all_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Trigger Sync All Dashboards Metabase Dashboards Sync All Post
      security:
      - HTTPBearer: []
      - HTTPBearer: []
  /metabase/has-tag:
    get:
      tags:
      - METABASE
      summary: Has Dashboard Tag
      description: "Check whether the provided tag exists in any `SpacesDashboard` for the current tenant\
        \ (case-insensitive).\n\nArgs:\n    tag: The tag to check for\n\nReturns:\n    True if present\
        \ (case-insensitive), else False"
      operationId: has_dashboard_tag_metabase_has_tag_get
      security:
      - HTTPBearer: []
      - HTTPBearer: []
      parameters:
      - name: tag
        in: query
        required: true
        schema:
          type: string
          minLength: 1
          description: Tag to check for in dashboards
          title: Tag
        description: Tag to check for in dashboards
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: boolean
                title: Response Has Dashboard Tag Metabase Has Tag Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SyncDashboardMetadataRequest:
      properties:
        tenant_name:
          type: string
          title: Tenant Name
        collections:
          items:
            $ref: '#/components/schemas/MetabaseCollectionSync'
          type: array
          title: Collections
        dashboards:
          items:
            $ref: '#/components/schemas/MetabaseDashboardSync'
          type: array
          title: Dashboards
        fetch_timestamp:
          type: string
          title: Fetch Timestamp
      type: object
      required:
      - tenant_name
      - collections
      - dashboards
      - fetch_timestamp
      title: SyncDashboardMetadataRequest
    MetabaseCollectionSync:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        color:
          anyOf:
          - type: string
          - type: 'null'
          title: Color
        parent_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Parent Id
        personal_owner_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Personal Owner Id
        created_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Created At
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
        archived:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Archived
        slug:
          anyOf:
          - type: string
          - type: 'null'
          title: Slug
        location:
          anyOf:
          - type: string
          - type: 'null'
          title: Location
        namespace:
          anyOf:
          - type: string
          - type: 'null'
          title: Namespace
        authority_level:
          anyOf:
          - type: string
          - type: 'null'
          title: Authority Level
        type:
          anyOf:
          - type: string
          - type: 'null'
          title: Type
      type: object
      required:
      - id
      - name
      title: MetabaseCollectionSync
    MetabaseDashboardSync:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        collection_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Collection Id
        collection_position:
          anyOf:
          - type: integer
          - type: 'null'
          title: Collection Position
        creator_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Creator Id
        created_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Created At
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
        archived:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Archived
        public_uuid:
          anyOf:
          - type: string
          - type: 'null'
          title: Public Uuid
        made_public_by_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Made Public By Id
        enable_embedding:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Enable Embedding
        embedding_params:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Embedding Params
        caveats:
          anyOf:
          - type: string
          - type: 'null'
          title: Caveats
        points_of_interest:
          anyOf:
          - type: string
          - type: 'null'
          title: Points Of Interest
        show_in_getting_started:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Show In Getting Started
        position:
          anyOf:
          - type: integer
          - type: 'null'
          title: Position
        parameters:
          anyOf:
          - items:
              additionalProperties: true
              type: object
            type: array
          - type: 'null'
          title: Parameters
        tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Tags
        auto_apply_filters:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Auto Apply Filters
        cache_field_values_schedule:
          anyOf:
          - type: string
          - type: 'null'
          title: Cache Field Values Schedule
        cache_duration:
          anyOf:
          - type: integer
          - type: 'null'
          title: Cache Duration
      type: object
      required:
      - id
      - name
      title: MetabaseDashboardSync
    MetabaseJWTResponse:
      properties:
        jwt:
          type: string
          title: Jwt
      type: object
      required:
      - jwt
      title: MetabaseJWTResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MetabaseJWTRequest:
      properties:
        groups:
          anyOf:
          - items: {}
            type: array
          - type: 'null'
          title: Groups
          default: []
        exp:
          anyOf:
          - type: integer
          - type: 'null'
          title: Exp
      type: object
      title: MetabaseJWTRequest
    CollectionOption:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        count:
          type: integer
          title: Count
      type: object
      required:
      - id
      - name
      - count
      title: CollectionOption
    MetabaseDashboardDetail:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        created_at:
          type: string
          title: Created At
        updated_at:
          type: string
          title: Updated At
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      type: object
      required:
      - id
      - name
      - created_at
      - updated_at
      title: MetabaseDashboardDetail
    MetabaseDashboard:
      properties:
        id:
          type: integer
          title: Id
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        created_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Created At
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
        tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Tags
        attributes:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Attributes
        dashboard_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Dashboard Id
        collection_id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Collection Id
        collection_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Collection Name
        dashboard_metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Dashboard Metadata
        collection_metadata:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Collection Metadata
        creator:
          anyOf:
          - $ref: '#/components/schemas/Creator'
          - type: 'null'
        view_count:
          anyOf:
          - type: integer
          - type: 'null'
          title: View Count
        last_viewed_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Viewed At
        tenant_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Name
      type: object
      required:
      - id
      - name
      title: MetabaseDashboard
    SyncDashboardMetadataResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        dashboards_synced:
          type: integer
          title: Dashboards Synced
        dashboards_updated:
          type: integer
          title: Dashboards Updated
        dashboards_deleted:
          type: integer
          title: Dashboards Deleted
        total_dashboards:
          type: integer
          title: Total Dashboards
        tenant:
          type: string
          title: Tenant
        processing_time_seconds:
          type: number
          title: Processing Time Seconds
      type: object
      required:
      - success
      - message
      - dashboards_synced
      - dashboards_updated
      - dashboards_deleted
      - total_dashboards
      - tenant
      - processing_time_seconds
      title: SyncDashboardMetadataResponse
    SyncDashboardMetadataErrorResponse:
      properties:
        success:
          type: boolean
          title: Success
        error:
          type: string
          title: Error
        tenant:
          type: string
          title: Tenant
      type: object
      required:
      - success
      - error
      - tenant
      title: SyncDashboardMetadataErrorResponse
    Creator:
      properties:
        id:
          anyOf:
          - type: integer
          - type: 'null'
          title: Id
        email:
          anyOf:
          - type: string
          - type: 'null'
          title: Email
        first_name:
          anyOf:
          - type: string
          - type: 'null'
          title: First Name
        last_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Last Name
        common_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Common Name
      type: object
      title: Creator
    DashboardsResponse:
      properties:
        dashboards:
          items:
            $ref: '#/components/schemas/MetabaseDashboard'
          type: array
          title: Dashboards
        count:
          type: integer
          title: Count
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
        total_pages:
          type: integer
          title: Total Pages
        has_next:
          type: boolean
          title: Has Next
        has_previous:
          type: boolean
          title: Has Previous
        available_tags:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Available Tags
        available_collections:
          anyOf:
          - items:
              $ref: '#/components/schemas/CollectionOption'
            type: array
          - type: 'null'
          title: Available Collections
      type: object
      required:
      - dashboards
      - count
      - total
      - page
      - page_size
      - total_pages
      - has_next
      - has_previous
      title: DashboardsResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
servers:
- url: https://api.myaltimate.com
  description: Base URL reconciled from apis.yml