Lytics Streams API

Get metrics and events for data streams in your Lytics account.

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /stream List data streams · List Streams #
Ask an LLM
“Which event streams are flowing into my account?”
“Can I list every data stream in one call?”
Tell an agent
List all my data streams.
Show the streams on account {account_id}.
GET /stream/rule List stream rules · List Stream rules #
Ask an LLM
“What stream routing rules are configured?”
“Can I see every stream rule on the account?”
Tell an agent
List all my stream rules.
Show the stream rules on account {account_id}.
POST /stream/rule Create a stream rule · Create stream rule #
Ask an LLM
“How do I route events from one stream into another with a rule?”
“Can a stream rule use an expression to filter events?”
Tell an agent
Create stream rule {name} from {input} to {output} using {expression}.
Add a new rule {name} with priority {priority}.
DELETE /stream/rule/{id} Delete a stream rule · Delete stream rule #
Ask an LLM
“How do I delete a stream rule I no longer need?”
“Can I remove a routing rule permanently?”
Tell an agent destructive · confirm first
Delete stream rule {id}.
Permanently remove routing rule {id}.
GET /stream/rule/{id} Get one stream rule · Get Stream rule #
Ask an LLM
“What expression does a specific stream rule apply?”
“Can I fetch a single stream rule by its id?”
Tell an agent
Show stream rule {id}.
Fetch the definition of stream rule {id}.
POST /stream/rule/{id} Update a stream rule (POST) · Update stream rule #
Ask an LLM
“Is there a POST version of updating a stream rule?”
“Can I change a rule's input and output streams with a POST?”
Tell an agent
POST an update to stream rule {id} routing {input} into {output}.
Via POST, set the priority of stream rule {id} to {priority}.
PUT /stream/rule/{id} Update a stream rule (PUT) · Update stream rule #
Ask an LLM
“Can I replace a stream rule's expression with a PUT?”
“Is there a PUT call to switch a stream rule on or off?”
Tell an agent
PUT an update to stream rule {id} setting active to {active}.
Use PUT to change rule {id} expression to {expression}.
GET /stream/{name} Get a stream by name · Get Stream #
Ask an LLM
“What do I know about the default stream?”
“Can I look up one data stream by its name?”
Tell an agent
Show stream {name}.
Get the details of data stream {name}.
GET /stream/{name}/events See recent events in a stream · Get Stream Events #
Ask an LLM
“What raw events arrived in a stream most recently?”
“Can I check that my tag is sending events into a stream?”
Tell an agent
Show recent events in stream {name}.
List the latest raw events received on {name}.
GET /stream/{name}/stats Get field statistics for a stream · Get Stream Stats #
Ask an LLM
“Which fields appear in a stream and how often?”
“Can I get per-field stats for one data stream?”
Tell an agent
Show field stats for stream {name}.
Summarize how often each field shows up in {name}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lytics:lytics-streams-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

lytics-streams-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact:
    email: support@lytics.com
    name: Lytics Support
    url: https://support.lytics.com/hc/en-us
  description: Version 2 of the Lytics API
  termsOfService: https://www.lytics.com/terms-of-service/
  title: Lytics Streams API
  version: '2.0'
servers:
- url: https://api.lytics.io/v2
tags:
- description: Get metrics and events for data streams in your Lytics account.
  name: Streams
