The Auth API handles everything related to session lifecycle — signing in via Google OAuth (web or mobile), signing out, and querying the current session state. All auth routes live underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ptshen/timeful-plus/llms.txt
Use this file to discover all available pages before exploring further.
/api/auth. The health check lives directly under /api.
Sign In (Web)
session cookie that must be included in all subsequent authenticated requests.
Request Body
The authorization code returned by Google’s OAuth endpoint to your redirect URI.
The OAuth scope string returned alongside the authorization code.
Calendar provider for this sign-in. One of:
| Value | Provider |
|---|---|
"google" | Google Calendar (OAuth 2.0) |
"outlook" | Microsoft Outlook (OAuth 2.0) |
The caller’s UTC offset in minutes (e.g.
-300 for UTC−5).Optional array of event ObjectID hex strings. Each event whose
ownerId is currently null will be claimed by the newly signed-in user. Useful for associating a guest-created event with a newly registered account.200 OK: The signed-in User object.
Sign In (Mobile)
Request Body
OAuth 2.0 access token obtained from the mobile SDK.
OAuth scope string.
JWT ID token containing user profile claims (
email, given_name, family_name, picture).Seconds until the access token expires.
OAuth 2.0 refresh token.
Platform the token originated from. One of:
| Value | Platform |
|---|---|
"ios" | iOS app |
"android" | Android app |
"web" | Browser |
Calendar provider:
"google" or "outlook".The caller’s UTC offset in minutes.
200 OK: Returns {}. The session cookie is set on the response.
Sign Out
userId key from the session, effectively invalidating the session cookie. No request body is required.
Response 200 OK: Returns {}.
Auth Status
This endpoint is protected by
middleware.AuthRequired(). It returns 401 with { "error": "not-signed-in" } if there is no valid session.200 {} when the session is active. Use this as a lightweight check to determine whether the current cookie is still valid before making further authenticated calls.
Response 200 OK: Returns {}.
Response 401 Unauthorized:
Health Check
200 OK:
CalendarType Reference
Defined inmodels/calendar.go:
| JSON value | Constant | Provider |
|---|---|---|
"google" | GoogleCalendarType | Google Calendar via OAuth 2.0 |
"outlook" | OutlookCalendarType | Microsoft Outlook via OAuth 2.0 |
"apple" | AppleCalendarType | Apple Calendar via app password |
The
"apple" calendar type is only used when adding a secondary calendar account via POST /api/user/add-apple-calendar-account. It is not a valid sign-in calendarType for /api/auth/sign-in.TokenOrigin Reference
Defined inmodels/user.go:
| JSON value | Constant | Meaning |
|---|---|---|
"web" | WEB | Browser-based sign-in |
"ios" | IOS | iOS app sign-in |
"android" | ANDROID | Android app sign-in |