curl -X POST https://verification.didit.me/v3/email/send/ \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"email": "alice@example.com",
"options": { "code_size": 6, "locale": "en" },
"vendor_data": "user-1234"
}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.email.send_code(
email="alice@example.com",
options={
"locale": "en",
},
vendor_data="user-1234",
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.email.sendCode({
email: "alice@example.com",
options: {
locale: "en",
},
vendor_data: "user-1234",
});
console.log(result);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Email.SendCode(ctx, didit.EmailSendCodeParams{
Email: "alice@example.com",
Options: didit.Some(didit.EmailSendCodeParamsOptions{
Locale: didit.Some(didit.EmailSendCodeParamsOptionsLocale("en")),
}),
VendorData: didit.String("user-1234"),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)import me.didit.Didit;
import me.didit.types.EmailSendCodeParams;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.email().sendCode(EmailSendCodeParams.builder()
.email("alice@example.com")
.options(EmailSendCodeParams.Options.builder()
.locale(EmailSendCodeParams.Options.Locale.of("en"))
.build())
.vendorData("user-1234")
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->email->sendCode([
'email' => 'alice@example.com',
'options' => [
'locale' => 'en',
],
'vendor_data' => 'user-1234',
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.email.send_code(
email: "alice@example.com",
options: {
locale: "en",
},
vendor_data: "user-1234"
)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.Email.SendCodeAsync(new EmailSendCodeParams
{
Email = "alice@example.com",
Options = new EmailSendCodeParamsOptions
{
Locale = new EmailSendCodeParamsOptionsLocale("en"),
},
VendorData = "user-1234",
});
Console.WriteLine(JsonSerializer.Serialize(result));{
"request_id": "e39cb057-92fc-4b59-b84e-02fec29a0f24",
"status": "Success",
"reason": null,
"vendor_data": "user-1234",
"metadata": null
}Send Email OTP API: Email Verification Code
POST /v3/email/send/ to send a one-time verification code. Auto-retry on undeliverable, 5-min validity, pay-per-use pricing, no monthly minimums.
curl -X POST https://verification.didit.me/v3/email/send/ \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"email": "alice@example.com",
"options": { "code_size": 6, "locale": "en" },
"vendor_data": "user-1234"
}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.email.send_code(
email="alice@example.com",
options={
"locale": "en",
},
vendor_data="user-1234",
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.email.sendCode({
email: "alice@example.com",
options: {
locale: "en",
},
vendor_data: "user-1234",
});
console.log(result);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Email.SendCode(ctx, didit.EmailSendCodeParams{
Email: "alice@example.com",
Options: didit.Some(didit.EmailSendCodeParamsOptions{
Locale: didit.Some(didit.EmailSendCodeParamsOptionsLocale("en")),
}),
VendorData: didit.String("user-1234"),
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)import me.didit.Didit;
import me.didit.types.EmailSendCodeParams;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.email().sendCode(EmailSendCodeParams.builder()
.email("alice@example.com")
.options(EmailSendCodeParams.Options.builder()
.locale(EmailSendCodeParams.Options.Locale.of("en"))
.build())
.vendorData("user-1234")
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->email->sendCode([
'email' => 'alice@example.com',
'options' => [
'locale' => 'en',
],
'vendor_data' => 'user-1234',
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.email.send_code(
email: "alice@example.com",
options: {
locale: "en",
},
vendor_data: "user-1234"
)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.Email.SendCodeAsync(new EmailSendCodeParams
{
Email = "alice@example.com",
Options = new EmailSendCodeParamsOptions
{
Locale = new EmailSendCodeParamsOptionsLocale("en"),
},
VendorData = "user-1234",
});
Console.WriteLine(JsonSerializer.Serialize(result));{
"request_id": "e39cb057-92fc-4b59-b84e-02fec29a0f24",
"status": "Success",
"reason": null,
"vendor_data": "user-1234",
"metadata": null
}Authorizations
Your application's API key, from Developers -> API keys in the Business Console. The primary key has full access. A named key can be scoped: none, read or write per resource, limited to some workflows or to approved sessions, to a list of IP addresses, and to an expiry date. 401 means the key is wrong, revoked or expired; 403 means no key was sent, the key has no access to this resource or action, or the request came from an address outside its IP list; 404 on a session route means the session is outside the key's workflows or statuses. A key without media access receives image, video and PDF URLs as null, and a key without sessions write receives session links and tokens as null. See https://docs.didit.me/console/api-keys.
Body
Response
Send acknowledged. Inspect status: Success and Retry mean a code is on its way; Undeliverable means the address cannot receive mail and the verification is already finalized as Declined. request_id is the persisted session id (same id on a Retry).
Success — OTP emailed to a new verification (billed). Retry — fresh OTP emailed for the pending verification created by a previous send (free). Undeliverable — the address failed deliverability validation or the message could not be sent; the verification is immediately finalized as Declined and nothing is billed.
Success, Retry, Undeliverable