---
title: API authentication
description: Headless Platform API Reference
url: https://developers.wpengine.com/docs/headless-platform/reference/api/authentication/
image: https://developers.wpengine.com/og/docs/headless-platform/reference/api/authentication.png
---

# API authentication

## Purpose

This document provides instructions on how to obtain authorization to use the Headless Platform API. Once authorized, you can send requests directly or via the [Endpoints documentation](https://developers.wpengine.com/docs/headless-platform/reference/api/endpoints/) section. This setup is designed to simplify testing of the Headless Platform API.

## Prerequisites

To enable this functionality, you first need to generate authentication credentials. You can do this by navigating to the WP Engine User Portal. From the left-hand menu, select `Users`, then the `API Access tab`, and finally `Generate Credentials`. The following screenshots will guide you through the process.

![Getting to API credentials in portal](https://developers.wpengine.com/_astro/api-access.CTqZi83p_Z6i73C.webp)

Next, click the `Generate credentials` button.

![Credentials modal screenshot from portal](https://developers.wpengine.com/_astro/api-credentials-modal.Cxbz7w8t_1HCBCg.webp)

> **Caution**
>
> Once you close the dialog window, you will not be able to access the password again. Copy it and store it securely.

## Using the Headless Platform API

With authentication credentials generated, you can start sending requests to the Headless Platform API. Below is an example of such a request:

Terminal window

```bash
curl -X GET -H "Content-Type: application/json" -u "PUT_API_USERNAME_HERE:PUT_API_PASSWORD_HERE" https://js.wpengineapi.com/v1/accounts/{PUT_ACCOUNT_NAME_HERE}/apps
```

Alternatively, if you wish to quickly test specific endpoints, you can do so through our documentation. Navigate to the `API > Endpoints Documentation` tab and click the `Authorize` button. A modal will appear where you should enter the credentials you generated.

After successful authorization, locate the query you are interested in, click the `Try it now` button, input the necessary parameters, and click `Execute`.

## Was this helpful?

Thanks for the feedback!

```json
{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://developers.wpengine.com/#website","name":"WP Engine Product Documentation","url":"https://developers.wpengine.com/","description":"Resources for developing, deploying, and scaling on WP Engine.","inLanguage":"en-US","keywords":["API documentation","product documentation","headless WordPress","managed WordPress hosting"],"publisher":{"@id":"https://wpengine.com/#organization"}}]}
```
