User API

post /users/login

Login

Base URL https://api.vseepreview.com/api_v3 · operationId loginUser

Authentication: Account Code Only — Only requires the X-AccountCode header. No token needed.

Log user in and retrieve access token. Public access — no API token required.

Two login methods:

1. Active user: Use username and password

2. Inactive user (no password set): Use email and email_token sent to their email

After updating password via API, inactive users can use the active login method.

Parameters

NameInTypeRequiredEnumDefaultDescription
X-AccountCodeheaderstringyesAccount code (e.g. vclinic)

Request body

Content type: application/x-www-form-urlencoded

FieldTypeRequiredEnumDescription
usernamestringnoFor active user login
passwordstringnoFor active user login
emailstringnoFor inactive user login
email_tokenstringnoFor inactive user login (token sent to email)

Example:

{
  "username": "member-201",
  "password": "example_password"
}

Responses

200 — Successful login

Active user login — Successful login response

{
  "data": {
    "user_id": "201",
    "token": "18c31fa10afb6f0857c803eb01a2b392",
    "expiry": 1473822319,
    "created": 1473735919,
    "user_type": "200",
    "refresh_token": {
      "user_id": "201",
      "token": "6338a6e42f407acf39d07a63442efb9d",
      "expiry": 1476327919,
      "created": 1473735919
    },
    "user": {
      "id": "201",
      "code": "54bdf165f02c4a0fbaac2603ac1f0144",
      "first_name": "Lemuel",
      "last_name": "Eveline (201)test",
      "username": "member-201",
      "vseeid": "conciergedev+richard",
      "dob": "1960-01-01",
      "email": "an+user1@vsee.com",
      "gender": 2,
      "active": true,
      "tos": false,
      "phone": "800-555-5555",
      "subtype": ""
    }
  }
}

Inactive user login — Successful login with email token

{
  "data": {
    "user_id": "201",
    "token": "18c31fa10afb6f0857c803eb01a2b392",
    "expiry": 1473822319,
    "created": 1473735919,
    "user_type": "200",
    "refresh_token": {
      "user_id": "201",
      "token": "6338a6e42f407acf39d07a63442efb9d",
      "expiry": 1476327919,
      "created": 1473735919
    },
    "user": {
      "id": "201",
      "first_name": "An",
      "last_name": "Nguyen",
      "email": "an+1@vsee.com",
      "active": false
    }
  }
}

400 — Bad Request

{
  "code": 404,
  "message": "Sorry, this page is not available."
}

401 — Unauthorized

{
  "code": 404,
  "message": "Sorry, this page is not available."
}

Machine-readable: OpenAPI JSON (operationId: loginUser)