Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex SmartCaptcha
  • Getting started
    • All guides
    • Creating a CAPTCHA
    • Deleting a CAPTCHA
    • Getting keys
    • Adding a widget using the advanced method
    • Verifying a CAPTCHA response
    • Viewing operations with resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Deleting a CAPTCHA

Deleting a CAPTCHA

Written by
Yandex Cloud
Updated at July 14, 2025

In this section, you will learn how to delete a CAPTCHA.

Management console
CLI
Terraform
API
  1. In the management console, select the folder.
  2. Select SmartCaptcha.
  3. Select the CAPTCHA and click → Delete.
  4. Confirm the deletion.

If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. See the description of the CLI command for deleting the CAPTCHA:

    yc smartcaptcha captcha delete --help
    
  2. Get a list of captchas:

    yc smartcaptcha captcha list
    

    Result:

    +----------------------+---------+---------------------+------------+----------------+----------------+-------------+
    |          ID          |  NAME   |       CREATED       | COMPLEXITY | PRE-CHECK TYPE | CHALLENGE TYPE | RULES COUNT |
    +----------------------+---------+---------------------+------------+----------------+----------------+-------------+
    | bpne29ifsca8******** | test    | 2025-02-24 17:16:13 | MEDIUM     | CHECKBOX       | IMAGE_TEXT     |           0 |
    | bpnm7lhokq2t******** | prod    | 2025-02-26 09:12:02 | MEDIUM     | CHECKBOX       | IMAGE_TEXT     |           0 |
    | bpn43btuo4g9******** | website | 2025-02-26 09:12:42 | MEDIUM     | CHECKBOX       | IMAGE_TEXT     |           0 |
    +----------------------+---------+---------------------+------------+----------------+----------------+-------------+
    
  3. Delete the CAPTCHA by specifying its name or ID:

    yc smartcaptcha captcha delete <CAPTCHA_name_or_ID>
    

    Result:

    id: bpnd6cm6qpr5********
    folder_id: b1g0ijbfaqsn********
    cloud_id: b1gia87mbaom********
    client_key: ysc1_2lla0Yn6dhlnEaTv2QNg2BhuA8Nqlyk4L7pZk3dz********
    created_at: "2025-03-02T21:38:48.830498Z"
    name: my-first-captcha
    allowed_sites:
      - exmaple.com
      - exmaple.net
    complexity: MEDIUM
    style_json: '{"focus-color":"rgb(250, 192, 0)","base-background-color":"#fff"}'
    turn_off_hostname_check: true
    pre_check_type: CHECKBOX
    challenge_type: IMAGE_TEXT
    security_rules:
      - name: rule1
        priority: "11"
        description: My first security rule.
        condition:
          host:
            hosts:
              - exact_match: example.com
              - exact_match: example.net
        override_variant_uuid: variant-1
      - name: rule2
        priority: "12"
        condition:
          source_ip:
          geo_ip_match:
            locations:
              - ru
              - es
        override_variant_uuid: variant-2
    override_variants:
      - uuid: variant-1
        description: override variant 1
        complexity: EASY
        pre_check_type: CHECKBOX
        challenge_type: SILHOUETTES
      - uuid: variant-2
        description: override variant 2
        complexity: HARD
        pre_check_type: CHECKBOX
        challenge_type: KALEIDOSCOPE
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the relevant documentation on the Terraform website or its mirror.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

To delete a CAPTCHA created using Terraform:

  1. Open the Terraform configuration file and delete the fragment with the yandex_smartcaptcha_captcha resource description:

    Example a CAPTCHA description in the Terraform configuration
    resource "yandex_smartcaptcha_captcha" "demo-advanced-smartcaptcha" {
      name                = "<captcha_name>"
      style_json          = "<captcha_appearance>"
      complexity          = "<challenge_difficulty>"
      pre_check_type      = "<main_challenge_type>"
      challenge_type      = "<additional_challenge_type>"
    
      allowed_sites = [
        "<first_host>",
        "<second_host>"
      ]
    
      # First challenge variant
      override_variant {
        uuid        = "<variant_1_ID>"
        description = "<variant_1_description>"
    
        complexity     = "<challenge_difficulty>"
        pre_check_type = "<main_challenge>"
        challenge_type = "<additional_challenge>"
      }
    
      # Second challenge variant 
      override_variant {
        uuid        = "<variant_2_ID"
        description = "<variant_2_description>"
    
        complexity     = "<challenge_difficulty>"
        pre_check_type = "<main_challenge>"
        challenge_type = "<additional_challenge>"
      }
    
      # First rule
      security_rule {
        name                  = "<rule_1_name>"
        priority              = <rule_1_priority>
        description           = "<rule_1_description>"
        override_variant_uuid = "<challenge_variant_ID>"
    
        condition {
          host {
            hosts {
              exact_match = "example.com"
            }
            hosts {
              exact_match = "example.net"
            }
          }
        }
      }
    
      # Second rule
      security_rule {
        name                  = "<rule_2_name>"
        priority              = <rule_2_priority>
        description           = "<rule_2_description>"
        override_variant_uuid = "<challenge_variant_ID>"
    
        condition {
          source_ip {
            geo_ip_match {
              locations = ["ru", "es"]
            }
          }
        }
      }
    }
    
  2. Apply the changes:

    1. In the terminal, navigate to the directory where you edited the configuration file.

    2. Make sure the configuration file is correct using this command:

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    You can check the deletion of the resources using the management console or this CLI command:

    yc smartcaptcha captcha list
    

To delete a CAPTCHA, use the delete REST API method for the Captcha resource or the Captcha/Delete gRPC API call.

The deleted CAPTCHA's keys will become invalid. The service will return an error message to any request made using these keys.

Was the article helpful?

Previous
Creating a CAPTCHA
Next
Getting keys
© 2025 Direct Cursus Technology L.L.C.