Skip to content

Administrator REST API

The purpose of the Administrator REST API is to provide an easy-to-use programming interface for administrative tasks.

Endpoint URL for API

The endpoint URL for APIs is <COMPANY-URL> as described in calling REST APIs.

Authentication

See calling REST APIs on how to get an access token.

Example Usage (Python)

For example, if you have an Administrator role, you can get a list of clusters by running:

curl 'https://<COMPANY-URL>/v1/k8s/clusters' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <ACCESS-TOKEN>' 
import http.client

conn = http.client.HTTPSConnection("https://<COMPANY-URL>")
headers = {
    'content-type': "application/json",
    'authorization': "Bearer <ACCESS-TOKEN>"
    }
conn.request("GET", "/v1/k8s/clusters", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

(replace <ACCESS-TOKEN> with the bearer token from above).

For an additional example, see the following code. It is an example of how to use the Run:AI Administrator REST API to create a User and a Project and set the User to the Project.

Administrator API Documentation

The Researcher API provides the developer interfaces for getting and manipulating the Run:AI metadata objects such as Projects, Departments, Clusters, and Users.

Detailed API documentation can be found under https://app.run.ai/api/docs. The document uses the Open API specification to describe the API. You can test the API within the document after creating a token.

Administrator API Documentation


Last update: January 28, 2022