Skip to content
POST /datastore

Creates a new datastore record. The environment_id must be one the user has permission to access.

Request Body

configobject

Config object for the datastore connection. Shape depends on type.

One of
Mongo Data Api · 3 properties
api_urlstring

Base URL of the 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). Must be a public https URL without a query string or fragment; a private, loopback or link-local address is refused with a 400. Checked on create, and on update when it changes.

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

The Qdrant instance's URL. Must be a public https URL without a query string or fragment; a private, loopback or link-local address is refused with a 400. Checked on create, and on update when it changes.

collectionstring
portinteger
Azure Blob Storage · 6 properties
account_keystring

Base64 storage account key, used for Shared Key authorization. Required when auth_type is account_key. Treat as a secret.

account_namestring

Storage account name.

auth_typestring

How requests are authorized. The matching secret field is required.

Possible values:
sas_tokenaccount_key
base_urlstring

Optional public https endpoint that replaces https://{account_name}.blob.core.windows.net, for example a sovereign cloud.

containerstring

Blob container name (3-63 lowercase letters, digits and single hyphens).

sas_tokenstring

Shared access signature for the container, with read, write and list permissions. Required when auth_type is sas_token. Treat as a secret.

Postgres · 1 property
connection_stringstring

postgres://user:password@host:port/database connection string with a public host. TLS is required unless the string sets sslmode=disable; other query options are ignored. The password can be pasted as-is or URL-encoded. With TLS, the server's certificate must chain to a public CA; a private CA can't be trusted. Supabase signs with its own CA, so a Supabase connection currently needs sslmode=disable. A connection that is not established within 15 seconds fails. Treat as a secret.

Pinecone · 2 properties
api_keystring

Pinecone API key. Treat as a secret.

index_hoststring

The index host from the Pinecone console, for example https://docs-abc123.svc.aped-4627-b74a.pinecone.io.

Big Query · 3 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
datasetstring

Dataset to write to. The service account needs the BigQuery Data Editor role on it.

project_idstring

Project that holds the dataset. Defaults to the service account's project_id.

Snowflake · 7 properties
accountstring

Account identifier in orgname-account_name form, or a legacy account locator such as xy12345.us-east-2.aws.

databasestring

Default database. Case-sensitive, as returned by SHOW DATABASES.

private_keystring

Unencrypted RSA private key in PEM form, PKCS#8 (-----BEGIN PRIVATE KEY-----) or PKCS#1 (-----BEGIN RSA PRIVATE KEY-----). Treat as a secret.

rolestring

Optional role. Defaults to the user's default role.

schemastring

Default schema. Case-sensitive, as returned by SHOW SCHEMAS.

userstring

Snowflake user that holds the public key (RSA_PUBLIC_KEY).

warehousestring

Warehouse to run statements on. Case-sensitive, as returned by SHOW WAREHOUSES.

environment_idstring · uuid

The environment that owns this datastore. Ignored for API tokens, which create in their own environment. Required for a dashboard session.

idstring · uuid

The datastore ID (optional; if omitted, one is generated).

labelstring

A friendly label for this datastore.

typestring

The datastore type. Determines the shape of config.

Possible values:
google_cloud_storages3qdrantazure_blob_storagepostgrespineconebigquerysnowflake
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 and the per-method results. s3, google_cloud_storage and azure_blob_storage support listObjects and uploadObject (uploadObject writes a small test file); postgres, pinecone, bigquery and snowflake support testConnection. 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:
{
  "access_key_id": "AKIAIOSFODNN7EXAMPLE",
  "region": "us-east-1",
  "bucket": "my-bucket"
}
One of
Mongo Data Api · 3 properties
api_urlstring

Base URL of the 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). Must be a public https URL without a query string or fragment; a private, loopback or link-local address is refused with a 400. Checked on create, and on update when it changes.

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

The Qdrant instance's URL. Must be a public https URL without a query string or fragment; a private, loopback or link-local address is refused with a 400. Checked on create, and on update when it changes.

collectionstring
portinteger
Azure Blob Storage · 6 properties
account_keystring

Base64 storage account key, used for Shared Key authorization. Required when auth_type is account_key. Treat as a secret.

account_namestring

Storage account name.

auth_typestring

How requests are authorized. The matching secret field is required.

Possible values:
sas_tokenaccount_key
base_urlstring

Optional public https endpoint that replaces https://{account_name}.blob.core.windows.net, for example a sovereign cloud.

containerstring

Blob container name (3-63 lowercase letters, digits and single hyphens).

sas_tokenstring

Shared access signature for the container, with read, write and list permissions. Required when auth_type is sas_token. Treat as a secret.

Postgres · 1 property
connection_stringstring

postgres://user:password@host:port/database connection string with a public host. TLS is required unless the string sets sslmode=disable; other query options are ignored. The password can be pasted as-is or URL-encoded. With TLS, the server's certificate must chain to a public CA; a private CA can't be trusted. Supabase signs with its own CA, so a Supabase connection currently needs sslmode=disable. A connection that is not established within 15 seconds fails. Treat as a secret.

Pinecone · 2 properties
api_keystring

Pinecone API key. Treat as a secret.

index_hoststring

The index host from the Pinecone console, for example https://docs-abc123.svc.aped-4627-b74a.pinecone.io.

Big Query · 3 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
datasetstring

Dataset to write to. The service account needs the BigQuery Data Editor role on it.

project_idstring

Project that holds the dataset. Defaults to the service account's project_id.

Snowflake · 7 properties
accountstring

Account identifier in orgname-account_name form, or a legacy account locator such as xy12345.us-east-2.aws.

databasestring

Default database. Case-sensitive, as returned by SHOW DATABASES.

private_keystring

Unencrypted RSA private key in PEM form, PKCS#8 (-----BEGIN PRIVATE KEY-----) or PKCS#1 (-----BEGIN RSA PRIVATE KEY-----). Treat as a secret.

rolestring

Optional role. Defaults to the user's default role.

schemastring

Default schema. Case-sensitive, as returned by SHOW SCHEMAS.

userstring

Snowflake user that holds the public key (RSA_PUBLIC_KEY).

warehousestring

Warehouse to run statements on. Case-sensitive, as returned by SHOW WAREHOUSES.

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. mongo_data_api is a removed type (MongoDB ended the Atlas Data API): a stored datastore of it still lists, reads and deletes, but cannot be created, edited, tested or written to by a sync job run.

Possible values:
mongo_data_apigoogle_cloud_storages3qdrantazure_blob_storagepostgrespineconebigquerysnowflake
updated_atstring · date-time

Timestamp when the datastore record was last updated.

Errors

StatusDescription
400Bad request if environment_id is missing or invalid, type is not one of the listed types, or config does not match the shape for type
403Forbidden if the user does not have access to environment_id
truto datastores create \
  -b '{
  "id": "your_id",
  "type": "google_cloud_storage",
  "label": "your_label",
  "environment_id": "your_environment_id",
  "validation_methods": [
    "listObjects"
  ]
}' \
  -o json
import Truto from '@truto/truto-ts-sdk';

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

const body = {
  "id": "your_id",
  "type": "google_cloud_storage",
  "label": "your_label",
  "environment_id": "your_environment_id",
  "validation_methods": [
    "listObjects"
  ]
};

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": "google_cloud_storage",
        "label": "your_label",
        "environment_id": "your_environment_id",
        "validation_methods": [
            "listObjects"
        ]
    }

    result = await truto_api.datastores.create(body)
    print(result)

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

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": "google_cloud_storage",
    "label": "your_label",
    "environment_id": "your_environment_id",
    "validation_methods": [
        "listObjects"
    ]
}

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