Login#

Email/password and OAuth login

Login with email and password#

POST/login

Request Body#

{
  "email": "user@example.com",
  "password": "string",
  "redirect_url": "string"
}

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/login" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "string",
"redirect_url": "string"
}'

Responses#

{
  "requires_two_factor": true,
  "temp_token": "string",
  "redirect_url": "string"
}

Initiate OAuth login#

GET/oauth/{provider}/login

Redirects to OAuth provider login page

Parameters#

NameTypeLocationRequiredDescription
providerstring (google, github)pathYes
return_tostringqueryNoURL to return to after OAuth flow

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/oauth/google/login?return_to=string" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "success": true
}

OAuth callback handler#

GET/oauth/{provider}/callback

Handles OAuth provider callback, creates session, and redirects

Parameters#

NameTypeLocationRequiredDescription
providerstring (google, github)pathYes
codestringqueryYesOAuth authorization code
statestringqueryYesCSRF protection state

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/oauth/google/callback?code=string&state=string" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "success": true
}

GET/oauth/{provider}/link

Initiates OAuth flow to link a provider to the authenticated user's account

Parameters#

NameTypeLocationRequiredDescription
providerstring (google, github)pathYes

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/oauth/google/link" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "success": true
}

POST/oauth/{provider}/unlink

Parameters#

NameTypeLocationRequiredDescription
providerstring (google, github)pathYes

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/oauth/google/unlink" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "success": true
}