---
title: Connecting to the Pressable API
url: "https://pressable.com/knowledgebase/connecting-to-the-pressable-api/"
published: 2021-07-21
modified: 2026-02-13
author: Wayne McWilliams
---

The Pressable API allows you to communicate with your [managed WordPress hosted Pressable site](https://pressable.com/managed-wordpress-hosting/) using an external application written in any programming language. Some of the things you can do after you connect to the [Pressable API](https://my.pressable.com/documentation/api/v1) include managing your site and performing operations such as creating a site, deleting a site, renaming a site, cloning a site, and a lot more.

## How to connect to the API

To connect to the API you’ll need to create a new API app from [the MyPressable API applications menu](https://my.pressable.com/api/applications) under My.Pressable Dashboard’s **User Settings → API Applications → Create New API Application**:

![](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/api1.jpg?resize=1024%2C327&ssl=1)
 
  
 Please Note: Currently, only the owner of the account is able to create new API applications. If you are a collaborator, please have the site owner set up an application for you.

From [this page](https://my.pressable.com/api/applications/new), you can give a custom name for your new API Application and assign the permission levels you’d like the app to have:

![](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/api2.jpg?resize=1024%2C450&ssl=1)
 
 Once the API app is created a **Client ID** and **Client Secret** will be generated for you which you’ll need to connect to the API from any external application. Make sure you don’t share these tokens with anyone as they can be used to access your site:

![](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/api3.jpg?resize=1024%2C524&ssl=1)## How to Generate an Access/Bearer Token?

To successfully connect to the API you’ll need an Access Token (sometimes also referred to as a Bearer Token). To generate one go to the [Pressable API docs](https://my.pressable.com/v1#) and click on [Authentication](https://my.pressable.com/documentation/api/v1#authorize). Copy the cURL snippet and replace it with your generated **Client ID** and **Client Secret.**

![Pressable API Authentication Command](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/api_auth.png?resize=1024%2C408&ssl=1)

Your end result should look similar to the snippet below but with your unique `client_id` and `client_secret`.

```
curl --location --request POST 'https://my.pressable.com/auth/token' \
--form 'grant_type="client_credentials"' \
--form 'client_id="QbWIe7vxfNzZ1vZ7_YFIDNm_NCD7b5X43A68QX4qfzk"' \
--form 'client_secret="V8uqwz5sL0PdNVm8MUNo5WfdGdm_s1g4BMYSVF47H4k"'
```

Go to the command terminal on your computer then paste the cURL snippet containing your connection credentials.

You should see a response similar to the one in the screenshot below. From there you can copy the **access\_token** as highlighted.

![Pressable API Access Token](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/connection-token.png?resize=1024%2C118&ssl=1)This Access Token will be used to authenticate requests made by your API application.

 
 Note:  The generated Access Token expires every **3599s** which is approximately **59 mins or 1 hour**. Once it expires you won’t be able to access the API and will need to generate a new one. If you are developing an app that consumes the Pressable API you’ll need to come up with a way to auto-generate the Access Token using a refresh token when it expires.

## How to query the API?

You can use an API testing Tool like Postman to test your connection and also query the API.

To get started, [download Postman](https://www.postman.com/downloads/) from their official site. To connect to the Pressable API you’ll need your Access Token and the API URL you want to query. Examples of those endpoint URLs can be found on the [API docs](https://my.pressable.com/v1) as seen in the screenshot below:

**Pressable API basic endpoint URL**

![](https://i0.wp.com/pressable.com/wp-content/uploads/2023/11/api-endpoint-example.png?resize=949%2C310&ssl=1)

A complete Pressable API endpoint URL should look similar to this: **`https://my.pressable.com/v1/121916/cache`**

## How to use Postman API test tool to clear your Pressable site Edge Cache

To successfully make a query to the API you’ll need to get the Pressable Site ID of the website you want to query.

Go to your **MyPressable Control Panel** and select the site you want to query by clicking on the site name or the settings icon from the [site list page](https://my.pressable.com/sites).

In the browser address bar, you should see your selected **Pressable Site ID,** which you can copy for use in Postman.

![](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/Screenshot-2021-07-15-at-11.21.01-AM.png?resize=1024%2C62&ssl=1)

You should now be able to form your endpoint URL to clear the edge cache of your website, which should look like this with the Site ID added: https://my.pressable.com/v1/**1219162/**edge-cache

**/edge-cache** is the query object you’re querying which can be found in the [API documentation under clear a site Edge Cache](https://my.pressable.com/documentation/api/v1#purge-edge-cache).

![Delete Edge Cache API Call](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/delete-edge-cache-api.png?resize=1024%2C394&ssl=1)

Next, go to Postman and open a new window.

![](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/Screenshot-2021-07-21-at-2.31.31-PM.png?resize=1024%2C396&ssl=1)

Enter the endpoint query URL containing your Site ID, e.g. `https://my.pressable.com/v1/<strong>1219162/</strong>edge-cache`. To clear the CDN cache, we’ll make a `DELETE` request.

![Postman API call to delete Edge Cache](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/postman-api-call-edge-cache.jpg?resize=1024%2C397&ssl=1)

Under the space you entered, the endpoint query URL, click on **Authorization** > Bearer Token > add your Token.

![](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/Screenshot-2021-07-21-at-2.36.51-PM.png?resize=1024%2C464&ssl=1)

Once it is added, you can go ahead and click on **Send** to query the API to clear your CDN cache for the site. This should [return a *200 response*](https://www.clickminded.com/status-code-200/) if the query was successful.

![Postman Edge Cache purge success](https://i0.wp.com/pressable.com/wp-content/uploads/2021/07/postman-api-call-success.jpg?resize=1024%2C464&ssl=1)For more information on how to use the Pressable API please refer to the [API docs](https://my.pressable.com/documentation/api/v1) or reach out to the Pressable support team via chat or by sending an email to help@pressable.com
