Auth

Function-calling namespace: auth

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

forgotPassword

Source: backend/endpoints/auth/forgot-password

Input Fields

FieldTypeRequiredConstraints
emailstringYesemail
callbackUrlstringNo-
callback_urlstringNo-
debugbooleanNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "forgotPassword",
  "data": {
    "email": "user@example.com"
  }
}'

Example Response

{ "status": "ok", "data": {} }

googleSignUp

Source: backend/endpoints/auth/google-sign-up

Input Fields

FieldTypeRequiredConstraints
redirectUristringYes-
redirect_uristringNo-
statestringNo-
providerScopestringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "googleSignUp",
  "data": {
    "redirectUri": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

googleSignUpCallback

Source: backend/endpoints/auth/google-sign-up-callback

Input Fields

FieldTypeRequiredConstraints
codestringYes-
redirectUristringYes-
redirect_uristringNo-
codeVerifierstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "googleSignUpCallback",
  "data": {
    "code": "value",
    "redirectUri": "value",
    "codeVerifier": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

login

Source: backend/endpoints/auth/login

Input Fields

FieldTypeRequiredConstraints
emailstringNo-
usernamestringNo-
phonestringNo-
passwordstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "login",
  "data": {
    "password": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

resetPassword

Source: backend/endpoints/auth/reset-password

Input Fields

FieldTypeRequiredConstraints
codestringYes-
passwordstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "resetPassword",
  "data": {
    "code": "value",
    "password": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

sendOtp

Source: backend/endpoints/auth/send-otp

Generates an OTP for the provided mobile number. The current implementation returns a dummy OTP in the response for development/testing.

Input Fields

FieldTypeRequiredConstraints
mobileNumberstringYes-
phonestringNo-
countryCodestringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "sendOtp",
  "data": {
    "mobileNumber": "9876543210",
    "countryCode": "+91"
  }
}'

Example Response

{ "status": "ok", "data": {} }

signUp

Source: backend/endpoints/auth/sign-up

Input Fields

FieldTypeRequiredConstraints
emailstringYesemail
phonestringNo-
passwordstringYes-
namestringNo-
verificationCallbackUrlstringNo-
verification_callback_urlstringNo-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "signUp",
  "data": {
    "email": "user@example.com",
    "password": "value"
  }
}'

Example Response

{ "status": "ok", "data": {} }

verifyOtp

Source: backend/endpoints/auth/verify-otp

Verifies the OTP for the provided mobile number. For now, this API accepts the static OTP 123456; this is intended to be replaced by real OTP provider verification later.

Input Fields

FieldTypeRequiredConstraints
mobileNumberstringYes-
phonestringNo-
countryCodestringNo-
otpstringYes-

Example Request

curl -X POST https://api.aivida.in/api \
  -H "Content-Type: application/json" \
  -H "x-stack-access-token: <access_token_optional>" \
  -d '{
  "namespace": "auth",
  "apiName": "verifyOtp",
  "data": {
    "mobileNumber": "9876543210",
    "countryCode": "+91",
    "otp": "123456"
  }
}'

Example Response

{ "status": "ok", "data": {} }