> ## 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 tag values

> Retrieve values for a specific resource tag key. Use this endpoint
to discover available tag values for filtering cost data by
custom resource tags.




## OpenAPI

````yaml /api-reference/openapi.yaml post /cost-insights/tag-values
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/tag-values:
    post:
      tags:
        - Cost insights
      summary: Get tag values
      description: |
        Retrieve values for a specific resource tag key. Use this endpoint
        to discover available tag values for filtering cost data by
        custom resource tags.
      operationId: getTagValues
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagValuesRequest'
            example:
              tagKey: Environment
      responses:
        '200':
          description: Tag values retrieved successfully
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelopeBase'
                  - type: object
                    required:
                      - data
                    properties:
                      data:
                        $ref: '#/components/schemas/TagValuesResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    TagValuesRequest:
      type: object
      required:
        - tagKey
      properties:
        tagKey:
          type: string
          description: The resource tag key to get values for
          example: Environment
    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.
    TagValuesResponse:
      type: object
      properties:
        values:
          type: array
          items:
            type: string
    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
    ApiGatewayUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          example: Unauthorized
          description: Fixed message when authentication fails at the gateway.
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            success: false
            error:
              message: >-
                Invalid request. Please see message details.. Invalid input:
                expected object, received undefined (at groupBy)
    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.
  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.

````