Authentication

10 endpoints in this category.

POST/sign-in

Sign In

Authenticate with email and password. Returns a JWT token and user profile.

Authentication:Not required

Request Body

NameTypeRequiredDescription
emailstringYesUser email address
passwordstringYesAccount password

Response Fields

NameTypeRequiredDescription
tokenstringYesJWT Bearer token
loginDataobjectYesUser profile object
trial_ends_atstring|nullNoISO 8601 trial end date
needs_onboardingbooleanNoWhether onboarding is required

Error Codes

StatusMeaning
401Invalid credentials
422Validation error (missing email or password)

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/sign-in' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "clinician@example.com",
  "password": "securepassword"
}'
POST/sign-in/social

Social Sign In

Authenticate using a Google or Apple ID token. Returns a JWT token and user profile.

Authentication:Not required

Request Body

NameTypeRequiredDescription
providerstringYes'google' or 'apple'
id_tokenstringYesOAuth ID token from provider
emailstringYesUser email from provider
first_namestringYesFirst name from provider
last_namestringYesLast name from provider

Response Fields

NameTypeRequiredDescription
tokenstringYesJWT Bearer token
loginDataobjectYesUser profile object

Error Codes

StatusMeaning
401Invalid or expired ID token
422Missing required fields

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/sign-in/social' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "google",
  "id_token": "your_id_token",
  "email": "your_email",
  "first_name": "your_first_name",
  "last_name": "your_last_name"
}'
POST/register

Register

Create a new clinician account with email and password. Returns auth token with needs_onboarding flag.

Authentication:Not required

Request Body

NameTypeRequiredDescription
first_namestringYesFirst name
last_namestringYesLast name
emailstringYesEmail address
passwordstringYesPassword (min 8 chars)
password_confirmationstringYesPassword confirmation

Response Fields

NameTypeRequiredDescription
tokenstringYesJWT Bearer token
userobjectYesUser profile
needs_onboardingbooleanYesAlways true for new accounts

Error Codes

StatusMeaning
422Validation error (duplicate email, weak password)

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/register' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "first_name": "Jane",
  "last_name": "Smith",
  "email": "jane@example.com",
  "password": "securepassword",
  "password_confirmation": "your_password_confirmation"
}'
POST/register/social

Social Register

Register a new account using Google or Apple ID token.

Authentication:Not required

Request Body

NameTypeRequiredDescription
providerstringYes'google' or 'apple'
id_tokenstringYesOAuth ID token
emailstringYesEmail from provider
first_namestringYesFirst name
last_namestringYesLast name

Response Fields

NameTypeRequiredDescription
tokenstringYesJWT Bearer token
userobjectYesUser profile
needs_onboardingbooleanYesAlways true

Error Codes

StatusMeaning
401Invalid ID token
422Account already exists

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/register/social' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "provider": "your_provider",
  "id_token": "your_id_token",
  "email": "your_email",
  "first_name": "your_first_name",
  "last_name": "your_last_name"
}'
POST/forgot-password/send-otp

Send Password Reset OTP

Send a one-time password to the user's email for password reset.

Authentication:Not required

Request Body

NameTypeRequiredDescription
emailstringYesAccount email address

Response Fields

NameTypeRequiredDescription
messagestringYesConfirmation message
tokenstringYesReset flow token (used in next step)

Error Codes

StatusMeaning
404Email not found
429Too many attempts

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/forgot-password/send-otp' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "your_email"
}'
POST/forgot-password/verify-otp

Verify Password Reset OTP

Verify the OTP code. OTP expires after 5 minutes.

Authentication:Not required

Request Body

NameTypeRequiredDescription
tokenstringYesReset flow token from send-otp
otpstringYes6-digit OTP code from email

Response Fields

NameTypeRequiredDescription
reset_tokenstringYesToken for final password reset

Error Codes

StatusMeaning
401Invalid or expired OTP
422Missing token or OTP

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/forgot-password/verify-otp' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "your_token",
  "otp": "your_otp"
}'
POST/forgot-password/reset

Reset Password

Set a new password using the verified reset token.

Authentication:Not required

Request Body

NameTypeRequiredDescription
tokenstringYesVerified reset token
passwordstringYesNew password (min 8 chars)
password_confirmationstringYesConfirm new password

Error Codes

StatusMeaning
401Invalid or expired reset token
422Password too weak or mismatch

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/forgot-password/reset' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "your_token",
  "password": "your_password",
  "password_confirmation": "your_password_confirmation"
}'
POST/accept-invitation

Accept Invitation

Verify an invitation token sent by an organization admin.

Authentication:Not required

Request Body

NameTypeRequiredDescription
tokenstringYesInvitation token from email link

Response Fields

NameTypeRequiredDescription
dataobjectYesInvitation details (email, org name)

Error Codes

StatusMeaning
404Invalid or expired invitation token

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/accept-invitation' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "your_token"
}'
POST/invite-otp-verify

Verify Invitation OTP

Verify the OTP sent during the invitation acceptance flow.

Authentication:Not required

Request Body

NameTypeRequiredDescription
tokenstringYesInvitation token
otpstringYes6-digit OTP from email

Response Fields

NameTypeRequiredDescription
dataobjectYesVerification result

Error Codes

StatusMeaning
401Invalid OTP

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/invite-otp-verify' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "your_token",
  "otp": "your_otp"
}'
POST/set-new-password

Set New Password (Invitation)

Set password for a new account created via invitation.

Authentication:Not required

Request Body

NameTypeRequiredDescription
tokenstringYesInvitation token
idstringYesUser ID from OTP verification
passwordstringYesNew password
password_confirmationstringYesConfirm password

Response Fields

NameTypeRequiredDescription
tokenstringYesJWT Bearer token
loginDataobjectYesUser profile

Error Codes

StatusMeaning
422Validation error

Code Examples

curl -X POST 'https://visitnote-api-production.up.railway.app/api/therapist/v1/set-new-password' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "token": "your_token",
  "id": "your_id",
  "password": "your_password",
  "password_confirmation": "your_password_confirmation"
}'