Amigo Dashboards API

The Dashboards API from Amigo — 4 operation(s) for dashboards.

OpenAPI Specification

amigo-dashboards-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amigo Account Dashboards API
  version: 0.1.0
servers:
- url: https://api.amigo.ai
- url: https://internal-api.amigo.ai
- url: https://api-eu-central-1.amigo.ai
- url: https://api-ap-southeast-2.amigo.ai
- url: https://api-ca-central-1.amigo.ai
security:
- Bearer-Authorization: []
  Bearer-Authorization-Organization: []
  Basic: []
tags:
- name: Dashboards
paths:
  /v1/{workspace_id}/dashboards:
    post:
      tags:
      - Dashboards
      summary: Create Dashboard
      operationId: create_dashboard_v1__workspace_id__dashboards_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDashboardRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
    get:
      tags:
      - Dashboards
      summary: List Dashboards
      operationId: list_dashboards_v1__workspace_id__dashboards_get
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: page_context
        in: query
        required: false
        schema:
          anyOf:
          - enum:
            - home
            - patients
            - calls
            - data
            - analytics
            - pipeline
            - operators
            - surfaces
            - compliance
            - custom
            type: string
          - type: 'null'
          title: Page Context
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          exclusiveMinimum: 0
          default: 10
          title: Limit
      - name: continuation_token
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Continuation Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_DashboardDefinitionResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/{workspace_id}/dashboards/{dashboard_id}:
    get:
      tags:
      - Dashboards
      summary: Get Dashboard
      operationId: get_dashboard_v1__workspace_id__dashboards__dashboard_id__get
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: dashboard_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Dashboard Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - Dashboards
      summary: Update Dashboard
      operationId: update_dashboard_v1__workspace_id__dashboards__dashboard_id__put
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: dashboard_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Dashboard Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDashboardRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Dashboards
      summary: Delete Dashboard
      operationId: delete_dashboard_v1__workspace_id__dashboards__dashboard_id__delete
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: dashboard_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Dashboard Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/{workspace_id}/dashboards/by-slug/{slug}:
    get:
      tags:
      - Dashboards
      summary: Get Dashboard By Slug
      operationId: get_dashboard_by_slug_v1__workspace_id__dashboards_by_slug__slug__get
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardDefinitionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/{workspace_id}/dashboards/{dashboard_id}/execute:
    post:
      tags:
      - Dashboards
      summary: Execute Dashboard
      description: 'Execute all panel queries and return results for rendering.


        SQL injection is mitigated by ResearchQueryService.execute_sql, which calls

        _validate_read_only_sql to block DROP/TRUNCATE/ALTER/CREATE/GRANT/REVOKE/

        DELETE/UPDATE/INSERT statements. Catalog-level access is further restricted

        by the service principal''s Databricks grants (read-only on analytics catalog).


        Every panel query MUST reference the ``:ws_id`` parameter so that

        ResearchQueryService binds it to the requesting workspace. Queries

        without this binding are rejected to prevent cross-tenant data access.'
      operationId: execute_dashboard_v1__workspace_id__dashboards__dashboard_id__execute_post
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: dashboard_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Dashboard Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/ExecutePanelRequest'
              - type: 'null'
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DashboardExecuteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExecutePanelRequest:
      properties:
        filter_values:
          additionalProperties: true
          type: object
          title: Filter Values
          description: Filter values to apply to panel queries
      type: object
      title: ExecutePanelRequest
    NameString:
      type: string
      maxLength: 256
      minLength: 1
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DashboardDefinitionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        workspace_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Workspace Id
        slug:
          type: string
          title: Slug
          description: URL-safe identifier
        title:
          type: string
          title: Title
          description: Dashboard display title
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
          description: Human-readable description
        page_context:
          anyOf:
          - type: string
          - type: 'null'
          title: Page Context
          description: Developer console page where this dashboard renders
        panels:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Panels
          description: Ordered list of panel definitions
        filters:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Filters
          description: Dashboard-level filter controls
        refresh_interval:
          type: integer
          title: Refresh Interval
          description: Auto-refresh interval in seconds
        is_active:
          type: boolean
          title: Is Active
          description: Whether the dashboard is active
        created_by:
          anyOf:
          - type: string
          - type: 'null'
          title: Created By
          description: Creator identifier
        created_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created At
          description: When the dashboard was created
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
          description: When the dashboard was last updated
      type: object
      required:
      - id
      - slug
      - title
      - panels
      - filters
      - refresh_interval
      - is_active
      title: DashboardDefinitionResponse
    DashboardExecuteResponse:
      properties:
        dashboard_id:
          type: string
          format: uuid
          title: Dashboard Id
        results:
          items:
            $ref: '#/components/schemas/PanelResultResponse'
          type: array
          title: Results
      type: object
      required:
      - dashboard_id
      - results
      title: DashboardExecuteResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    PanelResultResponse:
      properties:
        panel_id:
          type: string
          title: Panel Id
          description: Panel identifier from the definition
        columns:
          items:
            type: string
          type: array
          title: Columns
          description: Column names
        rows:
          items:
            items: {}
            type: array
          type: array
          title: Rows
          description: Result rows
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
          description: Error message if query failed
      type: object
      required:
      - panel_id
      - columns
      - rows
      title: PanelResultResponse
    CreateDashboardRequest:
      properties:
        slug:
          type: string
          maxLength: 128
          minLength: 2
          pattern: ^[a-z0-9][a-z0-9\-]*$
          title: Slug
        title:
          $ref: '#/components/schemas/NameString'
        description:
          anyOf:
          - $ref: '#/components/schemas/DescriptionString'
          - type: 'null'
        page_context:
          anyOf:
          - type: string
            enum:
            - home
            - patients
            - calls
            - data
            - analytics
            - pipeline
            - operators
            - surfaces
            - compliance
            - custom
          - type: 'null'
          title: Page Context
        panels:
          items:
            additionalProperties: true
            type: object
          type: array
          maxItems: 50
          title: Panels
        filters:
          items:
            additionalProperties: true
            type: object
          type: array
          maxItems: 20
          title: Filters
        refresh_interval:
          type: integer
          maximum: 86400.0
          minimum: 10.0
          title: Refresh Interval
          default: 300
      type: object
      required:
      - slug
      - title
      title: CreateDashboardRequest
    UpdateDashboardRequest:
      properties:
        slug:
          anyOf:
          - type: string
            maxLength: 128
            minLength: 2
            pattern: ^[a-z0-9][a-z0-9\-]*$
          - type: 'null'
          title: Slug
        title:
          anyOf:
          - $ref: '#/components/schemas/NameString'
          - type: 'null'
        description:
          anyOf:
          - $ref: '#/components/schemas/DescriptionString'
          - type: 'null'
        page_context:
          anyOf:
          - type: string
            enum:
            - home
            - patients
            - calls
            - data
            - analytics
            - pipeline
            - operators
            - surfaces
            - compliance
            - custom
          - type: 'null'
          title: Page Context
        panels:
          anyOf:
          - items:
              additionalProperties: true
              type: object
            type: array
            maxItems: 50
          - type: 'null'
          title: Panels
        filters:
          anyOf:
          - items:
              additionalProperties: true
              type: object
            type: array
            maxItems: 20
          - type: 'null'
          title: Filters
        refresh_interval:
          anyOf:
          - type: integer
            maximum: 86400.0
            minimum: 10.0
          - type: 'null'
          title: Refresh Interval
      type: object
      title: UpdateDashboardRequest
    PaginatedResponse_DashboardDefinitionResponse_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DashboardDefinitionResponse'
          type: array
          title: Items
        has_more:
          type: boolean
          title: Has More
        continuation_token:
          anyOf:
          - type: integer
          - type: 'null'
          title: Continuation Token
        total:
          anyOf:
          - type: integer
          - type: 'null'
          title: Total
      type: object
      required:
      - items
      - has_more
      title: PaginatedResponse[DashboardDefinitionResponse]
    DescriptionString:
      type: string
      maxLength: 2000
  securitySchemes:
    Bearer-Authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the [`SignInWithAPIKey`](sign-in-with-api-key) endpoint.
    Bearer-Authorization-Organization:
      type: apiKey
      in: header
      name: X-ORG-ID
      description: An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.
    Basic:
      type: http
      scheme: basic
      description: The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.