Password#

Password management (forgot, reset, change, set)

Request password reset#

POST/password/forgot

Request 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"
}'

Responses#

{
  "success": true
}

Reset password with token#

POST/password/reset

Reset 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"
}'

Responses#

{
  "success": true,
  "requires_two_factor": true
}

Change password#

POST/password/change

Change 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"
}'

Responses#

{
  "success": true
}

Set initial password#

POST/password/set

Set 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"
}'

Responses#

{
  "success": true
}