Users
User groups
Section titled “User groups”user_group_id identifies the caller’s role. Every access rule in this reference is expressed with it, so the values are listed here once. They are ordered from most to least privileged, which is what phrases like Chief Pilot and above mean throughout these pages: that role plus every role above it in this table.
user_group_id |
Role |
|---|---|
| 1 | Flylogs Administrator (internal Flylogs staff, never a customer account) |
| 100 | Company Administrator |
| 105 | Operations Manager |
| 110 | Compliance & Safety Manager |
| 120 | Human Resources Manager |
| 130 | Financial Manager |
| 135 | Trainings Manager |
| 140 | Crew Scheduling |
| 145 | Flight Dispatcher |
| 150 | Chief Pilot |
| 170 | Flight Instructor |
| 175 | Theory Knowledge Instructor (flight schools only; never more access than 170 — see Trainings → Theory Knowledge Instructors) |
| 180 | Captain |
| 190 | Pilot |
| 200 | Student Pilot |
| 240 | Cabin Crew (companies other than SPO) |
| 245 | Specialist (SPO companies only; same level and permissions as 240) |
| 250 | Auditor |
| 300 | Mechanic |
Note that a numerically higher user_group_id means less access. See Account types for what each role can do in the application.
User Profile
Section titled “User Profile”GET /users/view.json
Retrieve the authenticated user’s profile, including personal details and user group.
Response
Section titled “Response”{ "User": { "id": "123", "active": true, "pilot": true, "billing": true, "user_group_id": "110", "base_id": "5", "supervisor_id": null, "email": "pilot@example.com", "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
Section titled “Edit Profile”POST /users/edit.json
Update the authenticated user’s profile.
Request Body
Section titled “Request Body”{ "UserDetail": { "name": "John", "surname": "Doe", "phone": "600123456", "address": "456 New Street", "city": "Barcelona", "country_id": "195", "timezone_id": "85" }, "User": { "email": "john.doe@example.com", "language": "en", "newsletter": true, "alerts": true, "message_alerts": true, "schedule_notify_all": false, "two_factor": "EMAIL" }}All fields are optional — only include fields you want to update.
User.schedule_notify_all (managers only, user_group_id < 151; ignored for other groups): when 1, the user also receives the push/WhatsApp/email roster notification for every schedule booking, change and cancellation in their company, not only the ones where they are PIC, SIC or supervisor. It is stored per company account, defaults to 0, and is returned as User.schedule_notify_all by the profile endpoint.
Response
Section titled “Response”Returns the updated UserProfileResponse (same shape as GET /users/view.json).
Change Email
Section titled “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
Section titled “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
Section titled “Frontend Validation”new_emailis a valid email formatnew_email≠ current user emailnew_email===new_email_repeatpasswordis not empty
Response
Section titled “Response”{ "result": true, "message": "Changes saved, check your mailbox at user@example.com."}Errors
Section titled “Errors”| Status | Condition |
|---|---|
| 400 | Missing fields, same email as current, or emails don’t match |
| 404 | Wrong password |
| 500 | Save failed |
Change Password
Section titled “Change Password”POST /users/password.json
Change the authenticated user’s password.
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
| password | string | Yes | Current password |
| newpassword | string | Yes | New password |
| newpasswordrepeat | string | Yes | Confirm new password |
Response
Section titled “Response”{ "result": true, "message": "Password changed successfully"}Login History
Section titled “Login History”GET /users/logins.json
Retrieve recent sign-in history and active sessions.
Response
Section titled “Response”{ "logins": [ { "UserLogin": { "id": "456", "city": "Madrid", "browser": "Chrome 120", "country": "Spain", "provider": "Google", "ip": "192.168.1.1", "modified": "2025-03-10 08:00:00" } } ], "sessions": [ { "UserSession": { "id": "abc123token", "api": false, "device": "Chrome / macOS", "ip": "192.168.1.1", "expires": "2025-03-24 08:00:00", "modified": "2025-03-10 08:00:00" } } ], "currentSession": "abc123token"}Fields
Section titled “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
Section titled “Close Session”POST /users/closesession/{sessionId}.json
Terminate a specific active session (remote logout).
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
| sessionId | string | Session ID to terminate |
User Groups
Section titled “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
Section titled “Response”[ { "id": "100", "name": "Administrator" }, { "id": "105", "name": "Manager" }, { "id": "110", "name": "Pilot" }, { "id": "120", "name": "Student" }]Countries
Section titled “Countries”GET /users/countries.json
List all countries. Returns a map of id → name.
Response
Section titled “Response”{ "1": "Afghanistan", "195": "Spain", "230": "United States"}Timezones
Section titled “Timezones”GET /users/timezones.json
List all timezones. Returns a map of id → IANA timezone name.
Response
Section titled “Response”{ "1": "Pacific/Midway", "85": "Europe/Madrid", "160": "America/New_York"}Organizations
Section titled “Organizations”GET /users/organizations.json
List all companies/organizations the authenticated user belongs to.
Response
Section titled “Response”Returns a map keyed by company ID:
{ "42": { "id": "42", "company_id": "42", "active": true, "group": "premium", "name": "Acme Flight School", "color": "#3498db", "logo": "https://..." }}Switch Organization
Section titled “Switch Organization”GET /users/switch/{companyId}.json
Switch the active company context. Returns a new session token for the target company.
Path Parameters
Section titled “Path Parameters”| Parameter | Type | Description |
|---|---|---|
| companyId | string | Target company ID |
Response
Section titled “Response”{ "result": true, "company_id": "42", "token": "new_session_token_here", "message": null}