1. Getting Started
  2. Authentication

Getting Started

Authentication

Generating API Keys

The PackageX API uses API keys to authenticate requests. You can view and manage your API keys in the PackageX Dashboard. Keep in mind there are two separate environments to generate your API Keys, Sandbox and Production.

To generate an API key, go the the developer center on your dashboard and click the plus button to generate an API key. Your account role will need to either be owner or developer to generate API Keys. The generated key will only be shown to you one time. If you lose track of the API key, there is no way to get it back, you will need to generate a new key.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your API keys in publicly accessible areas such as GitHub, client-side code, and so forth. You can also scope your API keys to only have access to APIs that you need.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Headers

To use your API key, send a header with your request with the prefix PX-API-KEY followed by your key. For example, a javascript request would look like this:

js
        fetch("https://api.packagex.io/v1/auth", {
  method: "POST",
  headers: {
    "PX-API-KEY": process.env.PX_API_KEY,
    "Content-Type": "application/json",
  },
});

      

Okay, we're being a little cheeky, we'll also accept the standard X-API-KEY header as well!