Users

User Profile

GET /users/view.json

Retrieve the authenticated user's profile, including personal details and user group.

Response

{
  "User": {
    "id": "123",
    "active": true,
    "pilot": true,
    "billing": true,
    "user_group_id": "110",
    "base_id": "5",
    "supervisor_id": null,
    "email": "[email protected]",
    "language": "en",
    "api": true,
    "two_factor": "OFF",
    "newsletter": true,
    "alerts": true,
    "message_alerts": true,
    "created": "2023-01-15 10:30:00",
    "expiration": null
  },
  "UserDetail": {
    "id": "123",
    "name": "John",
    "surname": "Doe",
    "passport": "AB123456",
    "companyid": "EMP-001",
    "dob": "1990-05-20",
    "phonecode": "+34",
    "phone": "600123456",
    "phonecode2": null,
    "phone2": "",
    "emergency_contact": "Jane Doe +34600654321",
    "public_phone": "",
    "address": "123 Airport Road",
    "pc": "28001",
    "city": "Madrid",
    "country_id": "195",
    "timezone_id": "85",
    "nationality": "Spanish",
    "birthcountry_id": "195",
    "photo": "https://...",
    "flight_hours": "1250.5",
    "color": "#3498db",
    "modified": "2025-03-10 14:22:00"
  },
  "UserGroup": {
    "name": "Pilot",
    "id": "110"
  }
}

Edit Profile

POST /users/edit.json

Update the authenticated user's profile.

Request Body

All fields are optional — only include fields you want to update.

Response

Returns the updated UserProfileResponse (same shape as GET /users/view.json).


Change Email

POST /users/email.json

Change the authenticated user's email address. After success, email_status is set to unconfirmed and a confirmation email is sent to the new address.

Request Body

Field
Type
Required
Description

new_email

string

Yes

New email address

new_email_repeat

string

Yes

Must match new_email

password

string

Yes

Current account password

Frontend Validation

  • new_email is a valid email format

  • new_email ≠ current user email

  • new_email === new_email_repeat

  • password is not empty

Response

Errors

Status
Condition

400

Missing fields, same email as current, or emails don't match

404

Wrong password

500

Save failed


Change Password

POST /users/password.json

Change the authenticated user's password.

Request Body

Field
Type
Required
Description

password

string

Yes

Current password

newpassword

string

Yes

New password

newpasswordrepeat

string

Yes

Confirm new password

Response


Login History

GET /users/logins.json

Retrieve recent sign-in history and active sessions.

Response

Fields

Field
Type
Description

logins

array

Recent sign-in audit entries

sessions

array

Currently active sessions

currentSession

string

Session ID matching the current token


Close Session

POST /users/closesession/{sessionId}.json

Terminate a specific active session (remote logout).

Path Parameters

Parameter
Type
Description

sessionId

string

Session ID to terminate


User Groups

GET /users/user_groups.json

List all user groups (roles) in the company.

GET /users/user_groups/1.json

List staff-only user groups.

Response


Countries

GET /users/countries.json

List all countries. Returns a map of id → name.

Response


Timezones

GET /users/timezones.json

List all timezones. Returns a map of id → IANA timezone name.

Response


Organizations

GET /users/organizations.json

List all companies/organizations the authenticated user belongs to.

Response

Returns a map keyed by company ID:


Switch Organization

GET /users/switch/{companyId}.json

Switch the active company context. Returns a new session token for the target company.

Path Parameters

Parameter
Type
Description

companyId

string

Target company ID

Response

circle-exclamation

Last updated