Skip to content

Bases

Manage operational bases — physical locations where aircraft, crew, and maintenance are organized — and the base roster (duty, standby, off and rest blocks per crew member).

Role names and user_group_id values are listed in User groups.

Base ids are UUIDs. Every call only sees the bases of the caller’s own company. A deleted base no longer appears in any of these endpoints (it answers 404), but flights, events and news recorded at it keep showing its name.

Endpoints Allowed groups
index, view, mechanics, pilot_schedule Every group
add, edit, delete 100 Company Administrator, 105 Operations Manager, 110 Compliance & Safety Manager, 120 Human Resources Manager
add_schedule, edit_schedule, delete_schedule, notify_roster 100, 105, 110, 120, 130 Financial Manager, 135 Trainings Manager, 140 Crew Scheduling
get_availability 100 to 150 (Company Administrator to Chief Pilot)
schedule 100 to 170 (Company Administrator to Flight Instructor) and 300 Mechanic
crew 100 to 170, 250 Auditor and 300 Mechanic

Any other group gets 403.

GET /bases/index.json

List all bases for the company, ordered by name. The response is a bare array (no wrapping key).

[
{
"Base": {
"id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10",
"company_id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890",
"default": true,
"deleted": false,
"deleted_at": null,
"airport_id": "LEMD",
"user_id": "789",
"photo": "base.jpg",
"name": "Madrid Base",
"description": "Main training base",
"user_count": "24",
"aircraft_count": "6",
"flight_count": "1520",
"created": "1590760625",
"modified": "1593970357"
}
}
]
Field Description
default true for the company’s default base. New users and the assets of a deleted base go there
airport_id ICAO code of the base airport
user_id Base manager (user id), or null
photo Picture file name; base.jpg when none was uploaded
user_count, aircraft_count, flight_count Counters kept by the server
created, modified Unix timestamps (seconds), as strings

GET /bases/view/{id}.json

Retrieve full details for a single base: its airport (with runways, frequencies and today’s sun times), its active aircraft and its base manager. The response is the bare base object.

If {id} is omitted (/bases/view.json), returns the company’s default base, or 404 No default base found for this company when there is none.

Parameter Type Description
id UUID Base ID (omit for default base)
{
"Base": {
"id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10",
"name": "Madrid Base",
"default": true,
"deleted": false,
"airport_id": "LEMD",
"user_id": "789",
"photo": "base.jpg",
"description": "Main training base",
"user_count": "24",
"aircraft_count": "6",
"flight_count": "1520"
},
"User": {
"id": "789",
"user_group_id": "105",
"UserGroup": { "name": "Operations Manager", "role": "COMPANY" },
"UserDetail": { "id": "801", "name": "Bob", "surname": "Johnson", "photo": null }
},
"Airport": {
"id": "LEMD",
"icao": "LEMD",
"iata": "MAD",
"name": "Adolfo Suárez Madrid–Barajas Airport",
"lat": "40.47193",
"lon": "-3.56264",
"elevation": "1998",
"city": "Madrid",
"SunInfo": { "sunrise": 1736494860, "sunset": 1736529780, "civil_twilight_begin": 1736493060, "civil_twilight_end": 1736531580 },
"AirportRunway": [
{ "id": "235001", "airport_id": "LEMD", "length": "13711", "width": "197", "surface": "ASP", "lights": true, "closed": false, "ident1": "18L", "ident2": "36R" }
],
"AirportFrequency": [
{ "id": "52001", "airport_id": "LEMD", "type": "TWR", "description": "Madrid Tower", "frequency": "118.15" }
]
},
"Aircraft": [
{
"id": "45",
"registration": "EC-ABC",
"base_id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10",
"AircraftModel": {
"name": "C172",
"AircraftManufacturer": { "name": "Cessna" }
}
}
]
}

User is the base manager (Base.user_id); its fields are null when the base has none. Aircraft lists the active aircraft based there, with all aircraft fields (trimmed above). The Airport object has the same fields as View Airport.


GET /bases/mechanics/{id}.json

Lists the users assigned to the base, oldest account first. Despite the endpoint name, every role is returned, deactivated accounts included (deleted users are not). Filter on user_group_id (300 = Mechanic) if you only want mechanics. The response is a bare array.

Parameter Type Description
id UUID Base ID (required; 400 without it, 404 when it is not one of the company’s bases)
[
{
"Mechanic": { "id": "456", "user_group_id": "300" },
"UserDetail": { "name": "Jane", "surname": "Smith", "photo": "456_1650826971.jpeg" }
}
]

POST /bases/add.json

Create a new base. Requires the premium or unlimited plan; on any other plan the call returns 400 Your company cannot create a new base. Groups 100, 105, 110 and 120 only.

Parameter Type Required Description
name string yes Base name (converted to Title Case server-side)
airport_id string no ICAO code of the base airport
description string no Free text
user_id number no Base manager (user id)
default boolean no Set as company default base (unsets previous default)

