⚡ Quick Start Guide

Access the Elastx Cloud Platform API (ECPAPI)

1. Introduction

The ECPAPI provides programmatic access to Elastx Cloud services, including resource management and automation capabilities. This guide will walk you through how to generate your API key, explore the API using Swagger UI, and make authenticated requests.

ECPAPI is currently in beta.


2. Authentication

Before accessing the API, you need to generate a Service Account Token from the Elastx Cloud Console (ECC).

This token will inherit the same permissions as your account within the selected organization. Use it in the Authorization header as follows:

Authorization: ServiceAccount <token>

Creating a Service Account Token

  1. Log in to https://console.elastx.cloud/account.
  2. Navigate to Service Accounts.
  3. Select your organization.
  4. Optionally set the token expiry (in seconds). Leave blank to use the default (1 year).
  5. Click Save.
  6. Copy and securely store the generated token. It will be used as a Bearer token in your API requests.

📌 Important: The token will only be shown once after creation. Store it securely.

Curl example using Service Account Token

curl -X 'GET' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations' \
  -H 'accept: application/json' \
  -H 'Authorization: ServiceAccount <token>'

3. Explore the API (Swagger UI)

You can explore and test the API interactively using the Swagger UI.

4. Example API Calls Using curl

List your organizations

Since the service account token is organization scoped, when using a Service Account Token, this will only return one organization.

curl -X 'GET' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations' \
  -H 'accept: application/json' \
  -H 'Authorization: ServiceAccount <token>'

List Dbaas Projects in organization

curl -X 'GET' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations/<org-id>/dbaasprojects' \
  -H 'accept: application/json' \
  -H 'Authorization: ServiceAccount <token>'

List users in organization

curl -X 'GET' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations/<org-id>/users' \
  -H 'accept: application/json' \
  -H 'Authorization: ServiceAccount <token>'

Add user to organization

These users will not automatically get any access to neither ECC nor DBaaS projects, but you will need to add them to your organization in order to give them access to a DBaaS project. If the user does not have a prior account with a verified email you will need to trigger an invite to let the user verify their email address.

curl -X 'POST' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations/<org-id>/users' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: ServiceAccount <token>'
  -d '{
  "email": "user@example.com",
  "firstName": "Firstname",
  "lastName": "LastName"
}'

response:

{
  "name": "useratexample-com",
  "email": "user@example.com",
  "firstName": "Firstname",
  "lastName": "LastName"
  "emailVerified": false
}

Send invite email

curl -X 'POST' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations/<org-id>/users/<user-name>/invites' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: ServiceAccount <token>'

Create a new DbaasProject

curl -X 'POST' \
  'https://console.elastx.cloud/ecp-api/apis/v1/organizations/<org-id>/dbaasprojects' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: ServiceAccount <token>'
  -d '{
"projectName": "test project"
}'

response:

{
  "name": "test-project",
  "organization": "e0db3c07-b6aa-4ec6-8d21-f5c5fa670fbb",
  "projectName": "test project",
  "ccxProjectName": ""
}

Give user access to DbaasProject

Role can be member or admin both grant access to the DbaasProject in the DBaaS console, but only admin will give the user access to manage the DBaaS project in ECC and add additional users to the project.

curl -X 'POST' \
  'http://localhost:9000/apis/v1/organizations/<org-id>/dbaasprojects/<project-name>/members' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: ServiceAccount <token>'
  -d '{
  "role": "member",
  "userRef": "test-ecp-apiatelastx-se"
}'

Remove users access from DbaasProject

curl -X 'DELETE' \
  'http://localhost:9000/apis/v1/organizations/<org-id>/dbaasprojects/<project-name>/members/<user-ref>' \
  -H 'accept: application/json' \
  -H 'Authorization: ServiceAccount <token>'

5. Additional API: DBaaS (Database as a Service)

Elastx also provides a separate API for managing DBaaS environments.

  • Base URL: https://dbaas.elastx.cloud/api
  • Swagger UI: API Docs

6. Support

Need help with authentication or API usage?

📧 Contact us at support@elastx.se

Last modified July 4, 2025: add-cluster-upgrade-article (#250) (58b2218)