Skip to main content

Getting started with curl

1

Install curl if it isn't already installed on your machine

To check if curl is installed, execute curl --version in the command line. If the output is information about the version of curl, it is installed. If you get a message similar to command not found: curl, you need to download and install curl. For more information, see the curl project download page
2

Create a Tenant API key

Create a Tenant API key accessing Tenant API Keys dashboard
API Key

Go to Settings > API Keys


API Name

Add a API Key name and Create API Key

Give the key a name and choose its Role. Tenant admin, the default, can call every operation. A narrower role limits the key to the operations and integrations that role allows. See Tenant API keys.
Treat your API key like a password. Do not store it as plain text or expose it in any code base.
3

Use the curl command to make your request

Pass your API key in an Authorization header. Replace {PLERION_API_KEY} with your API key.

Overview

Plerion API uses API keys to authenticate requests. You can view and manage your API keys in the Tenant API Keys dashboard. API responses are JSON-encoded.

Authentication

To authenticate to Plerion API send the API Key using bearer auth in the Authorization header. Authorization: Bearer $PLERION_API_KEY All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Roles and permissions

Every API key holds a role. A key with the Tenant admin role can call every operation, on every integration in the tenant. A key with the Tenant read-only role or a custom role can call only the operations its permissions allow, on the integrations the role covers. A request the role does not allow is refused with 403 Forbidden. Assign and change roles on the API keys page. See Tenant API keys. To see what a key can call, make a GET request to /v1/tenant/openapi with that key. The response is this API reference as an OpenAPI 3.1 document limited to the key. Operations the role cannot call are left out. Send Accept: application/yaml to receive YAML instead of JSON.

Errors

Plerion uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted). Codes in the 5xx range indicate an error with Plerion’s servers. A 403 Forbidden with the body {"message":"Forbidden"} means the key’s role does not allow the operation. Give the key a role that holds the permission the operation needs, or use a different key. Some 4xx errors that could be handled programmatically include an error code that briefly explains the error reported. Detailed description of the status code can be found in the Response Status Codes section.

Response Status Codes

The Plerion API endpoints return the following HTTP response status codes.