deleted and deleted_at are ignored: a base is only deleted through Delete Base.

{
"result": true,
"message": "",
"errors": []
}

On failure, result is false and errors contains field validation errors, for example { "name": ["notBlank"] }.


POST /bases/edit/{id}.json

Update an existing base. Groups 100, 105, 110 and 120 only. POST or PUT; any other method returns 405, an empty body 400.

Parameter Type Description
id UUID Base ID. May instead be sent as id in the body (/bases/edit.json)

Same fields as Create Base. Only include fields to update. The base must belong to the caller’s company (404 Base not found otherwise). Setting default to 1 clears the flag on the company’s other bases.

{
"result": true,
"message": "",
"errors": []
}

POST /bases/delete/{id}.json

Delete a base. Groups 100, 105, 110 and 120 only. POST or DELETE; any other method returns 405.

The base is archived, not erased, so history stays intact:

  • Its users, aircraft and inventory units move to the company’s default base.
  • Its future roster blocks (see Base Schedules) and its own operating hours are removed.
  • Flights, events and news recorded at the base keep pointing at it and still show its name.
  • It disappears from every base list and lookup.
Parameter Type Description
id UUID Base ID (400 when missing, 404 when not one of the company’s bases)
{
"result": true,
"message": ""
}

On failure result is false and message is The base could not be deleted. Please, try again.


GET /bases/crew/{id}.json

Get the active users assigned to a base (every role), sorted by name, formatted as calendar resources. The response is a bare array.

Parameter Type Description
id UUID Base ID (404 Invalid Base when missing or not one of the company’s bases)
[
{
"id": "123",
"title": "John Doe",
"eventColor": "#3788d8"
}
]
Field Description
id User ID
title Full name (name + surname)
eventColor The user’s calendar color; #3788d8 when unset

GET /bases/schedule/{id}.json

GET /bases/schedule/{id}/start:{start}/end:{end}.json

GET /bases/schedule.json

The base roster: every duty, standby, off and rest block that overlaps the range, with the crew member’s name. Omit {id} to get the blocks of all the company’s bases. Groups 100 to 170 and 300 Mechanic.

Each block has a type:

Type Meaning
DUTY On duty at the base
STANDBY On standby
OFF Day off
REST Rest period
Parameter Type Description
id UUID Optional. Base ID (404 when not one of the company’s bases)
start integer (named) Optional. Range start, unix seconds
end integer (named) Optional. Range end, unix seconds

Without a valid start/end pair (both set, end after start), the range is the current calendar month.

{
"schedules": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"base_id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10",
"pilot_id": "123",
"aircraft_id": null,
"start": "1714003200",
"end": "1714046400",
"type": "DUTY",
"user_group_id": "190",
"name": "John",
"surname": "Doe"
}
],
"start": 1711929600,
"end": 1714521599
}

Blocks are ordered by start. start and end at the top level echo the range used. user_group_id, name and surname are null when the crew member was deleted.


GET /bases/pilot_schedule/{pilotId}.json

GET /bases/pilot_schedule/{pilotId}/start:{start}/end:{end}.json

One crew member’s roster blocks (duty, standby, off, rest) across all bases. Every group can call it. Groups 100 to 150 can read any user of the company; any other group always gets its own roster, whatever {pilotId} says.

Parameter Type Description
pilotId number User ID. Required (400 Missing pilot_id); 404 Pilot not found when not a member of the company or deleted
start integer (named) Optional. Range start, unix seconds
end integer (named) Optional. Range end, unix seconds

Without a valid start/end pair, the range is the current week, Monday 00:00 to Sunday 23:59:59 (server time).

{
"schedules": [
{
"BaseSchedule": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"base_id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10",
"pilot_id": "123",
"aircraft_id": null,
"start": "1714003200",
"end": "1714046400",
"type": "DUTY",
"created": "1713800000",
"modified": "1713800000"
},
"Base": { "id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10", "name": "Madrid Base", "airport_id": "LEMD" },
"Aircraft": { "id": null, "registration": null }
}
],
"pilot": {
"User": { "id": "123", "user_group_id": "190", "company_id": "c1d2e3f4-a5b6-7890-abcd-ef1234567890", "base_id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10", "active": true },
"UserDetail": { "name": "John", "surname": "Doe" }
},
"start": 1713744000,
"end": 1714348799
}

pilot.User carries the user’s account fields (trimmed above). The same blocks also appear in the user’s calendar feed with eventType Base Schedule.


POST /bases/add_schedule.json

Put one or more crew members on the roster of a base for a time period. Groups 100 to 140 only. Each crew member gets a Flylogs message about the new block.

Parameter Type Required Description
base UUID yes Base ID (404 Invalid Base when not one of the company’s bases)
pilots array yes, or pilot User IDs. Each one gets its own block
pilot number yes, or pilots A single user ID (used when pilots is not sent)
start integer yes Start, unix seconds
end integer yes End, unix seconds
type string no DUTY (default), OFF, STANDBY or REST. Any other value becomes DUTY
aircraft_id number no Aircraft the block is for

