Skip to main content
POST
/
v2
/
auth
/
google
/
login
Google login
curl --request POST \
  --url https://staging.api.prexsell.com/v2/auth/google/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "idToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "companyId": "cmp_xyz789"
}
'
{
  "data": {
    "user": {
      "id": "usr_abc123def456",
      "email": "user@example.com",
      "firstName": "Іван",
      "lastName": "Петренко"
    },
    "access": {
      "contextType": "COMPANY",
      "companyId": "cmp_xyz789",
      "partnerId": null,
      "role": "ADMIN",
      "company": {
        "id": "cmp_xyz789",
        "name": "Prexsell Bus Lines",
        "slug": "prexsell-bus-lines",
        "tier": "PRO"
      }
    },
    "session": {
      "id": "ses_q1w2e3r4t5",
      "contextType": "COMPANY",
      "companyId": "cmp_xyz789",
      "userId": "usr_abc123def456",
      "expiresAt": "2026-06-28T00:00:00.000Z",
      "lastUsedAt": "2026-05-28T12:00:00.000Z",
      "revokedAt": null
    },
    "availableAccesses": []
  }
}

Body

application/json

Google ID token and optional company context for Google-based login.

idToken
string
required

A Google ID token obtained from the Google Sign-In flow.

Example:

"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."

companyId
string

Optional company to log into directly, bypassing the pre-login company-selection step.

Example:

"cmp_xyz789"

Response

Successful Google login. Access and refresh tokens are set as HTTP-only cookies.

data
object
required

Full authentication payload returned after a successful login, token refresh, or session fetch.