> ## Documentation Index
> Fetch the complete documentation index at: https://pleo-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

Welcome to the Pleo API! We're here to help you get connected fast. This Quickstart guide walks you through using an API key to get up and running.

### Introduction

There are two ways to authenticate:

* [OAuth](https://pleo-preview.mintlify.site/docs/oauth-20.md)
* [API keys](https://pleo-preview.mintlify.site/docs/api-keys.md)

For this guide, we will be using the **API keys flow** and assume you have a Pleo account. Read more details about each flow in our [Authentication guide](https://dash.readme.com/project/pleo/v0.03/docs/authentication-authorisation-introduction).

### 1. Get your API key

1. Head to your Pleo account > Settings > Scroll down and click on [API keys](https://app.pleo.io/settings/api-keys)

![getting started api key settings](https://mintcdn.com/pleo-preview/c659IWokIti4QP1F/images/docs/quickstart/getting-started-api-key-settings.jpg?fit=max\&auto=format\&n=c659IWokIti4QP1F\&q=85\&s=a658e0dffed73a878fc821346288d728)

2. Click on *Create API key*

![getting started create api key settings](https://mintcdn.com/pleo-preview/c659IWokIti4QP1F/images/docs/quickstart/getting-started-create-api-key-settings.jpg?fit=max\&auto=format\&n=c659IWokIti4QP1F\&q=85\&s=59932ea43973d3bd376dcea3b8ffffba)

3. Add the following details

* **Name**: give your key a name that will help you remember what it's for, like `Pleo API Quickstart`
* **Expiration date**: choose when you want the key to expire
* **Access level**: decide if the key is for a specific entity (company) or for multiple entities of a business (organisation). [Read about the differences here](https://pleo-preview.mintlify.site/docs/multi-entity-setup-with-pleo.md).
* **Permissions**: select the scopes you need. Your selections will automatically enable the right permissions in your key.

4. Click on *Create API Key*

![getting started click on create API key settings](https://mintcdn.com/pleo-preview/c659IWokIti4QP1F/images/docs/quickstart/getting-started-click-on-create-api-key-settings.jpg?fit=max\&auto=format\&n=c659IWokIti4QP1F\&q=85\&s=b49995375b0711cc8a53821cc423f5cb)

5. Store your key securely as you will only be able to see it once

### 2. Make your first API call

Time to put your new key to use!

When authenticating with API keys, include the key in the `Authorization` header of the request, using the `Basic` schema. The key should be used as the username, and an empty string should be used as the password.

We'll use the [Get Search for employees](https://dash.readme.com/project/pleo/v0.03/refs/getemployee-1) query for this example.

**curl**

With curl, specify the `-u / --user` flag, followed by the API key. The password is an empty string.

```shell Request example theme={null}
curl --request GET \
     --url https://external.pleo.io/v2/employees \
     --header 'accept: application/json;charset=UTF-8' \
     --header 'authorization: Basic API_KEY'
```

If the request is successful, you will receive a response such as:

```json Response example theme={null}
{
  "data": [
    {
      "code": "string",
      "companyId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "email": "string",
      "firstName": "string",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "jobTitle": "string",
      "lastName": "string",
      "phone": "string"
    }
  ],
  "pagination": {
    "currentRequestPagination": {
      "after": "string",
      "before": "string",
      "limit": 0,
      "offset": 0,
      "parameters": {
        "additionalProp": [
          "string"
        ]
      },
      "sortingKeys": [
        "string"
      ],
      "sortingOrder": [
        "ASC"
      ]
    },
    "endCursor": "string",
    "hasNextPage": true,
    "hasPreviousPage": true,
    "startCursor": "string",
    "total": 0
  }
}
```

**Postman**

In Postman, you can specify the API key in the Authorization tab, selecting the Basic Auth type, and using the API key as the username, and an empty string as the password.

![getting started postman](https://mintcdn.com/pleo-preview/c659IWokIti4QP1F/images/docs/quickstart/getting-started-postman.jpg?fit=max\&auto=format\&n=c659IWokIti4QP1F\&q=85\&s=576118386104272310f07b804f1061be)

### Errors

We use standard HTTP status codes to let you know if a request was successful or if there was an issue. For a full list of codes and what they mean, check out our [API Response Codes | Errors guide](https://pleo-preview.mintlify.site/reference/api-response-codes-errors-1.md).

### Next steps

Congrats, you've just completed the Quickstart 🎉 We recommend checking the [Auhtorization guide](https://pleo-preview.mintlify.site/docs/authentication-authorisation-introduction.md) next.

**What’s Next**

[Introduction ->](https://pleo-preview.mintlify.site/docs/authentication-authorisation-introduction.md)


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