Skip to content
PATCH /datastore/{id}

Path Parameters

idstring · uuid
required·

The ID of the datastore to update.

Request Body

configobject

Updated config object. Partial updates are accepted; fields not supplied are left unchanged. Shape still depends on type. An update that moves api_url (mongo_data_api) or base_url (qdrant) to another site must send api_key with it, or it is refused with a 400. api_key sent back as ******** keeps the stored key, so it is refused too.

One of
Mongo Data Api · 4 properties
api_keystring

Atlas Data API key. Treat as a secret.

api_urlstring

Base URL of your Atlas Data API endpoint.

data_sourcestring

Name of the Atlas cluster (the Data API "data source").

databasestring
Google Cloud Storage · 2 properties
credentialsobject
required·

Service-account JSON used to authenticate against Google Cloud Storage.

11 properties
auth_provider_x509_cert_urlstring
auth_uristring
client_emailstring
client_idstring
client_x509_cert_urlstring
private_keystring
private_key_idstring
project_idstring
token_uristring
typestring
universe_domainstring
bucketstring
S3 · 5 properties
access_key_idstring
base_urlstring

Optional override for non-AWS S3 endpoints (e.g. R2, MinIO).

bucketstring
regionstring
secret_access_keystring

Secret access key. Treat as a secret.

Qdrant · 4 properties
api_keystring

Qdrant API key. Treat as a secret.

base_urlstring
collectionstring
portinteger
labelstring

New label for this datastore.

validation_methodsstring[]

Optional list of datastore methods to run against the connection before it is saved. If any of them fails, the request is refused with a 400. s3 and google_cloud_storage support listObjects and uploadObject; other names, and other datastore types, are not checked.

Example: ["listObjects"]

Response Body

configobject

Config object for the datastore connection (minus sensitive fields). The shape depends on type.

Example:
{
  "data_source": "Cluster0",
  "database": "my_db",
  "api_url": "https://data.mongodb-api.com/app/..."
}
One of
Mongo Data Api · 4 properties
api_keystring

Atlas Data API key. Treat as a secret.

api_urlstring

Base URL of your Atlas Data API endpoint.

data_sourcestring

Name of the Atlas cluster (the Data API "data source").

databasestring
Google Cloud Storage · 2 properties
credentialsobject
required·

Service-account JSON used to authenticate against Google Cloud Storage.

11 properties
auth_provider_x509_cert_urlstring
auth_uristring
client_emailstring
client_idstring
client_x509_cert_urlstring
private_keystring
private_key_idstring
project_idstring
token_uristring
typestring
universe_domainstring
bucketstring
S3 · 5 properties
access_key_idstring
base_urlstring

Optional override for non-AWS S3 endpoints (e.g. R2, MinIO).

bucketstring
regionstring
secret_access_keystring

Secret access key. Treat as a secret.

Qdrant · 4 properties
api_keystring

Qdrant API key. Treat as a secret.

base_urlstring
collectionstring
portinteger
created_atstring · date-time

Timestamp when the datastore record was created.

environment_idstring · uuid

The environment to which this datastore belongs.

idstring · uuid

The unique ID of the datastore.

labelstring

A friendly label for identifying this datastore.

typestring

The datastore's backend type. Determines the shape of config.

Possible values:
mongo_data_apigoogle_cloud_storages3qdrant
updated_atstring · date-time

Timestamp when the datastore record was last updated.

truto datastores update '<id>' \
  -b '{
  "label": "your_label",
  "validation_methods": [
    "listObjects"
  ]
}' \
  -o json
import Truto from '@truto/truto-ts-sdk';

const truto = new Truto({
  token: '<your_api_token>',
});

const body = {
  "label": "your_label",
  "validation_methods": [
    "listObjects"
  ]
};

const result = await truto.datastore.update('<id>', body);

console.log(result);
import asyncio
from truto_python_sdk import TrutoApi

truto_api = TrutoApi(token="<your_api_token>")

async def main():
    body = {
        "label": "your_label",
        "validation_methods": [
            "listObjects"
        ]
    }

    result = await truto_api.datastores.update("<id>", body)
    print(result)

asyncio.run(main())
curl -X PATCH 'https://api.truto.one/datastore/{id}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "label": "your_label",
  "validation_methods": [
    "listObjects"
  ]
}'
const body = {
  "label": "your_label",
  "validation_methods": [
    "listObjects"
  ]
};

const response = await fetch('https://api.truto.one/datastore/{id}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.truto.one/datastore/{id}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "label": "your_label",
    "validation_methods": [
        "listObjects"
    ]
}

response = requests.patch(url, headers=headers, params=params, json=payload)
print(response.json())