Accessing data
Get an access token and query runtime entities, associations and stream data through the OctoMesh GraphQL API, with curl and Python.
All information regarding access to data
View all tagsGet an access token and query runtime entities, associations and stream data through the OctoMesh GraphQL API, with curl and Python.
Aggregation queries compute summary values (averages, totals, extremes) across time-series data points instead of returning individual rows. Use these when you need calculated metrics rather than raw data — for example, the average voltage over the last hour or the total energy produced per machine.
Association Roles define the relationship types between entities. Each role specifies the multiplicity and naming for both directions of the relationship (inbound and outbound).
Associations define relationships between entities in the runtime model. This chapter describes how to query and navigate associations.
Attributes are reusable property definitions that can be applied to types. Each attribute has a value type and optional constraints.
This chapter provides best practices for writing efficient and maintainable GraphQL queries and mutations.
Models with ckLanguage 1).
The Construction Kit defines the schema and structure of your data model. Unlike the Runtime Model which stores actual data instances, the Construction Kit contains the metadata that defines what types of entities can exist, their attributes, relationships, and constraints.
GraphQL allows to query and mutate data. Mutations are operations like create, update and delete. This chapter describes how data can be created.
GraphQL allows to query and mutate data. Mutations are operations like create, update and delete. This chapter describes how data can be deleted.
A downsampling query reduces the density of time-series data by dividing a time range into equal-sized buckets and applying an aggregation function to each bucket. This is essential for visualizing large datasets on dashboards and charts — instead of transferring thousands of raw data points, you get a manageable number of summarized values.
Enums define a fixed set of allowed values for an attribute. Each enum value has a numeric key, a name, and an optional description.
This chapter describes how errors are returned in GraphQL responses and how to handle them.
This page is the architectural foundation for stream data: the mental model and vocabulary you need before reading either the full Stream Data Archives reference or the Rollups & recompute deep-dive. It explains how the pieces fit together — the two-store split, the three archive types, how rows are stored, how an archive moves through its lifecycle, and what happens on the write and read paths — and then hands off to the reference and deep-dive pages for the exhaustive detail.
Models are containers that group related types, attributes, enums, and records. Each model has a name, version, and can depend on other models.
In OctoMesh, we understand that data is at the heart of your operations. This chapter focuses on how you can access and interact with your data through our Construction Kits (CK), tailored for both runtime data and stream (time series) data. Leveraging GraphQL endpoints, OctoMesh offers a seamless and efficient way to work with your data, regardless of its nature.
Stream data provides access to time-series data stored in CrateDB. While runtime queries retrieve the current state of entities from MongoDB, stream data queries retrieve historical measurements and events recorded over time — such as sensor readings, machine metrics, or energy production values.
Persisted queries are saved query definitions stored as runtime entities. Instead of specifying all query parameters every time, you create a query definition once and execute it by its rtId. This is useful for dashboard widgets, recurring reports, and any scenario where the same query needs to be executed repeatedly.
Records are composite value types that group related attributes together. Unlike types, records are embedded directly within entities rather than being independent entities with their own runtime IDs.
This chapter describes common query patterns for retrieving Construction Kit metadata. The Construction Kit API is read-only - you query the model structure but cannot modify it through GraphQL.
API Approaches
This page is the engineer-facing companion to Stream Data Archives. It explains how a RollupArchive keeps its derived aggregations correct as the underlying data changes — the detection criterion, the dirty-windows ledger, the dependency graph, the periodic orchestrator, and the optimistic atomic swap that keeps readers on a consistent snapshot throughout.
GraphQL allows to query and mutate data. Mutations are operations like create, update and delete. This chapter describes how data can be created, retrieved, updated and deleted. It provides a reference for the GraphQL scalar types, input types, and enums used in the OctoMesh GraphQL API.
The SearchFilter provides text search capabilities across multiple attributes of an entity. It is optimized for text-based searches and is typically used for search fields in list views.
This page describes how the asset repository GraphQL API, the identity-provider REST API, MCP and octo-cli handle attributes of value type Secret. The rule in one sentence: you can write a secret, and you can see whether it is set — no API returns the value.
A simple query retrieves raw time-series rows from CrateDB. You choose which columns to return and can apply filters, sorting, and time range restrictions. This is the most fundamental stream data query type — use it when you need individual data points rather than aggregated summaries.
A Stream Data Archive is the unit of configuration and storage for time-series data in OctoMesh. Each archive is a versioned, typed, per-tenant CrateDB table that captures a curated set of attribute paths from a Construction Kit type. Archives have a strict lifecycle (Created → Activated → Disabled / Failed), a schema that is frozen once activated (the one exception is adding a declared column, see Conflict precedence), and a three-tier activation gate (instance → tenant → archive) that determines whether the data plane is open.
This chapter describes how to create System Queries. For an overview of System Queries and their use cases, see System Queries.
System Queries are reusable query configurations stored in the repository. They allow you to define a query once and execute it from multiple places using only its ID.
This chapter describes how to update System Queries. For an overview of System Queries and their use cases, see System Queries.
Stream data is always stored in UTC. Many questions, however, are asked in civil (wall-clock) time for a specific place: "what were the values **yesterday**? this week? last month?" — meaning the local day / week / month boundaries of a chosen time zone, not a UTC day that is shifted against the local one.
Transient queries allow you to dynamically query runtime entities with configurable column paths. Unlike regular queries where the returned fields are defined in the GraphQL query itself, transient queries return data in a table-like structure with rows and cells.
Types define the structure of entities in the Runtime Model. Each type has attributes, can inherit from a base type, and can participate in associations with other types.
GraphQL allows to query and mutate data. Mutations are operations like create, update and delete. This chapter describes how data can be updated.