Amigo Sensorium API

The Sensorium API from Amigo — 2 operation(s) for sensorium.

OpenAPI Specification

amigo-sensorium-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amigo Account Sensorium 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: Sensorium
paths:
  /v1/{workspace_id}/sensorium/connector-health:
    get:
      tags:
      - Sensorium
      summary: Per-source event health for the workspace (last 24h)
      operationId: get-sensorium-connector-health
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectorHealthResponse'
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
  /v1/{workspace_id}/sensorium/loop-latency:
    get:
      tags:
      - Sensorium
      summary: Sense→act latency distribution for the workspace
      operationId: get-sensorium-loop-latency
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: window_hours
        in: query
        required: false
        schema:
          type: integer
          maximum: 168
          minimum: 1
          description: Window size in hours (1-168).
          default: 24
          title: Window Hours
        description: Window size in hours (1-168).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoopLatencyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
    ConnectorHealthItem:
      properties:
        source:
          type: string
          maxLength: 256
          minLength: 1
          title: Source
          description: Operator-defined source identifier as written to Delta world_events.source (e.g. 'charm', 'careclinic', 'hazel'). Enum-like; never user input.
        events_per_minute:
          type: number
          minimum: 0.0
          title: Events Per Minute
          description: Mean events/min over the last hour (events_last_hour / 60).
        events_last_hour:
          type: integer
          minimum: 0.0
          title: Events Last Hour
        events_last_24h:
          type: integer
          minimum: 0.0
          title: Events Last 24H
          description: Events ingested in the last 24 hours (rolling, not calendar-day).
        last_ingested_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Last Ingested At
        freshness:
          type: string
          enum:
          - fresh
          - stale
          - quiet
          - never
          title: Freshness
          description: fresh < 5min · stale 5-60min · quiet > 60min · never = no events in 24h
      type: object
      required:
      - source
      - events_per_minute
      - events_last_hour
      - events_last_24h
      - last_ingested_at
      - freshness
      title: ConnectorHealthItem
    LoopLatencyPointItem:
      properties:
        hour:
          type: string
          format: date-time
          title: Hour
          description: UTC hour bucket (truncated to the hour).
        count:
          type: integer
          title: Count
          description: Sensing→action pairs whose sensing event lands in this hour.
        p50_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: P50 Seconds
          description: Median latency for this hour; null if no pairs.
      type: object
      required:
      - hour
      - count
      title: LoopLatencyPointItem
    ConnectorHealthResponse:
      properties:
        sources:
          items:
            $ref: '#/components/schemas/ConnectorHealthItem'
          type: array
          maxItems: 500
          title: Sources
        as_of:
          type: string
          format: date-time
          title: As Of
          description: Server clock at query time (UTC).
        read_model_status:
          type: string
          enum:
          - ready
          - empty
          - unavailable
          title: Read Model Status
          description: ready = Lakebase projection returned rows; empty = no summary rows; unavailable = read failed.
        read_model_synced_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Read Model Synced At
          description: Most recent platform.connector_health_summary synced_at value in this response.
      type: object
      required:
      - as_of
      - read_model_status
      title: ConnectorHealthResponse
    LoopLatencyResponse:
      properties:
        as_of:
          type: string
          format: date-time
          title: As Of
          description: Server clock at query time (UTC).
        window_hours:
          type: integer
          title: Window Hours
        overall_count:
          type: integer
          title: Overall Count
          description: Total pairs across the window.
        overall_p50_seconds:
          anyOf:
          - type: number
          - type: 'null'
          title: Overall P50 Seconds
          description: Median latency across the whole window; null if no pairs.
        sparkline:
          items:
            $ref: '#/components/schemas/LoopLatencyPointItem'
          type: array
          maxItems: 168
          title: Sparkline
        truncated:
          type: boolean
          title: Truncated
          description: True when the underlying query hit the row cap; p50 is computed over the truncated sample.
          default: false
      type: object
      required:
      - as_of
      - window_hours
      - overall_count
      title: LoopLatencyResponse
  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.