# Flylogs API

The Flylogs API provides programmatic access to your flight operations, crew management, training, safety, and billing data. It follows REST conventions and returns JSON responses.

## Base URL

```
https://fmc.flylogs.com/v1
```

## Authentication

All endpoints (except login and public endpoints) require a Bearer token in the `Authorization` header:

```
Authorization: Bearer <token>
```

Obtain a token via the [Authentication](/fcom/api-docs/reference/authentication.md) endpoint. Tokens expire after 14 days or on logout — whichever comes first.

## Request Format

| Method | Content-Type                                               |
| ------ | ---------------------------------------------------------- |
| GET    | No body — parameters in URL path                           |
| POST   | `application/json` (unless noted as `multipart/form-data`) |

## Response Format

All responses return JSON. Successful responses typically contain the requested data directly. Error responses include a `message` field:

```json
{
  "message": "Descriptive error message"
}
```

## HTTP Status Codes

| Code | Meaning                                 |
| ---- | --------------------------------------- |
| 200  | Success                                 |
| 400  | Bad request — invalid parameters        |
| 401  | Unauthorized — missing or invalid token |
| 403  | Forbidden — insufficient permissions    |
| 404  | Resource not found                      |
| 429  | Rate limited — too many requests        |

## Rate Limiting

API usage is throttled. Excessive requests will result in an automatic 14-day ban. Design your integration to cache responses and avoid unnecessary polling.

## Quick Links

| Section                                                      | Description                                  |
| ------------------------------------------------------------ | -------------------------------------------- |
| [Quick Start](/fcom/api-docs/quick-start.md)                 | Get up and running in minutes                |
| [Authentication](/fcom/api-docs/reference/authentication.md) | Login, logout, password recovery             |
| [Users](/fcom/api-docs/reference/users.md)                   | User profiles, sessions, account settings    |
| [Company](/fcom/api-docs/reference/company.md)               | Company settings, permissions, organizations |
| [Flights](/fcom/api-docs/reference/flights.md)               | Flight records, filtering, audit trail       |
| [Aircraft](/fcom/api-docs/reference/aircraft.md)             | Fleet management, logbooks, ADSB tracking    |
| [Pilots](/fcom/api-docs/reference/pilots.md)                 | Pilot records, certificates, currency        |
| [Schedules](/fcom/api-docs/reference/schedules.md)           | Flight schedules, availability, calendar     |
| [Messages](/fcom/api-docs/reference/messages.md)             | Internal messaging system                    |
| [Trainings](/fcom/api-docs/reference/trainings.md)           | Training courses, students, exams            |
| [Safety Reports](/fcom/api-docs/reference/safety-reports.md) | SMS reports, risk matrix                     |
| [Documents](/fcom/api-docs/reference/documents.md)           | Document library, folders, file uploads      |
| [News](/fcom/api-docs/reference/news.md)                     | Company news and announcements               |
| [Reports](/fcom/api-docs/reference/reports.md)               | Flight hours, statistics                     |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flylogs.com/fcom/api-docs/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
