> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudcapital.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Get shared filter

> Retrieve a previously stored shared filter configuration by its ID.




## OpenAPI

````yaml /api-reference/openapi.yaml get /cost-insights/shared-filters/{filterId}
openapi: 3.0.3
info:
  title: Cloud Capital Public API
  description: >
    The Cloud Capital Public API provides programmatic access to cost insights

    data. Use this API to query cloud cost data, apply filters, compare costs

    across time periods, and manage shared filter configurations.


    **Response shape:** Successful responses are JSON objects with `success:
    true`

    and a `data` property holding the endpoint-specific payload. Error responses

    use `success: false` and an `error` object with a `message` string.
  version: 1.0.0
  contact:
    email: support@cloudcapital.co
servers:
  - url: https://api.cloudcapital.co/v1
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /cost-insights/shared-filters/{filterId}:
    get:
      tags:
        - Cost insights
      summary: Get shared filter
      description: |
        Retrieve a previously stored shared filter configuration by its ID.
      operationId: getSharedFilter
      parameters:
        - name: filterId
          in: path
          required: true
          description: The unique identifier of the shared filter
          schema:
            type: string
          example: 550e8400-e29b-41d4-a716-446655440000
      responses:
        '200':
          description: Shared filter retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelopeBase'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        $ref: '#/components/schemas/RetrieveSharedFilterResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    SuccessEnvelopeBase:
      type: object
      description: |
        Successful HTTP responses wrap the endpoint-specific body in `data`.
        Each operation's `200` response schema is this object merged (`allOf`)
        with a `data` property referencing the payload schema for that endpoint.
      required:
        - success
      properties:
        success:
          type: boolean
          enum:
            - true
          description: Always `true` when the HTTP status is 2xx.
    RetrieveSharedFilterResponse:
      type: object
      properties:
        filterConfiguration:
          $ref: '#/components/schemas/SharedFilterConfiguration'
          description: The stored filter configuration for the requested shared filter ID
    SharedFilterConfiguration:
      type: object
      required:
        - filters
        - groupBy
      properties:
        filters:
          $ref: '#/components/schemas/Filters'
        groupBy:
          type: object
          required:
            - dateGrouping
          properties:
            dimension:
              type: string
            dateGrouping:
              $ref: '#/components/schemas/DateGrouping'
        metric:
          type: string
          description: Selected chart metric (e.g., amortized_cost)
        comparisonEnabled:
          type: boolean
          description: Whether comparison view is enabled
        metadata:
          type: object
          properties:
            name:
              type: string
            description:
              type: string
    ApiGatewayUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Unauthorized
          description: Fixed message when authentication fails at the gateway.
    ErrorEnvelope:
      type: object
      description: |
        Most error responses from the API use this shape. The HTTP status code
        indicates the class of error (e.g. `400` validation, `429` rate limit,
        `500` server).
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
          description: Always `false` when the HTTP status is an error.
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
              description: Human-readable error description
    Filters:
      type: object
      description: |
        Filter container supporting both inclusion and exclusion criteria.
        Use `inclusions` to narrow results to matching data and `exclusions`
        to remove matching data from results.
      properties:
        inclusions:
          $ref: '#/components/schemas/FilterFields'
        exclusions:
          $ref: '#/components/schemas/FilterFields'
    DateGrouping:
      type: string
      enum:
        - daily
        - weekly
        - monthly
      description: Time granularity for cost data aggregation
    FilterFields:
      type: object
      description: |
        Filter criteria. All fields are optional. When multiple fields
        are specified they are combined with AND logic; values within a
        single field use OR logic.
      properties:
        costLayers:
          type: array
          items:
            type: string
          description: Cost layer names
        clouds:
          type: array
          items:
            type: string
          description: Cloud provider names
        services:
          type: array
          items:
            type: string
          description: Cloud service names
        resourceFamilies:
          type: array
          items:
            type: string
          description: Resource family names
        regions:
          type: array
          items:
            type: string
          description: Cloud region codes
        instanceTypes:
          type: array
          items:
            type: string
          description: Instance type identifiers
        usageTypes:
          type: array
          items:
            type: string
          description: Usage type identifiers
        billingPeriods:
          type: array
          items:
            type: string
          description: Billing periods in yyyy-MM format (legacy; prefer dateRange)
        dateRange:
          $ref: '#/components/schemas/DateRange'
        costTypes:
          type: array
          items:
            type: string
          description: Cost type identifiers
        accountIds:
          type: array
          items:
            type: string
          description: AWS account IDs
        integrationIds:
          type: array
          items:
            type: string
          description: Integration IDs
        resourceTag:
          type: string
          description: A single resource tag key to filter by
        resourceTagValues:
          type: array
          items:
            type: string
          description: Values for the specified resourceTag
        costCategory:
          type: string
          description: A single cost category key to filter by
        costCategoryValues:
          type: array
          items:
            type: string
          description: Values for the specified costCategory
    DateRange:
      type: object
      required:
        - start
        - end
      properties:
        start:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: Start date in YYYY-MM-DD format
          example: '2026-01-01'
        end:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: End date in YYYY-MM-DD format
          example: '2026-03-31'
  responses:
    Unauthorized:
      description: >
        Missing or invalid API key. The API returns this compact body from the

        gateway (not the `success` / `error` envelope used for application
        errors).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiGatewayUnauthorized'
          example:
            message: Unauthorized
    RateLimited:
      description: Rate limit exceeded
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Maximum requests per minute
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Remaining requests in the current window
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              message: Rate limit exceeded. Please retry after the specified time.
    ServerError:
      description: >
        Internal server error, upstream failure, or a missing/expired resource
        when

        the service reports it with HTTP 500 (for example an unknown shared
        filter ID).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              message: 'Error: Shared filter not found or has expired'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: |
        API key authentication. Generate an API key from your
        Cloud Capital dashboard under **Settings > API keys**.
        Include it in the `Authorization` header as a Bearer token.

````