Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vh3.ai/llms.txt

Use this file to discover all available pages before exploring further.

User Authentication (JWT)

These endpoints provide per-user login and JWT session management for interactive applications — custom front-ends, customer portals, and embedded tools where individual users need to sign in and maintain a session. Base URL: https://api.vh3connect.io/api:lBQnyyZL
Login requires only email and password. The user’s tenant is resolved server-side. After login, every call uses Authorization: Bearer <token> — no API key is ever sent from the client.
Need to manage users from a back-end script or integration (no user session)? Use the Users endpoints on the main FSI API with company_id + api_key. Those endpoints are server-side only — the API key must never appear in client-side code.

POST /auth/login

Authenticate a user with email and password. Returns a JWT token valid for 24 hours. The user’s tenant is resolved server-side from their account — no API key is required from the client. Request body:
FieldTypeRequiredDescription
emailemailYesUser email address
passwordstringYesUser password
curl -X POST "https://api.vh3connect.io/api:lBQnyyZL/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securepassword"
  }'
Response:
{
  "authToken": "eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0..."
}
Error responses:
StatusErrorCause
401Invalid email or passwordWrong email, wrong password, or no account found
401Account is deactivatedUser has been archived

POST /auth/refresh

Refresh an expiring JWT token. Returns a new token with a fresh 24-hour expiry. Headers:
HeaderValue
AuthorizationBearer <token>
curl -X POST "https://api.vh3connect.io/api:lBQnyyZL/auth/refresh" \
  -H "Authorization: Bearer eyJhbGciOi..."
Response:
{
  "authToken": "eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0..."
}

GET /auth/me

Get the current user profile from the JWT token. Includes the user’s company information. Headers:
HeaderValue
AuthorizationBearer <token>
curl "https://api.vh3connect.io/api:lBQnyyZL/auth/me" \
  -H "Authorization: Bearer eyJhbGciOi..."
Response:
{
  "id": 42,
  "first_name": "Jane",
  "last_name": "Smith",
  "company_id": "abc-123-def",
  "email": "jane@example.com",
  "role": "admin",
  "phone": null,
  "profile_picture": { "url": null },
  "_company": {
    "id": "abc-123-def",
    "name": "Acme Field Services"
  }
}

POST /users/invite

Invite a new user by email to the authenticated user’s company. Returns an invitation token valid for 7 days. Requires admin or developer role. Headers:
HeaderValue
AuthorizationBearer <token>
Request body:
FieldTypeRequiredDefaultDescription
emailemailYesEmail address to invite
rolestringNostandardRole to assign: admin, manager, standard, engineer
first_namestringNoFirst name of the invited user
last_namestringNoLast name of the invited user
curl -X POST "https://api.vh3connect.io/api:lBQnyyZL/users/invite" \
  -H "Authorization: Bearer eyJhbGciOi..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "newuser@example.com",
    "role": "standard",
    "first_name": "John",
    "last_name": "Doe"
  }'
Response:
{
  "email": "newuser@example.com",
  "role": "standard",
  "invite_token": "eyJhbGciOi...",
  "expires_in": 604800
}
Error responses:
StatusErrorCause
401Only admin users can invite new usersRequesting user is not admin/developer
400A user with this email already existsDuplicate email

GET /users/list

List all active users belonging to the authenticated user’s company. Supports pagination. Requires admin or developer role. Headers:
HeaderValue
AuthorizationBearer <token>
Query parameters:
ParamTypeRequiredDefaultDescription
pageintegerNo1Page number
per_pageintegerNo25Items per page
curl "https://api.vh3connect.io/api:lBQnyyZL/users/list?page=1&per_page=25" \
  -H "Authorization: Bearer eyJhbGciOi..."
Response:
{
  "items": [
    {
      "id": 42,
      "first_name": "Jane",
      "last_name": "Smith",
      "email": "jane@example.com",
      "role": "admin",
      "phone": null,
      "profile_picture": { "url": null },
      "email_verified": true
    },
    {
      "id": 43,
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@example.com",
      "role": "standard",
      "phone": null,
      "profile_picture": { "url": null },
      "email_verified": true
    }
  ],
  "curPage": 1,
  "nextPage": null,
  "prevPage": null
}

DELETE /users/

Soft-delete a user by setting their account to archived. The user will no longer be able to log in. Cannot delete your own account. Requires admin or developer role. Headers:
HeaderValue
AuthorizationBearer <token>
Path parameters:
ParamTypeDescription
user_idintegerID of the user to delete
curl -X DELETE "https://api.vh3connect.io/api:lBQnyyZL/users/43" \
  -H "Authorization: Bearer eyJhbGciOi..."
Response:
{
  "success": true,
  "user_id": 43
}
Error responses:
StatusErrorCause
401Only admin users can delete usersRequesting user is not admin/developer
400Cannot delete your own accountuser_id matches the authenticated user
400User not foundNo user with this ID
401Cannot delete users from another companyTarget user belongs to a different tenant

Roles reference

RoleData accessUser management
adminFullInvite, list, delete users
developerFullInvite, list, delete users
managerFullNo
standardFullNo
engineerFullNo