Keen Collections API

Inspect event collection schemas and properties for a project.

OpenAPI Specification

keen-collections-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Keen Cached Queries Collections API
  description: The Keen Cached Queries API allows developers to create, manage, and retrieve pre-defined queries that are automatically refreshed on a schedule. Cached queries improve performance for frequently accessed analytics by storing pre-computed results, making them ideal for powering dashboards and embedded analytics experiences without incurring per-request rate limits.
  version: '3.0'
  contact:
    name: Keen Support
    url: https://keen.io/support
  license:
    name: Proprietary
    url: https://keen.io/terms-of-service
servers:
- url: https://api.keen.io/3.0
  description: Keen production API
security:
- masterKey: []
- readKey: []
tags:
- name: Collections
  description: Inspect event collection schemas and properties for a project.
paths:
  /projects/{projectId}/events/{eventCollection}:
    parameters:
    - $ref: '#/components/parameters/projectId'
    - $ref: '#/components/parameters/eventCollection'
    get:
      operationId: inspectCollection
      summary: Keen Inspect collection schema
      description: Returns the inferred schema of an event collection, including the names and inferred types of properties seen in events that have been recorded. Requires a Master Key.
      tags:
      - Collections
      responses:
        '200':
          description: Collection schema returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string
                  properties:
                    type: object
                    additionalProperties:
                      type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
  /projects/{projectId}/events:
    parameters:
    - $ref: '#/components/parameters/projectId'
    get:
      operationId: listCollections
      summary: Keen List event collections
      description: Returns a list of event collections defined in the project along with metadata about each collection. Requires a Master Key.
      tags:
      - Collections
      responses:
        '200':
          description: List of event collections.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                    properties:
                      type: object
                      additionalProperties:
                        type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
  /projects/{projectId}/events/{eventCollection}/properties/{propertyName}:
    parameters:
    - $ref: '#/components/parameters/projectId'
    - $ref: '#/components/parameters/eventCollection'
    - name: propertyName
      in: path
      required: true
      schema:
        type: string
      description: Name of the event property to inspect.
    get:
      operationId: inspectProperty
      summary: Keen Inspect property
      description: Returns metadata about a single property in an event collection, such as the inferred data type. Requires a Master Key.
      tags:
      - Collections
      responses:
        '200':
          description: Property metadata returned.
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    Error:
      type: object
      properties:
        error_code:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    projectId:
      name: projectId
      in: path
      required: true
      schema:
        type: string
      description: Keen project identifier.
    eventCollection:
      name: eventCollection
      in: path
      required: true
      schema:
        type: string
      description: Name of the event collection.
  securitySchemes:
    masterKey:
      type: apiKey
      in: header
      name: Authorization
      description: Keen Master Key for management endpoints.
    readKey:
      type: apiKey
      in: header
      name: Authorization
      description: Keen Read Key for retrieving cached results.
externalDocs:
  description: Keen Cached Queries API Documentation
  url: https://keen.io/docs/api/#cached-queries