> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-detect-table-modification.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ClickStack: List Sources

> **This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a list of all sources for the authenticated team

<span data-endpoint-badge="Beta"><Badge color="blue">Beta</Badge></span>

**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future. <br /><br /> ClickStack: Retrieves a list of all sources for the authenticated team


## OpenAPI

````yaml _specs/cloud-openapi.json GET /v1/organizations/{organizationId}/services/{serviceId}/clickstack/sources
openapi: 3.1.2
info:
  title: OpenAPI spec for ClickHouse Cloud
  version: '1.0'
  contact:
    name: ClickHouse Support
    url: >-
      https://clickhouse.com/docs/en/cloud/manage/openapi?referrer=openapi-910487
    email: support@clickhouse.com
servers:
  - url: https://api.clickhouse.cloud
security:
  - basicAuth: []
tags:
  - name: Organization
  - name: User management
  - name: Billing
  - name: Role Management
  - name: Service
  - name: Backup
  - name: OpenAPI
  - name: Prometheus
  - name: ClickPipes
  - name: ClickStack
  - name: Postgres
paths:
  /v1/organizations/{organizationId}/services/{serviceId}/clickstack/sources:
    get:
      tags:
        - ClickStack
      summary: 'ClickStack: List Sources'
      description: >-
        **This endpoint is in beta.** API contract is stable, and no breaking
        changes are expected in the future. <br /><br /> ClickStack: Retrieves a
        list of all sources for the authenticated team
      operationId: clickStackListSources
      parameters:
        - in: path
          name: organizationId
          description: ID of the organization that owns the service.
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: serviceId
          description: ID of the ClickStack service.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 200
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
                  result:
                    type: array
                    items:
                      $ref: '#/components/schemas/ClickStackSource'
        '400':
          description: >-
            The request cannot be processed due to a client error. Please verify
            your request parameters and try again.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                    description: HTTP status code.
                    example: 400
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
        '500':
          description: >-
            An internal server error has occurred. If this issue persists,
            please contact ClickHouse Cloud support for assistance.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code.
                    example: 500
                  error:
                    type: string
                    description: Detailed error description.
                  requestId:
                    type: string
                    description: Unique id assigned to every request. UUIDv4
                    format: uuid