Every user in pilots must belong to the company (404 Pilot not found otherwise).

Before saving, each new block is fitted around that crew member’s existing blocks:

  • Same type: the blocks are merged into one block covering both, and the old block is removed.
  • Different type: the new block is shortened so it does not overlap the existing one. When an existing block sits inside the new one, only the part before it is kept.

When nothing is left of the new block, the call returns 400 Schedule is fully covered by an existing record of a different type.

Status Message
400 Missing base_id parameters, Missing pilot_id parameters, Missing start/end parameters, Empty start/end parameters
400 Cannot add past availability records: both start and end are more than one hour in the past
404 Invalid Base, Pilot not found

A bare array with one entry per crew member: the saved block, or false when that save failed.

[
{
"BaseSchedule": {
"pilot_id": "123",
"aircraft_id": "",
"base_id": "0b3c6a52-7d1e-4f0a-9a7e-2f5c1d8e4b10",
"type": "DUTY",
"start": 1714003200,
"end": 1714046400,
"created": 1713800000,
"modified": 1713800000,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}
]

POST /bases/edit_schedule.json

Change the times or type of one roster block. Groups 100 to 140 only. The crew member gets a Flylogs message about the change. Unlike Add Schedule, overlapping blocks are not merged or shortened.

Parameter Type Required Description
id UUID yes Block ID
start integer yes New start, unix seconds
end integer yes New end, unix seconds
type string no DUTY, OFF, STANDBY or REST. Missing or any other value keeps the current type

The block’s base and crew member cannot be changed; aircraft_id is ignored.

Status Message
400 Missing id parameter, Missing start/end parameters, Empty start/end parameters
400 Cant add past schedule records: the new start is in the past and the new end is less than one hour ahead
400 Cant edit past schedule records: the block has already ended
404 The block does not exist or belongs to another company
{
"result": true,
"message": "The schedule has been saved.",
"errors": []
}

On a validation failure result is false, message is The schedule could not be saved. and errors lists the fields, for example { "start": ["numeric"] }.


GET /bases/delete_schedule/{id}.json

Delete one roster block, or all future blocks of the company. Groups 100 to 140 only.

Parameter Type Description
id string A block UUID, or all
  • Block UUID: deletes that block. 404 when it does not exist or belongs to another company; 400 Cannot delete past schedule records when it has already ended.
  • all: deletes every block that has not ended yet, on every base of the company, for every crew member. Past blocks are kept.
{ "result": true }

GET /bases/get_availability.json?start={start}&end={end}

GET /bases/get_availability/{userId}.json?start={start}&end={end}

A crew member’s availability records (the ones set with Add Availability), shaped as calendar events. Groups 100 to 150 only. Without {userId} it returns the caller’s own records; another user must belong to the caller’s company (404 otherwise). NEO uses /schedules/get_availability.json instead.

Parameter Type Required Description
start string yes Range start, any date string (2026-12-01, ISO 8601)
end string yes Range end

400 Missing or invalid start/end when either is missing or cannot be read. The range is widened by one day on each side. ALWAYS records are always returned, whatever the range.

A bare array ordered by start. start and end are milliseconds.

[
{
"id": "always",
"title": "Always",
"color": "#b3f542",
"type": "ALWAYS",
"start": 1764547200000,
"end": 2028989022000
},
{
"id": "6f1d2c3b-4a5e-4f60-8b7c-9d0e1f2a3b4c",
"title": "Unavailable",
"color": "#f54242",
"type": "UNAVAILABLE",
"start": 1764633600000,
"end": 1764720000000
}
]

color is grey #ccc for a record that has ended, red #f54242 for UNAVAILABLE, orange #f5a442 for MAYBE, otherwise green #b3f542. An ALWAYS record always has the id always.


POST /bases/notify_roster.json

Email a crew member their personal roster as a PDF attachment. The PDF is built by the caller (NEO renders it from the roster view) and sent base64-encoded. Groups 100 to 140 only (403 Not authorized for others).

Request Body (raw JSON, Content-Type: application/json)

Section titled “Request Body (raw JSON, Content-Type: application/json)”
Field Type Required Description
pilot_id number yes Recipient user ID
pdf_base64 string yes The PDF, base64-encoded
pilot_name string no Used in the attachment name, Roster_<pilot_name>_<YYYYMMDD of start>.pdf. Default Pilot
start integer no Roster range start, unix seconds. With end, shown in the subject and body
end integer no Roster range end, unix seconds

The email goes to the user’s own address, in plain text, subject Your roster: 1 Dec 2026 – 7 Dec 2026 (or Your roster without a range).

Status Message
400 pilot_id and pdf_base64 are required, Invalid base64 PDF data
403 Not authorized
404 Pilot not found, inactive, or email address not confirmed: the user is not an active member of the company with a confirmed email
405 Not a POST
500 Failed to send email
{
"sent": true,
"pilot_id": 123,
"email": "john.doe@example.com"
}