Kinsta’s REST API (Application Programming Interface) is a powerful tool designed to allow developers to easily access and interact with your Kinsta account and projects. Our API provides a streamlined and efficient way to work with our platform, allowing you to efficiently retrieve data, perform actions, and automate tasks.

​​

Prerequisites

To use Kinsta’s API, you must have an account and at least one WordPress site, application, or database in MyKinsta. You’ll also need to generate an API key to authenticate and access your account through the API.

Common Use Cases

Reporting

APIs can be used to read data so you can create your own reports or integrate Kinsta Services into your internal tracking systems. For example, if you run an agency and use an application that lists all of your clients, you can use the API to list all of the Kinsta sites, applications, and databases belonging to each client.

You can use the API to retrieve the Kinsta analytics data and build your own analytics reporting dashboard. For example, you can use a tool like Power BI to visualize the data you retrieve from the API.

Scheduled Tasks

You can create your own application to schedule tasks overnight that may impact your site’s performance or cause downtime. For example, clearing the site cache overnight can help minimize disruption for your site visitors.

Billing

Billing and resource usage data can be used to generate bills for your customers. For example, if you run an agency and charge your customers based on your costs at Kinsta, you can automatically calculate your customer’s bills based on the billing and resource usage data from the API.

Notifications

Pulling logs into third-party systems allows you to set up notifications based on different errors or events in the logs. For example, you can use a tool like Zap Data Hub or Splunk to analyze the logs and set up notifications for any errors which require immediate attention, such as issues that mean the site is not running as it should be.

You can use the API to read the WordPress, PHP, or other version data and use this information to create notifications when something requires an update.

WordPress Site Creation

You can add a new WordPress site/install automatically using the API. For example, if you run an agency and want to be able to automate the site creation process without having to log in to MyKinsta each time, you can use the API to create the site and install WooCommerce, Yoast SEO, and Easy Digital Downloads.

You also have the option to create a WordPress Multisite installation and configure a subdomain (is_subdomain_multisite TRUE) or subdirectory (is_subdomain_multisite FALSE) installation.

To check the status of site creation, use the Operations endpoint.

Authentication and User Access

To access and use the API with your account, you will first need to generate an API key in MyKinsta. To get started, go to the API Keys page (Your name > Company settings > API Keys) and click Create API Key.

  1. Choose an expiration or set a custom start date and number of hours for the key to expire.
  2. Give the key a name.
  3. Click Generate.

When the API key is provided, this is the only time you can see it. Make sure you copy it and store it somewhere safe.

Company owners, company administrators, and company developers can create API keys. The level of access to the API will depend on the user’s access. For example, an API key generated by a company developer will not have the same access as a key generated by a company owner or administrator.

You can generate multiple API keys, which are listed on the API Keys page. If you need to revoke an API key, click Revoke next to the one you want to revoke.

Check Operation Status

For potentially long-running operations (e.g. site creation, clearing cache, restarting PHP, etc.) the API does not immediately respond with the result. This helps prevent a potential blocked server thread or gateway timeout due to an operation taking a long time.

To check the status of an operation, use the /operations endpoint. When you start an operation, the immediate response from the API will include an operation_id to use with the /operations endpoint. For more details and examples, see the Operations reference.

Rate Limit

To protect our API from being flooded with too many requests, the number of requests per minute is limited to 60. There is an exception for Site creation, which is limited to 5 requests per minute.

To see your current rate limit status, check the RateLimit headers in the most recent API response:

RateLimit-Limit: 60

RateLimit-Remaining: 50

RateLimit-Reset: 60

Currently, it is not possible to increase the rate limit.

Troubleshooting

If you make a request to an endpoint that your API key doesn’t have access to, you will receive an error message to let you know you do not have access. If you need access to that endpoint, a company owner or administrator will need to generate an API key for you.

API Reference

For full details on available API endpoints, to download our OpenAPI specification, and to try out endpoints, see our API Reference.

Related Documentation

Referenced Content