Create VectorDB Connection
Endpoint
POST /apiops/projects/{projectName}/vector-dbs/{vectorDbName}/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| vectorDbName | string | Yes | Vector 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
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| _class | string | Yes | - | Connection subtype discriminator — must be "vector-db" |
| name | string | Yes | - | Connection name — must match vectorDbName in the path |
| description | string | No | - | Free-text description |
| enabled | boolean | No | true | Whether the connection is enabled |
| dbType | enum | Yes | - | Vector store type: PGVECTOR, QDRANT, WEAVIATE, MILVUS, CHROMA, PINECONE, REDIS, OTHER |
| defaultCollectionName | string | No | - | Default collection / index / table name |
| embeddingDimension | integer | No | - | Embedding vector dimension (e.g. 1536) |
| distanceMetric | enum | No | vendor default | Distance metric: COSINE, EUCLIDEAN, DOT_PRODUCT. Filled from dbType when omitted |
| maxBatchSize | integer | No | vendor default | Maximum upsert/query batch size. Filled from dbType when omitted |
| transport | object | Yes | - | Polymorphic transport sub-document (see below) |
transport (family jdbc) — pgvector
| Field | Type | Required | Description |
|---|---|---|---|
| family | string | Yes | Transport discriminator — "jdbc" |
| connectTimeoutMs | integer | No | Connect timeout (ms). null → vendor client default |
| requestTimeoutMs | integer | No | Request timeout (ms). null → vendor client default |
| jdbcUrl | string | Yes | JDBC URL, e.g. jdbc:postgresql://host:port/db |
| username | string | No | Database username |
| password | string | No | Database password (secret — masked on read; blank on update preserves the stored value) |
| pool | object | No | HikariCP pool settings (all fields nullable → HikariCP defaults) |
| pool.minimumIdle | integer | No | Minimum idle connections |
| pool.maximumPoolSize | integer | No | Maximum pool size |
| pool.connectionTimeoutMs | integer | No | Connection acquisition timeout (ms) |
| pool.idleTimeoutMs | integer | No | Idle connection timeout (ms) |
| pool.maxLifetimeMs | integer | No | Maximum connection lifetime (ms) |
transport (family http) — Qdrant / Pinecone / Weaviate / Milvus / Chroma
| Field | Type | Required | Description |
|---|---|---|---|
| family | string | Yes | Transport discriminator — "http" |
| connectTimeoutMs | integer | No | Connect timeout (ms) |
| requestTimeoutMs | integer | No | Request timeout (ms) |
| endpoint | string | Yes | REST endpoint URL |
| apiVersion | string | No | Vendor API version |
| authScheme | enum | No | Auth scheme: BEARER, API_KEY_HEADER, BASIC, NONE, CUSTOM |
| authHeaderName | string | No | Header name for API-key auth (used with API_KEY_HEADER) |
| apiKey | string | No | API key (secret — masked on read; blank on update preserves the stored value) |
| apiSecret | string | No | API secret (secret — masked on read; blank on update preserves the stored value) |
| regionCode | string | No | Vendor region code (e.g. Pinecone) |
transport (family redis) — RediSearch
| Field | Type | Required | Description |
|---|---|---|---|
| family | string | Yes | Transport discriminator — "redis" |
| connectTimeoutMs | integer | No | Connect timeout (ms) |
| requestTimeoutMs | integer | No | Command timeout (ms) |
| uri | string | Yes | Redis URI (redis:// / rediss://; bare host:port also accepted) |
| username | string | No | Redis ACL username (Redis 6+) |
| password | string | No | Redis AUTH password (secret — masked on read; blank on update preserves the stored value) |
Notes
vectorDbNamein the path must equalnamein the body (case-insensitive), otherwise400 Bad Requestis returned.- Sending a
namethat 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 nestedtransportmust carry its own"family"discriminator matching thedbTypefamily (jdbcfor pgvector,httpfor Qdrant/Pinecone/Weaviate/Milvus/Chroma,redisfor RediSearch). - Secrets: Secret fields (JDBC
password, HTTPapiKey/apiSecret, Redispassword) are encrypted server-side on save and returned masked on read. - Save = encrypt + deploy: A successful save encrypts
@SecretDatafields and pushes the connection to the workers. - Data-plane Defaults:
distanceMetricandmaxBatchSizeare auto-filled fromdbTypewhen omitted (existing user values are preserved).
Related Documentation
- Update VectorDB Connection - Update an existing connection (blank-secret preserve)
- Test VectorDB Connection - Validate connectivity before saving
- VectorDB Connections API - Resource overview
- AI Gateway API - Full AI Gateway APIops surface