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

# Create a tracking script filter



## OpenAPI

````yaml https://app.snitcher.com/api/radar/docs?api-radar-docs.json post /radar/operator/v1/tracking-scripts/{trackingScriptId}/filters
openapi: 3.0.0
info:
  title: Radar API
  description: ''
  contact:
    email: info@snitcher.com
  version: 1.0.0
servers:
  - url: https://api.snitcher.com
    description: Production API
security: []
tags:
  - name: Tracking scripts
    description: Endpoints for tracking scripts
  - name: Company
    description: Endpoints for companies
  - name: Usage
    description: Endpoints for tracking script usage
  - name: Webhooks
    description: Endpoints for webhook settings
paths:
  /radar/operator/v1/tracking-scripts/{trackingScriptId}/filters:
    post:
      tags:
        - Tracking scripts
      summary: Create a tracking script filter
      operationId: 6b2c460d3a5fbc9b07b0fe990f10dc05
      parameters:
        - name: trackingScriptId
          in: path
          description: The ID of the tracking script to create a filter for
          required: true
          schema:
            type: string
            example: '12345'
      requestBody:
        description: Tracking script filter parameters
        required: true
        content:
          application/json:
            schema:
              required:
                - tracking_script_filter_type
                - tracking_script_filter_field
                - filter_value
              properties:
                tracking_script_filter_type:
                  description: The type of the filter (blacklist or whitelist)
                  type: string
                  enum:
                    - blacklist
                    - whitelist
                  example: blacklist
                tracking_script_filter_field:
                  description: The field to filter on (country or url)
                  type: string
                  enum:
                    - country
                    - url
                  example: country
                filter_value:
                  description: >-
                    The value to filter on, e.g. 'US' for country or a URL for
                    url field
                  type: string
                  example: US
              type: object
      responses:
        '200':
          description: Tracking script filter created successfully
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/TrackingScript_TrackingScriptFilter'
                type: object
      security:
        - Snitcher bearer token: []
components:
  schemas:
    TrackingScript_TrackingScriptFilter:
      required:
        - uuid
        - filter_value
      properties:
        uuid:
          type: string
          format: uuid
        tracking_script_filter_field:
          $ref: '#/components/schemas/TrackingScript_TrackingScriptFilterField'
        tracking_script_filter_type:
          $ref: '#/components/schemas/TrackingScript_TrackingScriptFilterType'
        filter_value:
          type: string
      type: object
    TrackingScript_TrackingScriptFilterField:
      type: string
      enum:
        - country
        - url
    TrackingScript_TrackingScriptFilterType:
      type: string
      enum:
        - blacklist
        - whitelist
  securitySchemes:
    Snitcher bearer token:
      type: http
      description: Enter your personal access token (PAT) to authenticate
      bearerFormat: JWT
      scheme: bearer

````