import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().createMfaPolicy({ userId: "<string> (The ID of the User to add the MFA Policy to.)", mfaPolicyName: "<string> (Human-readable name for a Policy.)", condition: "<string> (A condition expression that evaluates to true or false, determining when this MFA policy applies.)", requiredAuthenticationMethods: ["<string>"] // An ordered list of authentication requirements. Each requirement must be satisfied sequentially to complete MFA., order: 0 // The order in which this MFA policy is evaluated, starting from 0, relative to other MFA policies. Lower order values are evaluated first., notes: "<string> (Notes for an MFA Policy.)"});
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().createMfaPolicy({ userId: "<string> (The ID of the User to add the MFA Policy to.)", mfaPolicyName: "<string> (Human-readable name for a Policy.)", condition: "<string> (A condition expression that evaluates to true or false, determining when this MFA policy applies.)", requiredAuthenticationMethods: ["<string>"] // An ordered list of authentication requirements. Each requirement must be satisfied sequentially to complete MFA., order: 0 // The order in which this MFA policy is evaluated, starting from 0, relative to other MFA policies. Lower order values are evaluated first., notes: "<string> (Notes for an MFA Policy.)"});
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
string
required
Unique identifier for a given Organization.
object
required
The parameters object containing the specific intent data for this activity.
Show details
array
required
An ordered list of authentication requirements. Each requirement must be satisfied sequentially to complete MFA.
Show item details
array
required
A list of authentication methods for this MFA step. If only one method is provided, it is required. If multiple are provided, the user must satisfy ANY one of them.
Show item details
A successful response returns the following fields:
object
required
The activity object containing type, intent, and result
import { Turnkey } from "@turnkey/sdk-server";const turnkeyClient = new Turnkey({ apiBaseUrl: "https://api.turnkey.com", apiPublicKey: process.env.API_PUBLIC_KEY!, apiPrivateKey: process.env.API_PRIVATE_KEY!, defaultOrganizationId: process.env.ORGANIZATION_ID!,});const response = await turnkeyClient.apiClient().createMfaPolicy({ userId: "<string> (The ID of the User to add the MFA Policy to.)", mfaPolicyName: "<string> (Human-readable name for a Policy.)", condition: "<string> (A condition expression that evaluates to true or false, determining when this MFA policy applies.)", requiredAuthenticationMethods: ["<string>"] // An ordered list of authentication requirements. Each requirement must be satisfied sequentially to complete MFA., order: 0 // The order in which this MFA policy is evaluated, starting from 0, relative to other MFA policies. Lower order values are evaluated first., notes: "<string> (Notes for an MFA Policy.)"});