Create a datastore
/datastore
Request Body
Config object for the datastore connection. Shape depends on type.
Mongo Data Api · 4 properties
Atlas Data API key. Treat as a secret.
Base URL of your Atlas Data API endpoint.
Name of the Atlas cluster (the Data API "data source").
Google Cloud Storage · 2 properties
Service-account JSON used to authenticate against Google Cloud Storage.
11 properties
S3 · 5 properties
Optional override for non-AWS S3 endpoints (e.g. R2, MinIO).
Secret access key. Treat as a secret.
Qdrant · 4 properties
Qdrant API key. Treat as a secret.
Optional secret value for sensitive credentials.
The environment that owns this datastore. If omitted, defaults to the user's first environment; required when the user has multiple environments.
The datastore ID (optional; if omitted, one is generated).
A friendly label for this datastore.
The datastore type. Determines the shape of config.
mongo_data_apigoogle_cloud_storages3qdrant
Optional list of integration methods (e.g. unified_api/resource/method) used to validate the datastore configuration before persisting.
Response Body
Config object for the datastore connection (minus sensitive fields). The shape depends on type.
{"base_url":"https://data.mongodb-api.com/app/...","database":"my_db"}Mongo Data Api · 4 properties
Atlas Data API key. Treat as a secret.
Base URL of your Atlas Data API endpoint.
Name of the Atlas cluster (the Data API "data source").
Google Cloud Storage · 2 properties
Service-account JSON used to authenticate against Google Cloud Storage.
11 properties
S3 · 5 properties
Optional override for non-AWS S3 endpoints (e.g. R2, MinIO).
Secret access key. Treat as a secret.
Qdrant · 4 properties
Qdrant API key. Treat as a secret.
Timestamp when the datastore record was created.
The environment to which this datastore belongs.
The unique ID of the datastore.
A friendly label for identifying this datastore.
The datastore's backend type. Determines the shape of config.
mongo_data_apigoogle_cloud_storages3qdrant
Timestamp when the datastore record was last updated.
curl -X POST 'https://api.truto.one/datastore' \
-H 'Authorization: Bearer <your_api_token>' \
-H 'Content-Type: application/json' \
-d '{
"id": "your_id",
"type": "mongo_data_api",
"label": "your_label",
"config_secret": "your_config_secret",
"environment_id": "your_environment_id",
"validation_methods": []
}'const body = {
"id": "your_id",
"type": "mongo_data_api",
"label": "your_label",
"config_secret": "your_config_secret",
"environment_id": "your_environment_id",
"validation_methods": []
};
const response = await fetch('https://api.truto.one/datastore', {
method: 'POST',
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"
headers = {
"Authorization": "Bearer <your_api_token>",
"Content-Type": "application/json",
}
params = {
}
payload = {
"id": "your_id",
"type": "mongo_data_api",
"label": "your_label",
"config_secret": "your_config_secret",
"environment_id": "your_environment_id",
"validation_methods": []
}
response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())import Truto from '@truto/truto-ts-sdk';
const truto = new Truto({
token: '<your_api_token>',
});
const body = {
"id": "your_id",
"type": "mongo_data_api",
"label": "your_label",
"config_secret": "your_config_secret",
"environment_id": "your_environment_id",
"validation_methods": []
};
const result = await truto.datastore.create(body);
console.log(result);import asyncio
from truto_python_sdk import TrutoApi
truto_api = TrutoApi(token="<your_api_token>")
async def main():
body = {
"id": "your_id",
"type": "mongo_data_api",
"label": "your_label",
"config_secret": "your_config_secret",
"environment_id": "your_environment_id",
"validation_methods": []
}
result = await truto_api.datastores.create(body)
print(result)
asyncio.run(main())