AntflyAntfly

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

Read the current browser's sign-in confirmation#

GET/oauth/reconnect

Requires the HttpOnly reconnect cookie issued after fresh provider authentication.

Code Examples#

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

Responses#

{
  "provider": "google",
  "masked_email": "string"
}

Confirm an existing account with an email code and any enrolled MFA#

POST/oauth/reconnect/confirm

Consumes a browser-bound, single-use challenge. Unverified registrations must use account recovery.

Request Body#

{
  "code": "string",
  "totp_code": "string",
  "backup_code": "string"
}

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/oauth/reconnect/confirm" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "string",
"totp_code": "string",
"backup_code": "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
}