paths:
  /stream:
    get:
      description: List all streams in the account
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      items:
                        $ref: '#/components/schemas/models.StreamMetadata'
                      type: array
                  type: object
          description: Streams Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: List Streams
      tags:
      - Streams
      operationId: getStream
      x-operation-id-source: derived
  /stream/rule:
    get:
      description: List all stream rules in the account
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      items:
                        $ref: '#/components/schemas/models.RouteRule'
                      type: array
                  type: object
          description: List of stream rules
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: List Stream rules
      tags:
      - Streams
      operationId: getStreamRule
      x-operation-id-source: derived
    post:
      description: Create a stream rule
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/models.RouteRule'
        description: Stream rule Request
        required: true
        x-originalParamName: rule
      responses:
        '201':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      $ref: '#/components/schemas/models.RouteRule'
                  type: object
          description: Stream rule
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Create stream rule
      tags:
      - Streams
      operationId: postStreamRule
      x-operation-id-source: derived
  /stream/rule/{id}:
    delete:
      description: Delete stream rule by id
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: Stream rule id
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      $ref: '#/components/schemas/models.RouteRule'
                  type: object
          description: Stream rule response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Delete stream rule
      tags:
      - Streams
      operationId: deleteStreamRuleById
      x-operation-id-source: derived
    get:
      description: Get stream rule by id
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: Stream rule id
        in: path
        name: id
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      $ref: '#/components/schemas/models.RouteRule'
                  type: object
          description: Stream rule response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Get Stream rule
      tags:
      - Streams
      operationId: getStreamRuleById
      x-operation-id-source: derived
    post:
      description: Update a stream rule
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: Stream rule id to update
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/models.RouteRule'
        description: Stream rule request
        required: true
        x-originalParamName: rule
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      $ref: '#/components/schemas/models.RouteRule'
                  type: object
          description: Stream rule response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Update stream rule
      tags:
      - Streams
      operationId: postStreamRuleById
      x-operation-id-source: derived
    put:
      description: Update a stream rule
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: Stream rule id to update
        in: path
        name: id
        required: true
        schema:
          type: string
      requestBody:
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/models.RouteRule'
        description: Stream rule request
        required: true
        x-originalParamName: rule
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      $ref: '#/components/schemas/models.RouteRule'
                  type: object
          description: Stream rule response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Update stream rule
      tags:
      - Streams
      operationId: putStreamRuleById
      x-operation-id-source: derived
  /stream/{name}:
    get:
      description: Get stream by name
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: The Stream Name
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      $ref: '#/components/schemas/models.StreamMetadata'
                  type: object
          description: Stream Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Get Stream
      tags:
      - Streams
      operationId: getStreamByName
      x-operation-id-source: derived
  /stream/{name}/events:
    get:
      description: Get a list of recent events in the stream
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: The Stream Name
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      items:
                        $ref: '#/components/schemas/models.StreamEvent'
                      type: array
                  type: object
          description: Stream Events Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Get Stream Events
      tags:
      - Streams
      operationId: getStreamByNameEvents
      x-operation-id-source: derived
  /stream/{name}/stats:
    get:
      description: Get stats for all fields in the stream
      parameters:
      - description: The account ID. Defaults to the user's default account.
        in: query
        name: account_id
        schema:
          type: string
      - description: The Stream Name
        in: path
        name: name
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                allOf:
                - $ref: '#/components/schemas/models.ApiResponse'
                - properties:
                    data:
                      items:
                        $ref: '#/components/schemas/models.DataField'
                      type: array
                  type: object
          description: Stream Stats Response
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.ApiErrorResponse'
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
      summary: Get Stream Stats
      tags:
      - Streams
      operationId: getStreamByNameStats
      x-operation-id-source: derived