components:
  schemas:
    ClickStackSource:
      oneOf:
        - $ref: '#/components/schemas/ClickStackLogSource'
        - $ref: '#/components/schemas/ClickStackTraceSource'
        - $ref: '#/components/schemas/ClickStackMetricSource'
        - $ref: '#/components/schemas/ClickStackSessionSource'
    ClickStackLogSource:
      properties:
        id:
          description: Unique source ID.
          type: string
          example: 507f1f77bcf86cd799439011
        name:
          description: Display name for the source.
          type: string
          example: Logs
        kind:
          description: Source kind discriminator. Must be "log" for log sources.
          type: string
          enum:
            - log
          example: log
        connection:
          description: ID of the ClickHouse connection used by this source.
          type: string
          example: 507f1f77bcf86cd799439012
        from:
          $ref: '#/components/schemas/ClickStackSourceFrom'
        querySettings:
          type: array
          description: >-
            Optional ClickHouse query settings applied when querying this
            source.
          items:
            $ref: '#/components/schemas/ClickStackQuerySetting'
        filterSettings:
          oneOf:
            - $ref: '#/components/schemas/ClickStackSourceFilterSettings'
            - type: 'null'
        defaultTableSelectExpression:
          description: >-
            Default columns selected in search results (this can be customized
            per search later)
          type: string
          example: Timestamp, ServiceName, SeverityText, Body
        timestampValueExpression:
          description: >-
            DateTime column or expression that is part of your table's primary
            key.
          type: string
          example: Timestamp
        serviceNameExpression:
          description: Expression to extract the service name from log rows.
          type:
            - string
            - 'null'
          example: ServiceName
        severityTextExpression:
          description: Expression to extract the severity/log level text.
          type:
            - string
            - 'null'
          example: SeverityText
        bodyExpression:
          description: Expression to extract the log message body.
          type:
            - string
            - 'null'
          example: Body
        eventAttributesExpression:
          description: Expression to extract event-level attributes.
          type:
            - string
            - 'null'
          example: LogAttributes
        resourceAttributesExpression:
          description: Expression to extract resource-level attributes.
          type:
            - string
            - 'null'
          example: ResourceAttributes
        displayedTimestampValueExpression:
          description: This DateTime column is used to display and order search results.
          type:
            - string
            - 'null'
          example: TimestampTime
        metricSourceId:
          description: HyperDX Source for metrics associated with logs. Optional
          type:
            - string
            - 'null'
          example: 507f1f77bcf86cd799439013
        traceSourceId:
          description: HyperDX Source for traces associated with logs. Optional
          type:
            - string
            - 'null'
          example: 507f1f77bcf86cd799439014
        traceIdExpression:
          description: Expression to extract the trace ID for correlating logs with traces.
          type:
            - string
            - 'null'
          example: TraceId
        spanIdExpression:
          description: Expression to extract the span ID for correlating logs with traces.
          type:
            - string
            - 'null'
          example: SpanId
        implicitColumnExpression:
          description: >-
            Column used for full text search if no property is specified in a
            Lucene-based search. Typically the message body of a log.
          type:
            - string
            - 'null'
          example: Body
        highlightedTraceAttributeExpressions:
          type: array
          description: >-
            Expressions defining trace-level attributes which are displayed in
            the trace view for the selected trace.
          items:
            $ref: '#/components/schemas/ClickStackHighlightedAttributeExpression'
        highlightedRowAttributeExpressions:
          type: array
          description: >-
            Expressions defining row-level attributes which are displayed in the
            row side panel for the selected row.
          items:
            $ref: '#/components/schemas/ClickStackHighlightedAttributeExpression'
        materializedViews:
          type: array
          description: >-
            Configure materialized views for query optimization. These
            pre-aggregated views can significantly improve query performance on
            aggregation queries.
          items:
            $ref: '#/components/schemas/ClickStackMaterializedView'
        metadataMaterializedViews:
          oneOf:
            - $ref: >-
                #/components/schemas/ClickStackLogSourceMetadataMaterializedViews
            - type: 'null'
      required:
        - id
        - name
        - kind
        - connection
        - from
        - defaultTableSelectExpression
        - timestampValueExpression
    ClickStackTraceSource:
      properties:
        id:
          description: Unique source ID.
          type: string
          example: 507f1f77bcf86cd799439021
        name:
          description: Display name for the source.
          type: string
          example: Traces
        kind:
          description: Source kind discriminator. Must be "trace" for trace sources.
          type: string
          enum:
            - trace
          example: trace
        connection:
          description: ID of the ClickHouse connection used by this source.
          type: string
          example: 507f1f77bcf86cd799439012
        from:
          $ref: '#/components/schemas/ClickStackSourceFrom'
        querySettings:
          type: array
          description: >-
            Optional ClickHouse query settings applied when querying this
            source.
          items:
            $ref: '#/components/schemas/ClickStackQuerySetting'
        filterSettings:
          oneOf:
            - $ref: '#/components/schemas/ClickStackSourceFilterSettings'
            - type: 'null'
        defaultTableSelectExpression:
          description: >-
            Default columns selected in search results (this can be customized
            per search later)
          type:
            - string
            - 'null'
          example: Timestamp, SpanName, ServiceName, Duration
        timestampValueExpression:
          description: DateTime column or expression defines the start of the span
          type: string
          example: Timestamp
        durationExpression:
          description: Expression to extract span duration.
          type: string
          example: Duration
        durationPrecision:
          description: >-
            Number of decimal digits in the duration value (e.g., 3 for
            milliseconds, 6 for microseconds, 9 for nanoseconds).
          type: integer
        traceIdExpression:
          description: Expression to extract the trace ID.
          type: string
          example: TraceId
        spanIdExpression:
          description: Expression to extract the span ID.
          type: string
          example: SpanId
        parentSpanIdExpression:
          description: Expression to extract the parent span ID.
          type: string
          example: ParentSpanId
        spanNameExpression:
          description: Expression to extract the span name.
          type: string
          example: SpanName
        spanKindExpression:
          description: >-
            Expression to extract the span kind (e.g., client, server,
            internal).
          type: string
          example: SpanKind
        logSourceId:
          description: HyperDX Source for logs associated with traces. Optional
          type:
            - string
            - 'null'
          example: 507f1f77bcf86cd799439011
        sessionSourceId:
          description: HyperDX Source for sessions associated with traces. Optional
          type:
            - string
            - 'null'
          example: 507f1f77bcf86cd799439031
        metricSourceId:
          description: HyperDX Source for metrics associated with traces. Optional
          type:
            - string
            - 'null'
          example: 507f1f77bcf86cd799439041
        statusCodeExpression:
          description: Expression to extract the span status code.
          type:
            - string
            - 'null'
          example: StatusCode
        statusMessageExpression:
          description: Expression to extract the span status message.
          type:
            - string
            - 'null'
          example: StatusMessage
        serviceNameExpression:
          description: Expression to extract the service name from trace rows.
          type:
            - string
            - 'null'
          example: ServiceName
        resourceAttributesExpression:
          description: Expression to extract resource-level attributes.
          type:
            - string
            - 'null'
          example: ResourceAttributes
        eventAttributesExpression:
          description: Expression to extract event-level attributes.
          type:
            - string
            - 'null'
          example: SpanAttributes
        spanEventsValueExpression:
          description: >-
            Expression to extract span events. Used to capture events associated
            with spans. Expected to be Nested ( Timestamp DateTime64(9), Name
            LowCardinality(String), Attributes Map(LowCardinality(String),
            String)
          type:
            - string
            - 'null'
          example: Events
        implicitColumnExpression:
          description: >-
            Column used for full text search if no property is specified in a
            Lucene-based search. Typically the message body of a log.
          type:
            - string
            - 'null'
          example: SpanName
        highlightedTraceAttributeExpressions:
          type: array
          description: >-
            Expressions defining trace-level attributes which are displayed in
            the trace view for the selected trace.
          items:
            $ref: '#/components/schemas/ClickStackHighlightedAttributeExpression'
        highlightedRowAttributeExpressions:
          type: array
          description: >-
            Expressions defining row-level attributes which are displayed in the
            row side panel for the selected row
          items:
            $ref: '#/components/schemas/ClickStackHighlightedAttributeExpression'
        materializedViews:
          type: array
          description: >-
            Configure materialized views for query optimization. These
            pre-aggregated views can significantly improve query performance on
            aggregation queries.
          items:
            $ref: '#/components/schemas/ClickStackMaterializedView'
        metadataMaterializedViews:
          oneOf:
            - $ref: >-
                #/components/schemas/ClickStackTraceSourceMetadataMaterializedViews
            - type: 'null'
      required:
        - id
        - name
        - kind
        - connection
        - from
        - timestampValueExpression
        - durationExpression
        - durationPrecision
        - traceIdExpression
        - spanIdExpression
        - parentSpanIdExpression
        - spanNameExpression
        - spanKindExpression
    ClickStackMetricSource:
      properties:
        id:
          description: Unique source ID.
          type: string
          example: 507f1f77bcf86cd799439041
        name:
          description: Display name for the source.
          type: string
          example: Metrics
        kind:
          description: Source kind discriminator. Must be "metric" for metric sources.
          type: string
          enum:
            - metric
          example: metric
        connection:
          description: ID of the ClickHouse connection used by this source.
          type: string
          example: 507f1f77bcf86cd799439012
        from:
          $ref: '#/components/schemas/ClickStackMetricSourceFrom'
        querySettings:
          type: array
          description: >-
            Optional ClickHouse query settings applied when querying this
            source.
          items:
            $ref: '#/components/schemas/ClickStackQuerySetting'
        metricTables:
          $ref: '#/components/schemas/ClickStackMetricTables'
        timestampValueExpression:
          description: >-
            DateTime column or expression that is part of your table's primary
            key.
          type: string
          example: TimeUnix
        resourceAttributesExpression:
          description: Column containing resource attributes for metrics
          type: string
          example: ResourceAttributes
        logSourceId:
          description: HyperDX Source for logs associated with metrics. Optional
          type:
            - string
            - 'null'
          example: 507f1f77bcf86cd799439011
      required:
        - id
        - name
        - kind
        - connection
        - from
        - metricTables
        - timestampValueExpression
        - resourceAttributesExpression
    ClickStackSessionSource:
      properties:
        id:
          description: Unique source ID.
          type: string
          example: 507f1f77bcf86cd799439031
        name:
          description: Display name for the source.
          type: string
          example: Sessions
        kind:
          description: Source kind discriminator. Must be "session" for session sources.
          type: string
          enum:
            - session
          example: session
        connection:
          description: ID of the ClickHouse connection used by this source.
          type: string
          example: 507f1f77bcf86cd799439012
        from:
          $ref: '#/components/schemas/ClickStackSourceFrom'
        querySettings:
          type: array
          description: >-
            Optional ClickHouse query settings applied when querying this
            source.
          items:
            $ref: '#/components/schemas/ClickStackQuerySetting'
        timestampValueExpression:
          description: >-
            DateTime column or expression that is part of your table's primary
            key.
          type:
            - string
            - 'null'
          example: TimestampTime
        traceSourceId:
          description: HyperDX Source for traces associated with sessions.
          type: string
          example: 507f1f77bcf86cd799439021
      required:
        - id
        - name
        - kind
        - connection
        - from
        - traceSourceId
    ClickStackSourceFrom:
      properties:
        databaseName:
          description: ClickHouse database name
          type: string
          example: otel
        tableName:
          description: ClickHouse table name
          type: string
          example: otel_logs
      required:
        - databaseName
        - tableName
    ClickStackQuerySetting:
      properties:
        setting:
          description: ClickHouse setting name
          type: string
          example: max_threads
        value:
          description: Setting value
          type: string
          example: '4'
      required:
        - setting
        - value
    ClickStackSourceFilterSettings:
      properties:
        databaseName:
          description: ClickHouse database name
          type: string
          example: default
        tableName:
          description: ClickHouse table name
          type: string
          example: otel_logs
        columns:
          type: array
          description: Columns to expose as filters (max 10)
          items:
            $ref: '#/components/schemas/ClickStackFilterSettingsColumn'
      required:
        - databaseName
        - tableName
        - columns
    ClickStackHighlightedAttributeExpression:
      properties:
        sqlExpression:
          description: SQL expression for the attribute
          type: string
          example: SpanAttributes['http.status_code']
        luceneExpression:
          description: >-
            An optional, Lucene version of the sqlExpression expression. If
            provided, it is used when searching for this attribute value.
          type:
            - string
            - 'null'
          example: http.status_code
        alias:
          description: Optional alias for the attribute
          type:
            - string
            - 'null'
          example: HTTP Status Code
      required:
        - sqlExpression
    ClickStackMaterializedView:
      properties:
        databaseName:
          description: Database name for the materialized view
          type: string
          example: otel
        tableName:
          description: Table name for the materialized view
          type: string
          example: otel_logs_mv_5m
        dimensionColumns:
          description: >-
            Columns which are not pre-aggregated in the materialized view and
            can be used for filtering and grouping.
          type: string
          example: ServiceName, SeverityText
        minGranularity:
          description: The granularity of the timestamp column
          type: string
          enum:
            - 1s
            - 15s
            - 30s
            - 1m
            - 5m
            - 15m
            - 30m
            - 1h
            - 2h
            - 6h
            - 12h
            - 1d
            - 2d
            - 7d
            - 30d
          example: 5m
        minDate:
          description: >-
            (Optional) The earliest date and time for which the materialized
            view contains data. If not provided, then HyperDX will assume that
            the materialized view contains data for all dates for which the
            source table contains data.
          type:
            - string
            - 'null'
          format: date-time
          example: '2025-01-01T00:00:00Z'
        timestampColumn:
          description: Timestamp column name
          type: string
          example: Timestamp
        aggregatedColumns:
          type: array
          description: Columns which are pre-aggregated by the materialized view
          items:
            $ref: '#/components/schemas/ClickStackAggregatedColumn'
      required:
        - databaseName
        - tableName
        - dimensionColumns
        - minGranularity
        - timestampColumn
        - aggregatedColumns
    ClickStackLogSourceMetadataMaterializedViews:
      properties:
        keyRollupTable:
          description: ClickHouse table name for the key rollup (field discovery).
          type: string
          example: otel_logs_key_rollup_15m
        kvRollupTable:
          description: ClickHouse table name for the key-value rollup (value autocomplete).
          type: string
          example: otel_logs_kv_rollup_15m
        granularity:
          description: The time granularity of the rollup tables.
          type: string
          example: 15m
    ClickStackTraceSourceMetadataMaterializedViews:
      properties:
        keyRollupTable:
          description: ClickHouse table name for the key rollup (field discovery).
          type: string
          example: otel_traces_key_rollup_15m
        kvRollupTable:
          description: ClickHouse table name for the key-value rollup (value autocomplete).
          type: string
          example: otel_traces_kv_rollup_15m
        granularity:
          description: The time granularity of the rollup tables.
          type: string
          example: 15m
    ClickStackMetricSourceFrom:
      properties:
        databaseName:
          description: ClickHouse database name
          type: string
          example: otel
        tableName:
          description: ClickHouse table name
          type:
            - string
            - 'null'
          example: otel_metrics_gauge
      required:
        - databaseName
    ClickStackMetricTables:
      properties:
        gauge:
          description: Table containing gauge metrics data
          type: string
          example: otel_metrics_gauge
        histogram:
          description: Table containing histogram metrics data
          type: string
          example: otel_metrics_histogram
        sum:
          description: Table containing sum metrics data
          type: string
          example: otel_metrics_sum
        summary:
          description: >-
            Table containing summary metrics data. Note - not yet fully
            supported by HyperDX
          type: string
          example: otel_metrics_summary
        exponential histogram:
          description: >-
            Table containing exponential histogram metrics data. Note - not yet
            fully supported by HyperDX
          type: string
          example: otel_metrics_exponential_histogram
    ClickStackFilterSettingsColumn:
      properties:
        name:
          description: >-
            Column name used to load filters for prepending to every query for
            the source.
          type: string
          example: ServiceName
        label:
          description: Display label for the column
          type: string
          example: Service Name
      required:
        - name
        - label
    ClickStackAggregatedColumn:
      properties:
        sourceColumn:
          description: Source column name
          type:
            - string
            - 'null'
          example: Duration
        aggFn:
          description: Aggregation function (e.g., count, sum, avg)
          type: string
          example: sum
        mvColumn:
          description: Materialized view column name
          type: string
          example: sum__Duration
      required:
        - aggFn
        - mvColumn
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use key ID and key secret obtained in ClickHouse Cloud console:
        https://clickhouse.com/docs/cloud/manage/openapi

````