1. Registry
  2. Packages
  3. Okta Provider
  4. API Docs
  5. getCaptcha
Viewing docs for Okta v7.0.0
published on Friday, Sep 11, 2026 by Pulumi
okta logo
Viewing docs for Okta v7.0.0
published on Friday, Sep 11, 2026 by Pulumi

    Retrieves the properties of a specified CAPTCHA instance

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as okta from "@pulumi/okta";
    
    const testCaptcha = new okta.Captcha("test", {
        name: "testAcc_replace_with_uuid",
        type: "HCAPTCHA",
        siteKey: "random_key",
        secretKey: "random_secret_key",
    });
    const test = okta.getCaptchaOutput({
        id: testCaptcha.id,
    });
    
    import pulumi
    import pulumi_okta as okta
    
    test_captcha = okta.Captcha("test",
        name="testAcc_replace_with_uuid",
        type="HCAPTCHA",
        site_key="random_key",
        secret_key="random_secret_key")
    test = okta.get_captcha_output(id=test_captcha.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-okta/sdk/v7/go/okta"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testCaptcha, err := okta.NewCaptcha(ctx, "test", &okta.CaptchaArgs{
    			Name:      pulumi.String("testAcc_replace_with_uuid"),
    			Type:      pulumi.String("HCAPTCHA"),
    			SiteKey:   pulumi.String("random_key"),
    			SecretKey: pulumi.String("random_secret_key"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = okta.GetCaptchaOutput(ctx, okta.GetCaptchaOutputArgs{
    			Id: testCaptcha.ID().ToIDOutput().ToStringOutput(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Okta = Pulumi.Okta;
    
    return await Deployment.RunAsync(() => 
    {
        var testCaptcha = new Okta.Captcha("test", new()
        {
            Name = "testAcc_replace_with_uuid",
            Type = "HCAPTCHA",
            SiteKey = "random_key",
            SecretKey = "random_secret_key",
        });
    
        var test = Okta.GetCaptcha.Invoke(new()
        {
            Id = testCaptcha.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.okta.Captcha;
    import com.pulumi.okta.CaptchaArgs;
    import com.pulumi.okta.OktaFunctions;
    import com.pulumi.okta.inputs.GetCaptchaArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var testCaptcha = new Captcha("testCaptcha", CaptchaArgs.builder()
                .name("testAcc_replace_with_uuid")
                .type("HCAPTCHA")
                .siteKey("random_key")
                .secretKey("random_secret_key")
                .build());
    
            final var test = OktaFunctions.getCaptcha(GetCaptchaArgs.builder()
                .id(testCaptcha.id())
                .build());
    
        }
    }
    
    resources:
      testCaptcha:
        type: okta:Captcha
        name: test
        properties:
          name: testAcc_replace_with_uuid
          type: HCAPTCHA
          siteKey: random_key
          secretKey: random_secret_key
    variables:
      test:
        fn::invoke:
          function: okta:getCaptcha
          arguments:
            id: ${testCaptcha.id}
    
    pulumi {
      required_providers {
        okta = {
          source = "pulumi/okta"
        }
      }
    }
    
    data "okta_getcaptcha" "test" {
      id = okta_captcha.test.id
    }
    
    resource "okta_captcha" "test" {
      name       = "testAcc_replace_with_uuid"
      type       = "HCAPTCHA"
      site_key   = "random_key"
      secret_key = "random_secret_key"
    }
    

    Using getCaptcha

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCaptcha(args: GetCaptchaArgs, opts?: InvokeOptions): Promise<GetCaptchaResult>
    function getCaptchaOutput(args: GetCaptchaOutputArgs, opts?: InvokeOutputOptions): Output<GetCaptchaResult>
    def get_captcha(id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetCaptchaResult
    def get_captcha_output(id: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOutputOptions] = None) -> Output[GetCaptchaResult]
    func LookupCaptcha(ctx *Context, args *LookupCaptchaArgs, opts ...InvokeOption) (*LookupCaptchaResult, error)
    func LookupCaptchaOutput(ctx *Context, args *LookupCaptchaOutputArgs, opts ...InvokeOption) LookupCaptchaResultOutput

    > Note: This function is named LookupCaptcha in the Go SDK.

    public static class GetCaptcha 
    {
        public static Task<GetCaptchaResult> InvokeAsync(GetCaptchaArgs args, InvokeOptions? opts = null)
        public static Output<GetCaptchaResult> Invoke(GetCaptchaInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetCaptchaResult> Invoke(GetCaptchaInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetCaptchaResult> getCaptcha(GetCaptchaArgs args, InvokeOptions options)
    public static Output<GetCaptchaResult> getCaptcha(GetCaptchaArgs args, InvokeOptions options)
    public static Output<GetCaptchaResult> getCaptcha(GetCaptchaArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: okta:index/getCaptcha:getCaptcha
      arguments:
        # arguments dictionary
    data "okta_get_captcha" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    Unique identifier of the captcha.
    Id string
    Unique identifier of the captcha.
    id string
    Unique identifier of the captcha.
    id String
    Unique identifier of the captcha.
    id string
    Unique identifier of the captcha.
    id str
    Unique identifier of the captcha.
    id String
    Unique identifier of the captcha.

    getCaptcha Result

    The following output properties are available:

    Id string
    Unique identifier of the captcha.
    Name string
    The name of the CAPTCHA instance
    SiteKey string
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    Type string
    The type of CAPTCHA provider
    Id string
    Unique identifier of the captcha.
    Name string
    The name of the CAPTCHA instance
    SiteKey string
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    Type string
    The type of CAPTCHA provider
    id string
    Unique identifier of the captcha.
    name string
    The name of the CAPTCHA instance
    site_key string
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    type string
    The type of CAPTCHA provider
    id String
    Unique identifier of the captcha.
    name String
    The name of the CAPTCHA instance
    siteKey String
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    type String
    The type of CAPTCHA provider
    id string
    Unique identifier of the captcha.
    name string
    The name of the CAPTCHA instance
    siteKey string
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    type string
    The type of CAPTCHA provider
    id str
    Unique identifier of the captcha.
    name str
    The name of the CAPTCHA instance
    site_key str
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    type str
    The type of CAPTCHA provider
    id String
    Unique identifier of the captcha.
    name String
    The name of the CAPTCHA instance
    siteKey String
    The site key issued from the CAPTCHA provider to render a CAPTCHA on a page
    type String
    The type of CAPTCHA provider

    Package Details

    Repository
    Okta pulumi/pulumi-okta
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the okta Terraform Provider.
    okta logo
    Viewing docs for Okta v7.0.0
    published on Friday, Sep 11, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial