# TypeDB Cloud API

## [](#_authorization)Authorization

### [](#_token_exchange)Token Exchange

Exchange an API token’s client ID and client secret for a short-lived access token to authenticate against the rest of the API.

 

Required access

None

Method

`POST`

URL

`/api/v1/auth`

Request body

None

Request headers

`Authorization: Basic CLIENT_ID:CLIENT_SECRET`

**Responses:**

200: OK

This response will contain only the access token

Response format:

```
string
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    
*   Invalid client ID
    
*   Invalid client secret
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request POST \
    --url https://cloud.typedb.com/api/v1/auth \
    --header 'Authorization: Basic {CLIENT_ID}:{CLIENT_SECRET}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/auth"

headers = {
    "Authorization": "Basic {CLIENT_ID}:{CLIENT_SECRET}"
}

response = requests.post(url, headers=headers)
```

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .post("https://cloud.typedb.com/api/v1/auth")
        .header(reqwest::header::AUTHORIZATION, "Basic {CLIENT_ID}:{CLIENT_SECRET}")
        .send().await;
    Ok(())
}
```

**Example response:**

```
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
```

### [](#accesslevels)API Token Access Levels

When generating your API token, you will grant it a certain access level to a space of your choice. It will be able to perform the actions within that space as described below:

 

Project access level

Available cluster actions

Admin

Destroy

Write

Deploy, Suspend, Resume, Clone

Read

Get, List

## [](#_clusters)Clusters

### [](#_deploy)Deploy

 

Required access

**write** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`POST`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/deploy`

Request body

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "provider": string,
    "region": string,
    "isFree": boolean,
    "machineType": string,
    "storageType": string,
    "version": string,
    "backupConfiguration": {
      "frequency": string,
      "retentionDays": number
    }
}
```

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

409: Conflict

Possible causes:

*   Attempting to create a resource with an already-in-use ID
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

Clusters deployed through the API will have a default user with the username `admin` and the password `password`. We recommend updating the default password before using the cluster - which can also be done through the TypeDB Cloud UI by clicking the "Connect" button on the cluster’s page.

**Example request:**

*   curl
    
*   Python
    
*   Rust
    
*   Request Body
    

```console
curl --request POST \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/deploy \
    --header 'Authorization: Bearer {ACCESS-TOKEN}' \
    --json '{"id":"api-cluster","serverCount":1,"storageSizeGB":10,"provider":"gcp","region":"europe-west2","isFree":true,"machineType":"c2d-highcpu-2","storageType":"standard-rwo","version":"latest"}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/deploy"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

body = {
    "id": "api-cluster",
    "serverCount": 1,
    "storageSizeGB": 10,
    "provider": "gcp",
    "region": "europe-west2",
    "isFree": True,
    "machineType": "c2d-highcpu-2",
    "storageType": "standard-rwo",
    "version": "latest"
}

response = requests.post(url, headers=headers, json=body)
```

```rust
use reqwest;
use serde::Serialize;

#[derive(Serialize)]
struct ClusterDeploy {
    id: String,
    serverCount: i32,
    storageSizeGB: i32,
    provider: String,
    region: String,
    isFree: bool,
    machineType: String,
    storageType: String,
    version: String
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cluster_deploy = ClusterDeploy {
        id: "api-cluster".into(),
        serverCount: 1,
        storageSizeGB: 10,
        provider: "gcp".into(),
        region: "europe-west2".into(),
        isFree: true,
        machineType: "c2d-highcpu-2".into(),
        storageType: "standard-rwo".into(),
        version: "latest".into()
    };
    let client = reqwest::Client::new();
    let resp = client
        .post("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/deploy")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .json(&cluster_deploy)
        .send().await;
    Ok(())
}
```

```json
{
    "id":"api-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "provider":"gcp",
    "region":"europe-west2",
    "isFree":true,
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "version":"latest"
}
```

**Example response:**

```json
{
    "id":"api-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"starting",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "pending"
        }
    ]
}
```

 

Field

Allowed Values

`id`

The cluster’s ID must be unique within its space, and consist only of lowercase alphanumeric characters, optionally separated by underscores and hyphens.

`serverCount`

An odd integer value between 1 and 9. TypeDB version 3.0 and onwards can currently only have one server.

`storageSizeGB`

An integer value between 10 and 1000.

`provider`

Must be either `gcp` or `aws`

`isFree`

If set to `true`, must use a valid free machine type, and have at most 1 server and 10GB of storage. You may only have one free cluster per team.

If set to `false`, there must be a valid payment method on the team.

`region`

See [below](#regionsmachinetypes)

`machineType`

See [below](#regionsmachinetypes)

`storageType`

See [below](#storagetypes)

`version`

A list of available versions can be obtained from the [version list](#listversions) API endpoint, or `latest` can be supplied.

`backupConfiguration`

Optional for free clusters. If unset, it will take default values as below

`backupConfiguration.frequency`

Must be one of:

*   `disabled`
    
*   `hourly`
    
*   `daily`
    

Must be `disabled` for free clusters.

`backupConfiguration.retentionDays`

Must be either 7 or 30. Defaults to `7` if `backupConfiguration` is unset.

GCP regions and machine types

  

Machine Types

Free Available

Regions

c2d-highcpu-2

Yes

*   europe-west2
    
*   europe-west3
    
*   us-west4
    
*   us-east1
    

c2d-highcpu-4

No

*   europe-west2
    
*   europe-west3
    
*   us-west4
    
*   us-east1
    

c2d-highcpu-8

No

*   europe-west2
    
*   europe-west3
    
*   us-west4
    
*   us-east1
    

c2d-highcpu-16

No

*   europe-west2
    
*   europe-west3
    
*   us-west4
    
*   us-east1
    

AWS regions and machine types

  

Machine Types

Free Available

Regions

c7g.large

Yes

*   eu-west-2
    

c7g.xlarge

No

*   eu-west-2
    

c7g.2xlarge

No

*   eu-west-2
    

c7g.4xlarge

No

*   eu-west-2
    

c8g.large

Yes

*   us-west-2
    
*   us-east-1
    
*   eu-central-1
    

c8g.xlarge

No

*   us-west-2
    
*   us-east-1
    
*   eu-central-1
    

c8g.2xlarge

No

*   us-west-2
    
*   us-east-1
    
*   eu-central-1
    

c8g.4xlarge

No

*   us-west-2
    
*   us-east-1
    
*   eu-central-1
    

Storage types

 

Provider

Storage Type

GCP

standard-rwo

AWS

gp2-csi

### [](#_get)Get

 

Required access

**read** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`GET`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID`

Request body

None

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request GET \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID \
    --header 'Authorization: Bearer {ACCESS-TOKEN}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

response = requests.get(url, headers=headers)
```

```rust
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .get("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .send().await;
    Ok(())
}
```

**Example response:**

```json
{
    "id":"new-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"running",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "running"
        }
    ]
}
```

### [](#_list)List

 

Required access

**read** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`GET`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters`

Request body

None

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
[
    {
        "id": string,
        "serverCount": number,
        "storageSizeGB": number,
        "isFree": boolean,
        "status": string,
        "createdAt": number,
        "organization": string,
        "project": string,
        "version": string,
        "provider": string,
        "region": string,
        "machineType": string,
        "storageType": string,
        "servers": [
            {
              "address": string,
              "status": string
            }
        ]
    }
]
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request GET \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters \
    --header 'Authorization: Bearer {ACCESS-TOKEN}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

response = requests.get(url, headers=headers)
```

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .get("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .send().await;
    Ok(())
}
```

**Example response:**

```json
[
    {
        "id":"new-cluster",
        "serverCount":1,
        "storageSizeGB":10,
        "isFree":true,
        "status":"running",
        "createdAt":1738256490070,
        "teamID":"new-team",
        "spaceID":"default",
        "version":"3.1.0",
        "provider":"gcp",
        "region":"europe-west2",
        "machineType":"c2d-highcpu-2",
        "storageType":"standard-rwo",
        "servers": [
            {
              "address": "abc123-0.cluster.typedb.com:80",
              "status": "running"
            }
        ]
    },
    {
        "id":"cluster-two",
        "serverCount":1,
        "storageSizeGB":10,
        "isFree":false,
        "status":"suspended",
        "createdAt":1738256490090,
        "teamID":"new-team",
        "spaceID":"default",
        "version":"3.1.0",
        "provider":"aws",
        "region":"eu-west-2",
        "machineType":"c7g.large",
        "storageType":"gp2",
        "servers": []
    }
]
```

### [](#_update)Update

 

Required access

**write** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`PATCH`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID`

Request body

```json
{
    "id": string,
    "storageSizeGB": number,
    "machineType": string,
    "backupConfiguration": {
      "frequency": string,
      "retentionDays": number
    },
    "version": string
}
```

Request headers

`Authorization: Bearer ACCESS_TOKEN`

*   All fields are optional, but at least one field must be set.
    
*   For free clusters, updating any field other than `id` requires an active payment method.
    

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    
*   Request Body
    

```console
curl --request PATCH \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID \
    --header 'Authorization: Bearer {ACCESS-TOKEN}' \
    --json '{"id":"new-id"}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

body = {
    "id": "new-id"
}

response = requests.patch(url, headers=headers, json=body)
```

```rust
use reqwest;
use serde::Serialize;

#[derive(Serialize)]
struct ClusterUpdate {
    id: String,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cluster_update = ClusterUpdate {
        id: "api-cluster".into(),
    };
    let client = reqwest::Client::new();
    let resp = client
        .patch("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .json(&cluster_deploy)
        .send().await;
    Ok(())
}
```

```json
{
    "id": "api-cluster",
    "backupConfiguration": {
        "frequency": "daily"
    }
}
```

**Example response:**

```json
{
    "id":"new-id",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"running",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "running"
        }
    ]
}
```

### [](#_suspend)Suspend

 

Required access

**write** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`POST`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/suspend`

Request body

None

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request POST \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/suspend \
    --header 'Authorization: Bearer {ACCESS-TOKEN}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/suspend"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

response = requests.post(url, headers=headers)
```

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .post("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/suspend")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .send().await;
    Ok(())
}
```

**Example response:**

```json
{
    "id":"new-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"suspending",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "running"
        }
    ]
}
```

### [](#_resume)Resume

 

Required access

**write** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`POST`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/resume`

Request body

None

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request POST \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/resume \
    --header 'Authorization: Bearer {ACCESS-TOKEN}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/resume"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

response = requests.post(url, headers=headers)
```

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .post("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/resume")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .send().await;
    Ok(())
}
```

**Example response:**

```json
{
    "id":"new-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"resuming",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "pending"
        }
    ]
}
```

### [](#_clone)Clone

 

Required access

**write** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`POST`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/clone`

Request body

```json
{
    "id": string,
}
```

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request POST \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/clone \
    --header 'Authorization: Bearer {ACCESS-TOKEN}' \
    --json '{"id":"cloned-cluster"}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID/clone"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

body = {
    "id": "cloned-cluster"
}

response = requests.patch(url, headers=headers, json=body)
```

```rust
use reqwest;
use serde::Serialize;

#[derive(Serialize)]
struct ClusterClone {
    id: String,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let cluster_clone = ClusterClone {
        id: "cloned-cluster".into(),
    };
    let client = reqwest::Client::new();
    let resp = client
        .patch("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .json(&cluster_clone)
        .send().await;
    Ok(())
}
```

**Example response:**

```json
{
    "id":"cloned-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"starting",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "pending"
        }
    ]
}
```

### [](#_destroy)Destroy

 

Required access

**admin** to `team/TEAM_ID/spaces/SPACE_ID`

Method

`DELETE`

URL

`/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID`

Request body

None

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "id": string,
    "serverCount": number,
    "storageSizeGB": number,
    "isFree": boolean,
    "status": string,
    "createdAt": number,
    "organization": string,
    "project": string,
    "version": string,
    "provider": string,
    "region": string,
    "machineType": string,
    "storageType": string,
    "servers": [
        {
          "address": string,
          "status": string
        }
    ]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

403: Forbidden

Possible causes:

*   The supplied access token lacks the required access level for the request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

404: Not Found

Possible causes:

*   One or more resources referenced in the request could not be found
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request DELETE \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID \
    --header 'Authorization: Bearer {ACCESS-TOKEN}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

response = requests.delete(url, headers=headers)
```

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .delete("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .send().await;
    Ok(())
}
```

**Example response:**

```json
{
    "id":"new-cluster",
    "serverCount":1,
    "storageSizeGB":10,
    "isFree":true,
    "status":"destroying",
    "createdAt":1738256490070,
    "teamID":"new-team",
    "spaceID":"default",
    "version":"3.1.0",
    "provider":"gcp",
    "region":"europe-west2",
    "machineType":"c2d-highcpu-2",
    "storageType":"standard-rwo",
    "servers": [
        {
          "address": "abc123-0.cluster.typedb.com:80",
          "status": "running"
        }
    ]
}
```

### [](#listversions)List versions

 

Required access

None

Method

`GET`

URL

`/api/v1/cluster-versions`

Request body

None

Request headers

`Authorization: Bearer ACCESS_TOKEN`

**Responses:**

200: OK

Response format:

```json
{
    "availableVersions": string[]
}
```

400: Bad Request

Possible causes:

*   Incorrectly formatted request (e.g. Authorization header missing a token)
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

401: Unauthorized

Possible causes:

*   Invalid token
    
*   Expired token
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

500: Internal Server Error

Possible causes:

*   An unexpected error prevented TypeDB Cloud from serving your request
    

Response format:

```json
{
    "code": string,
    "message": string
}
```

**Example request:**

*   curl
    
*   Python
    
*   Rust
    

```console
curl --request DELETE \
    --url https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID \
    --header 'Authorization: Bearer {ACCESS-TOKEN}'
```

```python
import requests

url = "https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID"

headers = {
    "Authorization": "Bearer {ACCESS-TOKEN}"
}

response = requests.delete(url, headers=headers)
```

```rust
use reqwest;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = reqwest::Client::new();
    let resp = client
        .delete("https://cloud.typedb.com/api/v1/team/TEAM_ID/spaces/SPACE_ID/clusters/CLUSTER_ID")
        .header(reqwest::header::AUTHORIZATION, "Bearer {ACCESS-TOKEN}")
        .send().await;
    Ok(())
}
```

**Example response:**

```json
{
    "availableVersions": [ "2.29.3", "3.5.1" ]
}
```

[Typescript HTTP Driver](../typedb-http-drivers/typescript/index.md) [TypeDB 2.x vs TypeDB 3.x](../typedb-2-vs-3/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/reference/modules/ROOT/pages/cloud-http-api.adoc) Edit this page on GitHub.