Ana içeriğe geç

Create VectorDB Connection

Endpoint

POST /apiops/projects/{projectName}/vector-dbs/{vectorDbName}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
vectorDbNamestringYesVector DB connection name (must equal name in the body)

Query Parameters

None

Request Body

The body is a ConnectionConfig of subtype vector-db, so it must include "_class": "vector-db" at the top level. The connection details live in the nested transport object, whose own "family" discriminator (jdbc / http / redis) is selected by dbType.

Full JSON Body Example - JDBC transport (pgvector)

{
"_class": "vector-db",
"name": "pgvector-primary",
"description": "Primary pgvector store for RAG",
"enabled": true,
"dbType": "PGVECTOR",
"defaultCollectionName": "documents",
"embeddingDimension": 1536,
"distanceMetric": "COSINE",
"maxBatchSize": 100,
"transport": {
"family": "jdbc",
"connectTimeoutMs": 5000,
"requestTimeoutMs": 30000,
"jdbcUrl": "jdbc:postgresql://db.internal:5432/vectors",
"username": "apinizer",
"password": "s3cr3t-db-pass",
"pool": {
"minimumIdle": 2,
"maximumPoolSize": 5,
"connectionTimeoutMs": 30000,
"idleTimeoutMs": 600000,
"maxLifetimeMs": 1800000
}
}
}

Full JSON Body Example - HTTP transport (Qdrant / Pinecone / Weaviate / Milvus / Chroma)

{
"_class": "vector-db",
"name": "qdrant-cloud",
"description": "Qdrant Cloud cluster",
"enabled": true,
"dbType": "QDRANT",
"defaultCollectionName": "documents",
"embeddingDimension": 1536,
"distanceMetric": "COSINE",
"maxBatchSize": 100,
"transport": {
"family": "http",
"connectTimeoutMs": 5000,
"requestTimeoutMs": 30000,
"endpoint": "https://xyz.eu-central.aws.cloud.qdrant.io:6333",
"apiVersion": "v1",
"authScheme": "API_KEY_HEADER",
"authHeaderName": "api-key",
"apiKey": "qdrant-api-key-value",
"regionCode": "eu-central"
}
}

Full JSON Body Example - Redis transport (RediSearch)

{
"_class": "vector-db",
"name": "redis-search",
"description": "RediSearch vector index",
"enabled": true,
"dbType": "REDIS",
"defaultCollectionName": "doc_idx",
"embeddingDimension": 1536,
"distanceMetric": "COSINE",
"maxBatchSize": 100,
"transport": {
"family": "redis",
"connectTimeoutMs": 5000,
"requestTimeoutMs": 30000,
"uri": "rediss://redis.internal:6379",
"username": "default",
"password": "redis-auth-pass"
}
}

Request Body Fields

FieldTypeRequiredDefaultDescription
_classstringYes-Connection subtype discriminator — must be "vector-db"
namestringYes-Connection name — must match vectorDbName in the path
descriptionstringNo-Free-text description
enabledbooleanNotrueWhether the connection is enabled
dbTypeenumYes-Vector store type: PGVECTOR, QDRANT, WEAVIATE, MILVUS, CHROMA, PINECONE, REDIS, OTHER
defaultCollectionNamestringNo-Default collection / index / table name
embeddingDimensionintegerNo-Embedding vector dimension (e.g. 1536)
distanceMetricenumNovendor defaultDistance metric: COSINE, EUCLIDEAN, DOT_PRODUCT. Filled from dbType when omitted
maxBatchSizeintegerNovendor defaultMaximum upsert/query batch size. Filled from dbType when omitted
transportobjectYes-Polymorphic transport sub-document (see below)
transport (family jdbc) — pgvector
FieldTypeRequiredDescription
familystringYesTransport discriminator — "jdbc"
connectTimeoutMsintegerNoConnect timeout (ms). null → vendor client default
requestTimeoutMsintegerNoRequest timeout (ms). null → vendor client default
jdbcUrlstringYesJDBC URL, e.g. jdbc:postgresql://host:port/db
usernamestringNoDatabase username
passwordstringNoDatabase password (secret — masked on read; blank on update preserves the stored value)
poolobjectNoHikariCP pool settings (all fields nullable → HikariCP defaults)
pool.minimumIdleintegerNoMinimum idle connections
pool.maximumPoolSizeintegerNoMaximum pool size
pool.connectionTimeoutMsintegerNoConnection acquisition timeout (ms)
pool.idleTimeoutMsintegerNoIdle connection timeout (ms)
pool.maxLifetimeMsintegerNoMaximum connection lifetime (ms)
transport (family http) — Qdrant / Pinecone / Weaviate / Milvus / Chroma
FieldTypeRequiredDescription
familystringYesTransport discriminator — "http"
connectTimeoutMsintegerNoConnect timeout (ms)
requestTimeoutMsintegerNoRequest timeout (ms)
endpointstringYesREST endpoint URL
apiVersionstringNoVendor API version
authSchemeenumNoAuth scheme: BEARER, API_KEY_HEADER, BASIC, NONE, CUSTOM
authHeaderNamestringNoHeader name for API-key auth (used with API_KEY_HEADER)
apiKeystringNoAPI key (secret — masked on read; blank on update preserves the stored value)
apiSecretstringNoAPI secret (secret — masked on read; blank on update preserves the stored value)
regionCodestringNoVendor region code (e.g. Pinecone)
transport (family redis) — RediSearch
FieldTypeRequiredDescription
familystringYesTransport discriminator — "redis"
connectTimeoutMsintegerNoConnect timeout (ms)
requestTimeoutMsintegerNoCommand timeout (ms)
uristringYesRedis URI (redis:// / rediss://; bare host:port also accepted)
usernamestringNoRedis ACL username (Redis 6+)
passwordstringNoRedis AUTH password (secret — masked on read; blank on update preserves the stored value)

Notes

  • vectorDbName in the path must equal name in the body (case-insensitive), otherwise 400 Bad Request is returned.
  • Sending a name that already exists in the project updates that connection in place (upsert); a new name creates a new connection.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"deploymentResult": {
"success": true
}
}

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Vector DB connection name in path (pgvector-primary) does not match name in body (pgvector-2)!"
}

or

{
"status": "FAILURE",
"resultMessage": "Vector DB connection body can not be empty!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/vector-dbs/pgvector-primary/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"_class": "vector-db",
"name": "pgvector-primary",
"description": "Primary pgvector store for RAG",
"enabled": true,
"dbType": "PGVECTOR",
"defaultCollectionName": "documents",
"embeddingDimension": 1536,
"distanceMetric": "COSINE",
"maxBatchSize": 100,
"transport": {
"family": "jdbc",
"jdbcUrl": "jdbc:postgresql://db.internal:5432/vectors",
"username": "apinizer",
"password": "s3cr3t-db-pass"
}
}'

Notes and Warnings

  • Upsert: POST /{vectorDbName}/ creates the connection, or updates it in place if the name already exists in the project.
  • Discriminators: The body must carry "_class": "vector-db" at the top level, and the nested transport must carry its own "family" discriminator matching the dbType family (jdbc for pgvector, http for Qdrant/Pinecone/Weaviate/Milvus/Chroma, redis for RediSearch).
  • Secrets: Secret fields (JDBC password, HTTP apiKey/apiSecret, Redis password) are encrypted server-side on save and returned masked on read.
  • Save = encrypt + deploy: A successful save encrypts @SecretData fields and pushes the connection to the workers.
  • Data-plane Defaults: distanceMetric and maxBatchSize are auto-filled from dbType when omitted (existing user values are preserved).