Send a one-time code (OTP) by email
const url = 'https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/messages:otp';const options = { method: 'POST', headers: { 'idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"stream":"example","to":{"email":"hello@example.com","name":"example"},"code":"example","domain":"example","appName":"example","expiresMinutes":1,"locale":"es-MX","metadata":{"orderId":"A-1001"},"sendAt":"2026-04-15T12:00:00Z"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/messages:otp \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'idempotency-key: example' \ --data '{ "stream": "example", "to": { "email": "hello@example.com", "name": "example" }, "code": "example", "domain": "example", "appName": "example", "expiresMinutes": 1, "locale": "es-MX", "metadata": { "orderId": "A-1001" }, "sendAt": "2026-04-15T12:00:00Z" }'Generates the HTML and plain text automatically. The plain text ends with @domain #CODE when domain is provided (iOS Mail autofill). In Gmail on Android, the 32 px monospaced code enables the “Copy code” button. Requires Idempotency-Key. The code travels only inside the encrypted content: the stored and listed subject carries •••••• instead, and the sender must keep the code.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
brd_01hx0000000000000000000000Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Stream by short name. If omitted, the brand default stream.
object
One-time code (numeric or alphanumeric, up to 16 characters).
Sender domain for iOS autofill (@domain #CODE as the last line of the plain text). Recommended.
Application or brand name. If omitted, the brand name stored in the database is used.
Code validity in minutes. Default: 10.
Responses
Section titled “Responses”Code accepted
object
Example
{ "status": "queued"}Invalid data
object
object
Example
{ "error": { "code": "not_found" }}No session, expired session, or invalid, expired or revoked API key
object
object
Example
{ "error": { "code": "not_found" }}Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)
object
object
Example
{ "error": { "code": "not_found" }}Does not exist or is not visible to you
object
object
Example
{ "error": { "code": "not_found" }}Conflict
object
object
Example
{ "error": { "code": "not_found" }}Error
object
object
Example
{ "error": { "code": "not_found" }}Internal error
object
object
Example
{ "error": { "code": "not_found" }}Service temporarily unavailable
object
object
Example
{ "error": { "code": "not_found" }}