---
title: "Get catalog"
method: GET
path: "/v1/catalogs/:catalog_key"
---

# Get catalog

`GET /v1/catalogs/:catalog_key`

Get the metadata and contents of a catalog. The service account must be permitted to view the chosen catalog.

## Path parameters

- `catalog_key` string, required

## Query parameters

- `files` union
  - 'raw' — Return the raw files from the catalog repository.
  - 'resolved' — Return both the raw and generated catalog files (for example, third-party semantic layer definitions converted to Count Metrics files).
- `definitions` 'json' — Return the catalog definitions in JSON format.

## Response `200`

Successful response

- object — Base response envelope for all successful API responses.
  - `success` true, required
  - `request_id` string, required
  - `result` object, required
    - `catalog` Catalog, required — A catalog
      - `key` string, required — The unique identifier for the catalog
      - `name` string, required — The display name for the catalog
      - `created_at` string, date-time, required — An ISO 8601 date-time string.
      - `description` string, required — A description of the catalog.
      - `modified_at` string, date-time, required — An ISO 8601 date-time string.
      - `permissions` object[], required — The list of actors with assigned permissions for this catalog.
        - `key` string, required — The unique identifier for the actor.
        - `role` union, required — A catalog role.
          - 'admin' — Catalog admin.
          - 'analyst' — Catalog analyst.
          - 'editor' — Catalog editor.
          - 'viewer' — Catalog viewer.
          - 'presentation_viewer' — Catalog presentation viewer.
        - `type` union, required — The type of actor.
          - 'user' — A workspace member
          - 'group' — A workspace group
          - 'service_account' — A service account
          - 'workspace' — All workspace members
      - `sources` object[], required — The connections that this catalog can access.
        - `connection_key` string, required — The unique identifier for the connection
        - `connection_name` string, required — The display name for the connection
      - `agent_context` string — Agent-specific context for this catalog. Note - this context is passed to canvases within this catalog. To update context for canvases consuming this catalog, add AGENTS.md files to the catalog instead.
    - `files` object[] — The catalog files (if requested)
      - `path` string, required — The file path.
      - `contents` string, required — The file contents.
      - `truncated` boolean, required — Whether the file contents are truncated - this can occur if the file is particularly large.
    - `definitions` object — The parsed catalog definitions (if requested).
      - `datasets` object[], required — The dataset definitions in this catalog.
        - `name` string, required — The name of the dataset.
        - `from` string — The name of the view that this dataset is based on.
        - `views` object[] — The views included in this dataset.
          - `name` string, required — The name of the view.
        - `description` string — A description of this dataset.
        - `join` object[] — The views joined into this dataset.
          - `constraint` string, required — The join constraint expression.
          - `relationship` union, required — The relationship cardinality.
            - 'one_to_one' — One-to-one relationship.
            - 'one_to_many' — One-to-many relationship.
            - 'many_to_one' — Many-to-one relationship.
            - 'many_to_many' — Many-to-many relationship.
          - `view` string, required — The name of the view to join.
          - `alias` string — An alias for the joined view.
          - `label` string — A display label for the joined view.
          - `type` union — The type of join.
            - 'inner' — Inner join.
            - 'left' — Left join.
            - 'right' — Right join.
            - 'full' — Full outer join.
        - `label` string — The display label for this dataset.
        - `path` string — The file path of the dataset definition.
        - `definition_type` union — The origin of this definition.
          - 'count' — A native Count Metrics definition.
          - 'converted-lookml' — A definition converted from a LookML source.
          - 'converted-osi' — A definition converted from a OSI source.
          - 'converted-snowflake' — A definition converted from a Snowflake source.
          - 'extended-count' — A native Count Metrics definition that extends another.
          - 'extended-lookml' — A LookML-converted definition that extends another.
          - 'extended-osi' — A OSI-converted definition that extends another.
          - 'extended-snowflake' — A Snowflake-converted definition that extends another.
      - `sha` string, nullable, required — The commit SHA.
      - `views` object[], required — The view definitions in this catalog.
        - `fields` object[], required — The fields in this view.
          - `expression` string, required — The SQL expression for this field.
          - `name` string, required — The name of the field.
          - `type` union, required — The data type of the field.
            - 'string' — A string field.
            - 'number' — A numeric field.
            - 'integer' — An integer field.
            - 'boolean' — A boolean field.
            - 'date' — A date/time field.
          - `aggregates` union[] — The aggregate functions available for this field.
            - union — An aggregate function.
              - …
          - `description` string — A description of the field.
          - `format` unknown
          - `group` string — The group this field belongs to.
          - `label` string — The display label for this field.
          - `primary_key` boolean — Whether this field is a primary key.
          - `timeframes` union[] — The timeframe functions available for this field.
            - union — A timeframe function.
              - …
          - `hidden` boolean — Whether this field is hidden.
        - `name` string, required — The name of the view.
        - `source` union, required — The data source for this view.
          - object — A query-based view source.
            - `type` 'query', required — A query source.
            - `connection` string, nullable, required — The unique identifier for the connection
            - `query` string, required — The SQL query.
            - `dependencies` object[] — Cell dependencies for this query.
              - …
            - `url` string — A URL associated with this source.
          - object — A table-based view source.
            - `type` 'table', required — A table source.
            - `connection` string, required — The unique identifier for the connection
            - `query` string, required — The query expression for the table.
            - `table` string, required — The table name.
        - `label` string — The display label for this view.
        - `description` string — A description of this view.
        - `caching` object — Caching settings for a view.
          - `duration` number, required — The cache duration in seconds.
          - `schedule` string — A [cron expression](https://crontab.guru) for the cache refresh schedule.
          - `wait_for_cache` boolean — Whether to wait for the cache to be populated before returning results.
        - `path` string — The file path of the view definition.
        - `joins` object[] — Joins to other views.
          - `view` string, required — The name of the view to join.
          - `constraint` string, required — The join constraint expression.
          - `relationship` union, required — The relationship cardinality.
            - 'one_to_one' — One-to-one relationship.
            - 'one_to_many' — One-to-many relationship.
            - 'many_to_one' — Many-to-one relationship.
            - 'many_to_many' — Many-to-many relationship.
          - `type` union — The type of join.
            - 'inner' — Inner join.
            - 'left' — Left join.
            - 'right' — Right join.
            - 'full' — Full outer join.
        - `definition_type` union — The origin of this definition.
          - 'count' — A native Count Metrics definition.
          - 'converted-lookml' — A definition converted from a LookML source.
          - 'converted-osi' — A definition converted from a OSI source.
          - 'converted-snowflake' — A definition converted from a Snowflake source.
          - 'extended-count' — A native Count Metrics definition that extends another.
          - 'extended-lookml' — A LookML-converted definition that extends another.
          - 'extended-osi' — A OSI-converted definition that extends another.
          - 'extended-snowflake' — A Snowflake-converted definition that extends another.
      - `invalid` boolean — Whether the catalog definitions contain validation errors.

## Other responses

- `4XX` — Client error. Possible status codes include: 400 (invalid request), 401 (missing or invalid API key), 403 (insufficient permissions), 404 (resource not found), 429 (rate limit exceeded).
- `5XX` — Internal server error.

---

[API](https://skmtc.net/count/apis/count-public-api.md) · [All operations](https://skmtc.net/count/apis/count-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/count/count-public-api/versions/858ed44750ff/schema)
