---
title: "Get integration schema"
method: GET
path: "/v3/teams/{team_id}/integrations/{integration_id}/schema"
tags: ["v3", "Schema"]
---

# Get integration schema

`GET /v3/teams/{team_id}/integrations/{integration_id}/schema`

Supported for any integration type that provides schema and metadata information.
Currently, this is only databases- and cube-type integrations.

## Path parameters

- `team_id` string, required
- `integration_id` string, required

## Query parameters

- `maxAge` integer — Max age acceptable for when schema was last refreshed (minutes)

## Response `200`

Success

- SchemaResponse
  - `data` union, required
    - CubeMetadataResponse
      - `version` string
      - `type` 'cubes'
      - `cubes` ExtendedCubeMeta[], required
        - `name` string, required — The unique identifier for the cube. Must be unique among all cubes and views within a deployment and follow the naming conventions.
        - `type` 'view' | 'cube', nullable — Specifies the type of the cube. This can be used to differentiate between different types of cubes, such as `view` or `cube`.
        - `title` string, nullable — A human-readable display name for the cube. By default, Cube will humanize the cube's name (e.g., `users_orders` becomes `Users Orders`). Use this parameter to customize the display name if the default isn't suitable.
        - `description` string, nullable — A brief description of the cube to help your team understand its purpose and contents. Useful for ensuring that the data is interpreted correctly by users.
        - `fileName` string, nullable — The file name associated with the cube definition.
        - `sqlTable` string, nullable — Specifies the table in the database that this cube will query. It is a concise alternative to the `sql` parameter when querying entire tables.
        - `sql` string, nullable — The SQL query that generates the table to be queried by the cube. Typically takes the form of a `SELECT * FROM table` query. For simple table queries, prefer using the `sql_table` parameter.
        - `sqlAlias` string, nullable — Custom SQL alias for the cube. Useful when the auto-generated alias is too long and may be truncated by the database.
        - `dataSource` string, nullable — Specifies the data source name for the cube. This is useful when data should be fetched from multiple databases. The value is passed to the `driverFactory()` function as part of the context.
        - `public` boolean, nullable — Controls the visibility of the cube. When set to `False`, the cube cannot be queried through the API. Defaults to `True`.
        - `isVisible` boolean, nullable — Determines if the cube should be visible in the UI. If set to `False`, it will be hidden from the user interface.
        - `meta` object, nullable — Custom metadata for the cube. Can be used to pass additional information to the frontend.
        - `refreshKey` object, nullable — Defines the refresh key for the cube, used by Cube's caching layer to determine when the data should be refreshed. Can be specified using SQL or an interval (e.g., `every: '1 hour'`).
        - `extends` string, nullable — Allows extending another cube to reuse its declared members, such as `sql` or `measures`. Useful for creating variations of existing cubes without redefining all properties.
        - `measures` V1CubeMetaMeasure[], required — List of measures defined within the cube. Measures represent aggregated data points such as counts, sums, or averages.
          - `name` string, required — The unique identifier for the measure. It must be unique among all measures, dimensions, and segments within a cube and must follow naming conventions.
          - `title` string, nullable — A human-readable display name for the measure. By default, Cube will humanize the measure's name, but you can use this parameter to customize it.
          - `shortTitle` string, nullable — A short human-readable name for the dimension. This can be used in places where a shorter label is needed.
          - `description` string, nullable — A description providing more context about what the measure represents. This is useful for ensuring that users understand the metric correctly.
          - `sql` string, nullable — A required parameter that defines the SQL expression used to calculate the measure. Depending on the measure type, this can be an aggregation, a simple SQL expression, or even a calculation involving other measures.
          - `type` 'string' | 'time' | 'boolean' | 'number' | 'count' | 'count_distinct' | 'count_distinct_approx' | 'sum' | 'avg' | 'min' | 'max', required — A required parameter that specifies the type of aggregation or calculation the measure represents.
          - `format` 'percent' | 'currency' | 'number', nullable — Defines how the measure's output should be formatted.
          - `filters` object[], nullable — Optional parameter for defining conditions that must be met for the measure's calculation. This is specified as an array of SQL conditions that are applied to the measure.
          - `drillMembers` string[], nullable — An array of dimensions that can be used to drill down into the measure. These dimensions provide additional detail when exploring the measure's value.
          - `public` boolean, nullable — Controls the visibility of the measure. When set to `False`, the measure cannot be queried through the API. Defaults to `True`.
          - `cumulative` boolean, nullable — Indicates whether the measure is cumulative, meaning it accumulates values over time.
          - `cumulativeTotal` boolean, nullable — Indicates whether the measure represents a cumulative total.
          - `rollingWindow` object, nullable — Defines a rolling window for the measure, allowing the calculation of metrics within a specified time window. The window can be defined with trailing and leading parameters, and it only works with a single time dimension with a defined date range.
          - `meta` object, nullable — Custom metadata associated with the measure, which can be used to pass additional information to the frontend.
        - `dimensions` V1CubeMetaDimension[], required — List of dimensions defined within the cube. Dimensions represent categorical data such as dates, strings, or numbers.
          - `name` string, required — The unique identifier for the dimension. It must be unique among all dimensions, measures, and segments within a cube and follow naming conventions.
          - `title` string, nullable — A human-readable display name for the dimension. By default, Cube will humanize the dimension's name, but you can use this parameter to customize it.
          - `shortTitle` string, nullable — A short human-readable name for the dimension. This can be used in places where a shorter label is needed.
          - `description` string, nullable — A description providing more context about what the dimension represents. This is useful for ensuring that users understand the attribute correctly.
          - `sql` string, nullable — A required parameter that defines the SQL expression used to derive the dimension's value. The SQL should return a value consistent with the dimension's type.
          - `type` 'time' | 'string' | 'number' | 'boolean' | 'geo', required — A required parameter that specifies the type of data the dimension represents.
          - `format` union — Optional parameter to define how the dimension's output should be formatted. Supported formats include `imageUrl`, `id`, `link`, `currency`, and `percent`.
            - 'imageUrl' | 'id' | 'link' | 'currency' | 'percent' | 'number'
            - V1CubeMetaDimensionLinkFormat
              - …
          - `case` object, nullable — Optional parameter to define the dimension based on SQL conditions using a case statement. It allows for conditionally assigning labels based on the SQL conditions.
          - `meta` object, nullable — Custom metadata associated with the dimension, which can be used to pass additional information to the frontend.
          - `primaryKey` boolean, nullable — Specifies if the dimension is the primary key for the cube. Setting this to `True` will change the default value of the `public` parameter to `False`.
          - `propagateFiltersToSubQuery` boolean, nullable — When set to `True`, the filters applied to the query will be passed to the subquery.
          - `public` boolean, nullable — Controls the visibility of the dimension. When set to `False`, the dimension cannot be queried through the API. Defaults to `True`.
          - `subQuery` boolean, nullable — Enables referencing a measure in a dimension by setting this to `True`. This is an advanced concept that allows for more complex dimension definitions.
        - `segments` V1CubeMetaSegment[], required — List of segments defined within the cube. Segments represent predefined filters on the data, such as 'Active Users'.
          - `name` string — The unique identifier for the segment. It must be unique among all segments, dimensions, and measures within a cube and follow naming conventions.
          - `title` string, nullable — A human-readable display name for the segment. By default, Cube will humanize the segment's title, but you can use this parameter to customize it.
          - `shortTitle` string, nullable — A short human-readable name for the segment. This can be used in places where a shorter label is needed.
          - `description` string, nullable — A description providing more context about what the segment represents. This is useful for ensuring that users understand the attribute correctly.
          - `sql` string, nullable — A required parameter that defines the SQL expression used to filter the data for this segment. The SQL should be valid within a WHERE clause and can implement complex filtering logic.
          - `public` boolean, nullable — Controls the visibility of the segment. When set to `False`, the segment cannot be queried through the API. Defaults to `True`.
        - `joins` V1CubeMetaJoin[], nullable — List of joins between this cube and other cubes. Joins define relationships between cubes, allowing for complex data retrievals.
          - `name` string, required — The name of the joined cube. It must match the name of the cube being joined and follow the naming conventions.
          - `relationship` 'one_to_one' | 'one_to_many' | 'many_to_one' | 'has_one' | 'has_many' | 'belongs_to' | 'hasOne' | 'hasMany' | 'belongsTo', required — The type of relationship between the cubes. Valid relationships are `one_to_one`, `one_to_many`, and `many_to_one`.
          - `sql` string, nullable — The SQL ON clause that specifies the join condition between the cubes. It is important to accurately define the matching columns to ensure correct join behavior.
        - `preAggregations` unknown[], nullable — List of pre-aggregations defined for the cube. Pre-aggregations are used to speed up query performance by storing pre-computed results.
          - unknown
        - `connectedComponent` integer, nullable — ID of the connected component associated with the cube. This is used internally for query planning and optimization.
    - DatabaseSchemaResponse
      - `version` string
      - `type` 'databases'
      - `databases` union[], required
        - union
          - DatabaseWithTables
            - `name` string, required
            - `path` string, required
            - `description` string, nullable — Optional description
            - `tags` string[] — Optional tags
            - `childType` 'tables', required
            - `tables` Table[], required
              - …
          - DatabaseWithSchemas
            - `name` string, required
            - `path` string, required
            - `description` string, nullable — Optional description
            - `tags` string[] — Optional tags
            - `childType` 'schemas', required
            - `schemas` Schema[], required
              - …

## Other responses

- `400` — Integration type does not provide a schema
- `404` — Integration or schema not found
- `422` — Validation Error
- `424` — Connection details are invalid
- `500` — Server exception
- `504` — Upstream service timeout

---

[API](https://skmtc.dev/definite/apis/defapi.md) · [All operations](https://skmtc.dev/definite/apis/defapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/definite/defapi/revisions/3943d8deb3be/schema)
