Password
Password management (forgot, reset, change, set)
Request password reset
POST
/password/forgotRequest Body
{
"email": "user@example.com",
"redirect_url": "string"
}
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/password/forgot" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"redirect_url": "string"
}'const response = await fetch("https://platform.antfly.io/api/v1/password/forgot", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "user@example.com",
"redirect_url": "string"
})
});
const data = await response.json();Responses
{
"success": true
}{
"error": "string",
"message": "string"
}Reset password with token
POST
/password/resetReset password using token from email. If 2FA is enabled, requires TOTP or backup code.
Request Body
{
"token": "string",
"new_password": "string",
"code": "string",
"backup_code": "string"
}
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/password/reset" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"token": "string",
"new_password": "string",
"code": "string",
"backup_code": "string"
}'const response = await fetch("https://platform.antfly.io/api/v1/password/reset", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"token": "string",
"new_password": "string",
"code": "string",
"backup_code": "string"
})
});
const data = await response.json();Responses
{
"success": true,
"requires_two_factor": true
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}Change password
POST
/password/changeChange password for authenticated user (session-authed)
Request Body
{
"current_password": "string",
"new_password": "string"
}
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/password/change" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"current_password": "string",
"new_password": "string"
}'const response = await fetch("https://platform.antfly.io/api/v1/password/change", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"current_password": "string",
"new_password": "string"
})
});
const data = await response.json();Responses
{
"success": true
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}Set initial password
POST
/password/setSet password for OAuth-only users who don't have one yet (session-authed)
Request Body
{
"new_password": "string"
}
Code Examples
curl -X POST "https://platform.antfly.io/api/v1/password/set" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"new_password": "string"
}'const response = await fetch("https://platform.antfly.io/api/v1/password/set", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"new_password": "string"
})
});
const data = await response.json();Responses
{
"success": true
}{
"error": "string",
"message": "string"
}{
"error": "string",
"message": "string"
}