Skip to main content
POST
/
api
/
v1
/
register-email-code
/
set-password
Register (email OTP) - set password
curl --request POST \
  --url https://api.flowxi.app/api/v1/register-email-code/set-password \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "gbailey@example.net",
  "code": "123456",
  "password": "Str0ngP@ssw0rd!",
  "password_confirmation": "Str0ngP@ssw0rd!"
}
'
import requests

url = "https://api.flowxi.app/api/v1/register-email-code/set-password"

payload = {
    "email": "gbailey@example.net",
    "code": "123456",
    "password": "Str0ngP@ssw0rd!",
    "password_confirmation": "Str0ngP@ssw0rd!"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    email: 'gbailey@example.net',
    code: '123456',
    password: 'Str0ngP@ssw0rd!',
    password_confirmation: 'Str0ngP@ssw0rd!'
  })
};

fetch('https://api.flowxi.app/api/v1/register-email-code/set-password', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.flowxi.app/api/v1/register-email-code/set-password",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'email' => 'gbailey@example.net',
    'code' => '123456',
    'password' => 'Str0ngP@ssw0rd!',
    'password_confirmation' => 'Str0ngP@ssw0rd!'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.flowxi.app/api/v1/register-email-code/set-password"

	payload := strings.NewReader("{\n  \"email\": \"gbailey@example.net\",\n  \"code\": \"123456\",\n  \"password\": \"Str0ngP@ssw0rd!\",\n  \"password_confirmation\": \"Str0ngP@ssw0rd!\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.flowxi.app/api/v1/register-email-code/set-password")
  .header("Content-Type", "application/json")
  .body("{\n  \"email\": \"gbailey@example.net\",\n  \"code\": \"123456\",\n  \"password\": \"Str0ngP@ssw0rd!\",\n  \"password_confirmation\": \"Str0ngP@ssw0rd!\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.flowxi.app/api/v1/register-email-code/set-password")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"email\": \"gbailey@example.net\",\n  \"code\": \"123456\",\n  \"password\": \"Str0ngP@ssw0rd!\",\n  \"password_confirmation\": \"Str0ngP@ssw0rd!\"\n}"

response = http.request(request)
puts response.read_body
{
  "code": "TOKEN_ISSUED",
  "message": "Token issued.",
  "access_token": "125|XXXXXXXXXXXXXXXXXXXXXXXX",
  "token_type": "Bearer",
  "user_id": 123,
  "account_status": "active"
}
{
  "code": "OTP_INVALID",
  "message": "OTP invalid."
}
{
  "code": "VALIDATION_FAILED",
  "message": "Validation failed.",
  "errors": {
    "email": [
      "The email field is required."
    ]
  }
}
{
  "code": "RATE_LIMITED",
  "message": "Too many requests."
}
{
  "code": "SERVER_ERROR",
  "message": "Server error."
}

Body

application/json
email
string<email>
required
Example:

"gbailey@example.net"

code
string
required

6-digit code.

Example:

"123456"

password
string
required
Example:

"Str0ngP@ssw0rd!"

password_confirmation
string
required
Example:

"Str0ngP@ssw0rd!"

Response

Account activated + token issued.

code
string
required
Example:

"OK"

message
string
required
Example:

"OK"

access_token
string
required

Bearer token (plain text). Shown only once.

Example:

"125|XXXXXXXXXXXXXXXXXXXXXXXX"

token_type
string
required
Example:

"Bearer"

user_id
integer
required
Example:

123

account_status
string
required
Example:

"active"