Skip to main content
POST
/
api
/
v2
/
auth
/
google
Google OAuth
curl --request POST \
  --url https://api.example.com/api/v2/auth/google \
  --header 'Content-Type: application/json' \
  --data '
{
  "id_token": "<string>"
}
'
id_token
string
required
Google ID token obtained from the Google OAuth flow on your client.

Flow

  1. Client initiates Google Sign-In and receives an id_token
  2. Send the id_token to this endpoint
  3. NeuralBox verifies it with Google, creates or logs in the user
  4. Returns the same JWT pair as Login

Request

curl -X POST https://neuralbox.top/api/v2/auth/google \
  -H "Content-Type: application/json" \
  -d '{"id_token": "eyJhbGciOiJSUzI1NiJ9..."}'

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiJ9...",
  "refresh_token": "eyJhbGciOiJIUzI1NiJ9...",
  "token_type": "bearer",
  "is_new_user": false,
  "user": {
    "id": 12345,
    "email": "user@gmail.com",
    "plan": "free",
    "token_balance": 50
  }
}