The StackPath Developer Portal

Integrate our platform directly into your products and dynamically protect your edge.

Get Started    API Reference

Getting Started

Let’s get started using the StackPath APIs!

If you haven't already, create a StackPath account and configure your first stack in the control panel.

Once you're all signed up you will need to generate API credentials. You'll find API Management by going to the upper right hand corner of the control panel and selecting Profile. Now on the left side you can select API Management and generate a key. It will show you your client secret only once, so make sure you get that copied down in a secure spot.

If you have any questions you can reach out to our 24/7 support via chat/phone/email, or you can visit our support portal for more helpful information.

Create an OAuth Token

You will need an OAuth token before you can make API calls. Run this cURL command in a terminal to generate one. Replace your_client_id and your_client_secret with the credentials you generated in the control panel. The grant_type value should always be "client_credentials".

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your_client_id",
    "client_secret": "your_client_secret",
    "grant_type": "client_credentials"

This request will return a JSON object that looks something like this:

  "access_token": "this_is_your_token_and_its_around_700_characters",
  "token_type": "bearer",
  "expires_in": 3600

The access token in the above JSON object is the bearer token value to use when calling the API. Use it in your API calls' Authorization header with the text "Bearer " in font of it.

Here's some more information about OAuth2 to check out if you're interested.

Get your Stack ID

A stack's ID is a UUIDv4 string. When you're logged into the control panel and viewing a stack, the ID is at the end of the URL:

Example Usage

Here's an example for creating a CDN site on your new stack via cURL:

curl -X POST{stack_id}/sites \
  -H "Content-Type: application/json" \
  -H "authorization: Bearer your_access_token_goes_here" \
  -d '{
    "domain": "",
    "origin": {
      "path": "/",
      "hostname": "",
      "port": 80,
      "securePort": 443
    "features": [

Next Steps

Thanks for working though these first steps with us. You should be ready to start working with our services. Our API reference lays out all the functionality that's available to you via our APIs. We are working behind the scenes to create more useful content, and will be posting more docs on a regular basis.

If you have a request, comment, or just want to say hi please send us an email. If you need immediate assistance our 24/7 support is here to help.

Updated 29 days ago

Getting Started

Let’s get started using the StackPath APIs!

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.