---
descriptions:
  challenge_factor:
    authentication_factor_id: The unique ID of the Authentication Factor to be challenged.
    sms_template: >-
      Optional template for SMS messages. Only applicable for `sms` Factors. Use
      the `{{code}}` token to inject the one-time code into the message. E.g.,
      `Your Foo Corp one-time code is {{code}}.`
reference:
  curl:
    - key: challenge_factor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: '/auth/factors/:id/challenge'
      type: POST
      parameters:
        - key: authentication_factor_id
          type: string
          description: (challenge_factor.authentication_factor_id)
        - key: sms_template
          type: string
          optional: true
          description: (challenge_factor.sms_template)
      returns:
        - (authentication_challenge)
  dotnet:
    - key: ChallengeFactor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: mfaService.ChallengeFactor()
      parameters:
        - key: options
          type: ChallengeFactorOptions
          expanded: true
          properties:
            - key: FactorId
              type: string
              description: (challenge_factor.authentication_factor_id)
        - (cancellationToken)
      returns:
        - key: Task<Challenge>
          description: (authentication_challenge.self)
    - key: ChallengeSmsFactorOptions
      patternBefore: new
      id: dotnet_challenge_sms_factor_options
      url: /reference/mfa/challenge-factor
      title: 'class ChallengeSmsFactorOptions : ChallengeFactorOptions'
      properties:
        - key: SmsTemplate
          type: string
  ruby:
    - key: challenge_factor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: MFA.challenge_factor()
      parameters:
        - key: authentication_factor_id
          type: String
          description: (challenge_factor.authentication_factor_id)
        - key: sms_template
          type: String
          optional: true
          description: (challenge_factor.sms_template)
      returns:
        - (Challenge)
  js:
    - key: challengeFactor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: mfa.challengeFactor()
      parameters:
        - key: options
          type: object
          unwrap: true
          properties:
            - key: authenticationFactorId
              type: string
              description: (challenge_factor.authentication_factor_id)
            - key: smsTemplate
              type: string
              optional: true
              description: (challenge_factor.sms_template)
      returns:
        - (Challenge)
  python:
    - key: challenge_factor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: mfa.challenge_factor()
      parameters:
        - key: authentication_factor_id
          type: str
          description: (challenge_factor.authentication_factor_id)
        - key: sms_template
          type: str
          optional: true
          description: (challenge_factor.sms_template)
      returns:
        - (AuthenticationChallenge)
  php:
    - key: challengeFactor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: $mfa->challengeFactor()
      parameters:
        - key: authenticationFactorId
          type: string
          description: (challenge_factor.authentication_factor_id)
        - key: smsTemplate
          type: string
          optional: true
          description: (challenge_factor.sms_template)
      returns:
        - (AuthenticationChallenge)
  java:
    - key: challengeFactor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: mfa.challengeFactor()
      parameters:
        - key: options
          type: ChallengeFactorOptions
          expanded: true
          properties:
            - key: authenticationFactorId
              type: String
              description: (challenge_factor.authentication_factor_id)
            - key: smsTemplate
              type: String
              optional: true
              description: (challenge_factor.sms_template)
            - key: builder()
              type: ChallengeFactorOptionsBuilder
              description: (java.builder)
      returns:
        - (Challenge)
  go:
    - key: ChallengeFactor
      id: challenge_factor
      url: /reference/mfa/challenge-factor
      title: mfa.ChallengeFactor()
      parameters:
        - (ctx)
        - key: opts
          type: mfa.ChallengeFactorOpts
          expanded: true
          properties:
            - key: FactorID
              type: string
              description: (challenge_factor.authentication_factor_id)
            - key: SMSTemplate
              type: string
              optional: true
              description: (challenge_factor.sms_template)
      returns:
        - key: challenge
          type: mfa.Challenge
          description: (authentication_challenge.self)
        - (err)
originalPath: .tmp-workos-clone/packages/docs/content/reference/mfa/challenge/create.mdx
---

## Challenge Factor

Creates a Challenge for an Authentication Factor.

<CodeBlock referenceId="challenge_factor">
  <CodeBlockTab title="Request" file="challenge-factor-request" />
  <CodeBlockTab title="Response" file="challenge-factor-response" />
</CodeBlock>