components:
  schemas:
    models.RuleCheckConfigReq:
      properties:
        allowable_violations:
          type: integer
        interval:
          type: string
        lookback_count:
          type: integer
        max_threshold:
          type: integer
        metric_type:
          type: string
        min_threshold:
          type: integer
        type:
          type: string
        variance_pct:
          type: number
      type: object
    models.StreamEvent:
      additionalProperties: true
      type: object
    models.ApiErrorResponse:
      properties:
        errors:
          description: Lytics API Errors
          items:
            $ref: '#/components/schemas/lioerrors.ApiV2ErrorOut'
          type: array
        request_id:
          type: string
        status:
          description: HTTP Status Code
          type: integer
      type: object
    models.DataField:
      properties:
        avg:
          type: integer
        card:
          type: integer
        columns:
          items:
            $ref: '#/components/schemas/models.Column'
          type: array
        first_seen:
          format: date-time
          type: string
        hidden:
          type: boolean
        is_array:
          type: boolean
        last_seen:
          type: string
        name:
          type: string
        sample:
          description: Sample values for the field
          items:
            type: string
          type: array
        sumlen:
          description: Length of string values in bytes
          type: integer
        type:
          type: string
        usage:
          description: The number of times this field has been seen
          type: integer
      type: object
    models.StreamMetadata:
      properties:
        account_id:
          type: string
        aid:
          type: integer
        anomaly_rule:
          $ref: '#/components/schemas/models.AnomalyRuleResp'
        avg_event_size:
          description: Average size of each message in bytes
          type: integer
        channel:
          type: string
        count:
          description: Current count of messages this stream has seen
          type: integer
        created:
          format: date-time
          type: string
        description:
          type: string
        hidden:
          type: boolean
        id:
          type: string
        internal:
          type: boolean
        jobs:
          description: Job IDs that have contributed data to the stream
          items:
            type: string
          type: array
        label:
          type: string
        last_msg_ts:
          format: date-time
          type: string
        last_received_ts:
          format: date-time
          type: string
        last_update_ts:
          format: date-time
          type: string
        method:
          type: string
        name:
          type: string
        providers:
          items:
            type: string
          type: array
        slug:
          type: string
        tables:
          items:
            type: string
          type: array
        updated:
          format: date-time
          type: string
      type: object
    models.Column:
      properties:
        as:
          type: string
        table:
          type: string
      type: object
    models.AnomalyRuleResp:
      properties:
        aid:
          type: integer
        checks:
          items:
            $ref: '#/components/schemas/models.RuleCheckConfigReq'
          type: array
        created:
          type: string
        id:
          type: string
        subject_id:
          type: string
        subject_type:
          type: string
        updated:
          type: string
      type: object
    models.ApiResponse:
      properties:
        _meta:
          additionalProperties: true
          description: Response Metadata
          type: object
        data:
          description: Response Payload
          type: object
        request_id:
          type: string
        status:
          description: HTTP Status Code
          type: integer
      type: object
    models.RouteRule:
      properties:
        account_id:
          type: string
        active:
          type: boolean
        aid:
          type: integer
        created:
          type: string
        expression:
          description: qlbridge expression
          type: string
        id:
          type: string
        input:
          type: string
        modified:
          type: string
        name:
          type: string
        output:
          type: string
        priority:
          type: integer
      type: object
    lioerrors.ApiV2ErrorOut:
      properties:
        code:
          description: Lytics Error Code
          enum:
          - UNKNOWN-000
          - BADREQ-001
          - JOB-BADREQ-002
          - NOTFOUND-003
          - JOB-NOTFOUND-004
          - WF-NOTFOUND-005
          - AUTH-NOTFOUND-006
          - AUTHTYPE-NOTFOUND-007
          - AUTH-BADREQ-008
          - TABLE-NOTFOUND-009
          - SCHEMA-NOTFOUND-010
          - SCHEMAVERSION-NOTFOUND-011
          - ENTITY-NOTFOUND-012
          - QUERY-NOTFOUND-013
          - STREAM-NOTFOUND-014
          - PROVIDER-BADREQ-015
          - PROVIDER-NOTFOUND-016
          - UNAUTHORIZED-017
          - SCHEMA-INVALID-018
          - INTERNAL-019
          - ROUTERULE-NOTFOUND-020
          - ACCOUNT-NOTFOUND-021
          - JOB-FAULT-022
          - USER-NOTFOUND-023
          - USER-BADREQ-024
          - JSON-BADREQ-025
          - FORBIDDEN-026
          type: string
        level:
          description: When the error was generated
          type: string
        message:
          description: A description of the error that occurred
          type: string
        timestamp:
          description: The time the error occurred
          format: date-time
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey