> ## Documentation Index
> Fetch the complete documentation index at: https://developers.mypilotindex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> From an access request to your first Partner API call.

> [!WARNING]
>
> The MyPilotIndex Partner API is in preparation and is not live. Access is by request: use the [access request form](https://mypilotindex.com/api#request-access), and we will answer with a sandbox credential. Nothing here is available in production until we tell you so.

The Partner API lets an approved application, such as an electronic logbook, work with a pilot who has chosen to connect it. The pilot decides, on a MyPilotIndex consent screen, which parts of his data the partner may use.

## Steps

**1. Request access**

Fill in the [access request form](https://mypilotindex.com/api#request-access) with your company, website, a contact address and what you want to build. The request is stored for our operators. Nothing else happens automatically, so we answer by e-mail.

**2. Receive your credential**

You get a client id and a client secret, the host of the sandbox API, the host of the identity provider's token endpoint, and a webhook signing secret. Each secret is shown once.

**3. Use the sandbox**

Approved partners first work on the AWS dev environment. It holds synthetic pilots only, never real members. See the [sandbox guide](https://developers.mypilotindex.com/sandbox.md).

**4. Get a token**

Call the token endpoint with the OAuth 2.0 client credentials grant (`grant_type=client_credentials`), HTTP Basic client authentication, and the scopes you need written as `partner/<scope>`, for example `partner/hours.write`. See the [authentication guide](https://developers.mypilotindex.com/authentication.md).

**5. Send the pilot to the consent screen**

Redirect his browser to `https://mypilotindex.com/connect/{slug}` with `client_id`, `redirect_uri`, `scope`, `state`, `code_challenge` and `code_challenge_method=S256`. See the [consent guide](https://developers.mypilotindex.com/consent.md).

**6. Exchange the code**

The pilot signs in and allows, and his browser returns to your `redirect_uri` with a `code` and your `state`. Call `POST /v1/partner/grants/exchange` with the code, your PKCE `code_verifier` and the `redirect_uri`. The answer holds the grant id, the pilot's pairwise id and the scopes he granted.

**7. Call the API**

Every later call names the grant: read the summary with `GET /v1/partner/grants/{grant_id}/summary`, or push the logbook's totals with `PUT /v1/partner/grants/{grant_id}/flight-totals`.

**8. Listen for webhooks**

When a pilot disconnects you, MyPilotIndex sends `grant.revoked`. Delete what you hold for that pilot. See the [webhooks guide](https://developers.mypilotindex.com/webhooks.md).

## A first call

```bash Get a token theme={null}
curl -X POST https://{token-host}/oauth2/token \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d "grant_type=client_credentials" \
  --data-urlencode "scope=partner/profile partner/score"
```

Then send the token as a Bearer token:

```bash Read a pilot summary theme={null}
curl https://{api-host}/v1/partner/grants/{grant_id}/summary \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```

The [API reference](https://developers.mypilotindex.com/api-reference/introduction.md) lists every operation, its parameters, its answers and examples.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.