Skip to main content

ComPilot API

The ComPilot API is a RESTful API that allows you to interact programmatically with ComPilot.

Getting an API key

To use the ComPilot API, you need an API key. To get the API key, in the Dashboard menu, select Settings > API. The API page is displayed. It shows the API key and documentation on each API endpoint.

API calls need to be authorized using HTTP bearer authorization, where the API key is used as the token. For example, when using curl the API key should be passed to the API using -H 'Authorization: Bearer <TOKEN>'.

curl -L 'https://api.compilot.ai/customers' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'

Where <TOKEN> is your API key.

This example will return a list of customers. See Get customers for more information.

OpenAPI specification

You can download the OpenAPI specification for the ComPilot API from https://api.compilot.ai/.

Swagger UI

You can use the ComPilot Swagger UI portal to interact with the ComPilot API.

Authorization

Follow these steps to enable authorization.

  1. Get an API key.
  2. On the Swagger UI portal, click the click the Authorize button. The Available authorizations modal is displayed.
  3. Enter your API key in the Value field and click Authorize.

Now all requests you make through the Swagger UI interface, and that require authorization, will be automatically authorized using HTTP bearer authorization.