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

# Campaign Tags

> Get all distinct tags used across campaigns and their calls.

- **campaign_id**: Scope results to a single campaign and its calls.
- **tags**: Filter results by substring match against tag strings.



## OpenAPI

````yaml https://api-prod.interactly.ai/api-docs/campaigns/api.json get /campaigns/v1/stats/campaigns/tags
openapi: 3.1.0
info:
  title: Interactly API
  description: API for building interactly.ai services
  version: 1.1.0
  contact:
    name: Interactly
    url: https://interactly.ai
    email: developers@interactly.ai
servers:
  - url: https://api-prod.interactly.ai
    description: API Server
security: []
paths:
  /campaigns/v1/stats/campaigns/tags:
    get:
      tags:
        - Campaign Stats
        - Stats
      summary: Campaign Tags
      description: |-
        Get all distinct tags used across campaigns and their calls.

        - **campaign_id**: Scope results to a single campaign and its calls.
        - **tags**: Filter results by substring match against tag strings.
      operationId: >-
        campaigns_service_get_campaign_and_calls_tags_v1_stats_campaigns_tags_get
      parameters:
        - name: campaign_id
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/PydanticObjectId'
              - type: 'null'
            description: Scope to a specific campaign
            title: Campaign Id
          description: Scope to a specific campaign
        - name: tags
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            description: Filter tag stats by tag strings (substring match)
            title: Tags
          description: Filter tag stats by tag strings (substring match)
      responses:
        '200':
          description: Distinct tags with occurrence counts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagsResponse'
        '400':
          description: Bad request — invalid input or constraint violation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Requested resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer: []
components:
  schemas:
    PydanticObjectId:
      type: string
      maxLength: 24
      minLength: 24
      pattern: ^[0-9a-f]{24}$
      example: 5eb7cf5a86d9755df3a6c593
    TagsResponse:
      properties:
        message:
          type: string
          title: Message
          description: Result description
        data:
          items:
            $ref: '#/components/schemas/TagEntry'
          type: array
          title: Data
          description: Distinct tags with aggregated occurrence counts
      type: object
      required:
        - message
        - data
      title: TagsResponse
    ErrorResponse:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable error description
          examples:
            - Resource not found.
      type: object
      required:
        - message
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TagEntry:
      properties:
        tag:
          type: string
          title: Tag
          description: Tag string (e.g. 'region:west', 'priority:high')
        count:
          type: integer
          title: Count
          description: Total occurrences of this tag across campaigns and their calls
      type: object
      required:
        - tag
        - count
      title: TagEntry
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: Bearer
      type: http
      description: >-
        Retrieve your API Key from [Dashboard API Keys
        Section](https://dashboard.interactly.ai/api-keys).

````