Initiate a Generic OTP activity
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP",
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpIntent": {
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpResult": {
"otpId": "<string>"
}
}
}
}
}
}
Enum options: ACTIVITY_TYPE_INIT_OTP
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
Unique identifier for a given Organization.
parameters field
Show details
Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL
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’
Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)
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 initOtpIntent object
Show initOtpIntent details
Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL
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’
Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP",
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpIntent": {
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpResult": {
"otpId": "<string>"
}
}
}
}
}
}
Was this page helpful?
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP",
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpIntent": {
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpResult": {
"otpId": "<string>"
}
}
}
}
}
}
Initiate a Generic OTP activity
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP",
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpIntent": {
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpResult": {
"otpId": "<string>"
}
}
}
}
}
}
Enum options: ACTIVITY_TYPE_INIT_OTP
Timestamp (in milliseconds) of the request, used to verify liveness of user requests.
Unique identifier for a given Organization.
parameters field
Show details
Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL
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’
Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)
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 initOtpIntent object
Show initOtpIntent details
Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL
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’
Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP",
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpIntent": {
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpResult": {
"otpId": "<string>"
}
}
}
}
}
}
Was this page helpful?
curl --request POST \
--url https://api.turnkey.com/public/v1/submit/init_otp \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "X-Stamp: <YOUR_API_KEY.YOUR_API_SECRET>" \
--data '{
"type": "ACTIVITY_TYPE_INIT_OTP",
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
}'
{
"activity": {
"id": "<activity-id>",
"status": "ACTIVITY_STATUS_COMPLETED",
"type": "ACTIVITY_TYPE_INIT_OTP",
"organizationId": "<organization-id>",
"timestampMs": "<timestamp> (e.g. 1746736509954)",
"result": {
"activity": {
"type": "<string>",
"intent": {
"initOtpIntent": {
"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>",
"expirationSeconds": "<string>",
"replyToEmailAddress": "<string>"
}
},
"result": {
"initOtpResult": {
"otpId": "<string>"
}
}
}
}
}
}