API reference / Accounts

post/v2/accounts/google-session

Exchange a verified Google address for an applicant session

Operation
createGoogleApplicantSession
Authentication
API key

Server-to-server only, and only with the self-service tenant’s key. The public site verifies the Google address in its OAuth callback and calls this so a visitor who signed in with Google can see their applications under “My orders”. Only a confirmed applicant account is eligible; unknown, unconfirmed and suspended addresses all answer 404 so the route cannot be used as a membership oracle. The session is set in the `hv_app_session` cookie.

Request

Body

emailstringrequired

Responses

200A session was issued for the confirmed applicant account.
userAccountUserrequired
linked_applicationsobject[]required
400The request body or query failed validation.
errorobjectrequired
401No API key was presented.
errorobjectrequired
403The key is not the self-service tenant’s key, or the caller is not a key.
errorobjectrequired
404No confirmed applicant account is linked to that address.
errorobjectrequired

Example

curl
curl -X POST https://api.haavisa.com/v2/accounts/google-session \
  -H "Authorization: Bearer $HAAVISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "<email>"
  }'

More in Accounts

Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.