Google sign-in — native apps
Native sign-in with a Google `id_token` (Android Credential Manager, Google Sign-In for iOS). The token is verified with Google and must be issued to one of this deployment's client IDs. Returns Avycenna tokens.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A Google ID token from Android Credential Manager or Google Sign-In for iOS.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/auth/oauth/google/native" \ -H "Content-Type: application/json" \ -d '{ "id_token": "string" }'{ "access_token": "string", "refresh_token": "string", "token_type": "bearer", "user": { "id": "string", "name": "string", "email": "string", "image": "string", "role": "patient" }}{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string" } ]}Google OAuth — web callback GET
Google redirects here after consent. Exchanges the code for tokens, upserts the user, then redirects to the web app with Avycenna tokens in the URL fragment.
Send OTP code POST
Send a 6-digit one-time passcode to the given email address. Works for both returning users (sign-in) and new users (sign-up) — no account needs to exist beforehand. The code is valid for **10 minutes**. Call `/otp/verify` next to complete authentication.