We have recently released a new tool for API users to create and manage their API keys and usage. This site is available at develop.purpleair.com.
Structure
API keys now belong to projects, and projects belong to organizations. This hierarchy will allow users to stay organized and simply control their API usage.
Organizations
The Organizations tab will display your organization. The name of this organization can be changed by clicking the Edit Organization button. The View Chart button will display the usage history of the organization, including the numbers of calls made each day along with the points consumed. The TopUp Account button will allow you to add points to your organization.
Projects
The Projects tab will display the projects within the organization. New projects can be created by clicking the Add button in the top-right corner.
Projects by default have zero points. To add points to a project, click the Update Project button. In this pop-up, you can change the name of the project and add points. Adding points to a project removes points from its organization.
Once a project has been completed and is no longer needed, it can be archived by clicking the Archive Project button. Any remaining points in the project will be added back to your organization. If the project needs to be unarchived, you will need to contact PurpleAir support.
The View Project Usage button will display the usage history of the project, including the numbers of calls made each day along with the points consumed.
API Keys
The API Keys tab displays all API keys in the organization. Each entry will show the project the API key is under, the key itself, its type (read or write), its status, and its user. New API keys can be created by clicking the Add button in the top-right corner. For more information on creating API keys, view the article Creating API Keys.
The Update API Key button will allow you to edit an API key’s settings.
- Project: The project this API key is a part of.
- Type: Cannot be edited. This can only be set while creating a new API key.
- Status: Enables or disables the ability to use this API key.
Once an API key is no longer needed, it can be archived by clicking the Archive API Key button. If the API key needs to be unarchived, you will need to contact PurpleAir support.
The API Key Usage button will display the usage history of the API Key, including the numbers of calls made each day along with the points consumed.
Users
The Users tab displays all users under the organization. API keys must have a user assigned to them, which can be set to any user in the organization while being created. The name of a user can be edited by clicking the Update User button.
Points
API usage consumes points. If a user does not have enough points in their project to make an API call, the API will return a “PaymentRequiredError”. To fix this, points can be added from the organization to the project. If the organization does not have enough points, the TopUp Account button can be used to add more.
One million points will be granted to new accounts (organizations). These points will need to be moved into a project with API keys to be used. Any additional points will need to be purchased.
Please keep in mind that it can take up to an hour for the project to recognize that points have been added. If you attempt to make an API call and still receive the “PaymentRequiredError”, the points have not been completely updated.
To Add Points
1. Go to Projects on the left-hand side.
2. Click the green icon, “Update Project”, next to the project you want to add points to.
3. Ensure there are points under “Organization” to pull from (If not, you’ll need to “Top Up”).
4. Add points and click update.