Initiate an OTP auth activity
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp_auth \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpAuthIntentV2": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpAuthResultV2": {
"otpId": "<string>"
}
}
}
}
}
}
Enum options: ACTIVITY_TYPE_INIT_OTP_AUTH_V2
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
Unique identifier for a given Organization.
parameters field
Show details
emailCustomization field
Show details
A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.
A template for the URL to be used in a magic link button, e.g. https://dapp.xyz/%s
. The auth bundle will be interpolated into the %s
.
JSON object containing key/value pairs to be used with custom templates.
Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.
Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true
Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to ‘Notifications’
A successful response returns the following fields:
The activity object containing type, intent, and result
Show activity details
The intent of the activity
Show intent details
The initOtpAuthIntentV2 object
Show initOtpAuthIntentV2 details
Enum to specifiy whether to send OTP via SMS or email
Email or phone number to send the OTP code to
emailCustomization field
Show emailCustomization details
A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.
A template for the URL to be used in a magic link button, e.g. https://dapp.xyz/%s
. The auth bundle will be interpolated into the %s
.
JSON object containing key/value pairs to be used with custom templates.
Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.
Optional custom email address from which to send the OTP email
Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true
Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to ‘Notifications’
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp_auth \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpAuthIntentV2": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpAuthResultV2": {
"otpId": "<string>"
}
}
}
}
}
}
Was this page helpful?
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp_auth \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpAuthIntentV2": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpAuthResultV2": {
"otpId": "<string>"
}
}
}
}
}
}
Initiate an OTP auth activity
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp_auth \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpAuthIntentV2": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpAuthResultV2": {
"otpId": "<string>"
}
}
}
}
}
}
Enum options: ACTIVITY_TYPE_INIT_OTP_AUTH_V2
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
Unique identifier for a given Organization.
parameters field
Show details
emailCustomization field
Show details
A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.
A template for the URL to be used in a magic link button, e.g. https://dapp.xyz/%s
. The auth bundle will be interpolated into the %s
.
JSON object containing key/value pairs to be used with custom templates.
Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.
Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true
Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to ‘Notifications’
A successful response returns the following fields:
The activity object containing type, intent, and result
Show activity details
The intent of the activity
Show intent details
The initOtpAuthIntentV2 object
Show initOtpAuthIntentV2 details
Enum to specifiy whether to send OTP via SMS or email
Email or phone number to send the OTP code to
emailCustomization field
Show emailCustomization details
A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.
A template for the URL to be used in a magic link button, e.g. https://dapp.xyz/%s
. The auth bundle will be interpolated into the %s
.
JSON object containing key/value pairs to be used with custom templates.
Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.
Optional custom email address from which to send the OTP email
Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true
Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to ‘Notifications’
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp_auth \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpAuthIntentV2": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpAuthResultV2": {
"otpId": "<string>"
}
}
}
}
}
}
Was this page helpful?
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp_auth \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"timestampMs": "<string> (e.g. 1746736509954)",
"organizationId": "<string> (Your Organization ID)",
"parameters": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V2",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpAuthIntentV2": {
"otpType": "<string>",
"contact": "<string>",
"otpLength": 123,
"emailCustomization": {
"appName": "<string>",
"logoUrl": "<string>",
"magicLinkTemplate": "<string>",
"templateVariables": "<string>",
"templateId": "<string>"
},
"smsCustomization": {
"template": "<string>"
},
"userIdentifier": "<string>",
"sendFromEmailAddress": "<string>",
"alphanumeric": true,
"sendFromEmailSenderName": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpAuthResultV2": {
"otpId": "<string>"
}
}
}
}
}
}