Ana içeriğe geç

Update VectorDB Connection

Endpoint

PUT /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 exist)

Query Parameters

None

Request Body

Same shape as Create: the body must include "_class": "vector-db" and a nested transport object with its own "family" discriminator. If name is blank in the body it falls back to vectorDbName from the path; otherwise the two must match.

To preserve a stored secret, omit it or send it blank. To rotate a secret, send the new plaintext value.

Full JSON Body Example - JDBC transport, preserving the stored password

{
"_class": "vector-db",
"name": "pgvector-primary",
"description": "Primary pgvector store for RAG (updated)",
"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": "",
"pool": {
"minimumIdle": 2,
"maximumPoolSize": 10
}
}
}

Full JSON Body Example - HTTP transport, rotating the apiKey

{
"_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",
"endpoint": "https://xyz.eu-central.aws.cloud.qdrant.io:6333",
"apiVersion": "v1",
"authScheme": "API_KEY_HEADER",
"authHeaderName": "api-key",
"apiKey": "new-rotated-qdrant-key",
"regionCode": "eu-central"
}
}

Request Body Fields

The fields are identical to Create VectorDB Connection. The only behavioral difference is secret handling:

FieldTypeRequiredDefaultDescription
_classstringYes-Connection subtype discriminator — must be "vector-db"
namestringNopath valueConnection name — must match vectorDbName if provided; falls back to the path value when blank
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
distanceMetricenumNovendor defaultCOSINE, EUCLIDEAN, DOT_PRODUCT — filled from dbType when omitted
maxBatchSizeintegerNovendor defaultMaximum upsert/query batch size — filled from dbType when omitted
transportobjectYes-Polymorphic transport sub-document (jdbc / http / redis) — see Create for full transport field tables
transport.password / transport.apiKey / transport.apiSecretstringNo(preserved)Secret fields — a blank/omitted value preserves the currently stored secret (INV-06); a non-blank value rotates it

Notes

  • The connection must already exist; updating a non-existent name returns 400 Bad Request.
  • Changing dbType to a different transport family means the previously stored secret cannot be preserved (family mismatch) — supply the new credentials in full.

Response

Success Response (200 OK)

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

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Vector DB connection (name: pgvector-primary) was not found!"
}

or

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

Error Response (401 Unauthorized)

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

cURL Example

curl -X PUT \
"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 (updated)",
"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": ""
}
}'

Notes and Warnings

  • Blank-secret Preserve (INV-06): Sending a blank or omitted secret (JDBC password, HTTP apiKey/apiSecret, Redis password) keeps the currently stored, encrypted value — the read response already masks these, so you never need to re-send them just to make an unrelated edit.
  • Rotate a Secret: Send the new plaintext value to replace the stored one.
  • Family Change Loses Preservation: If you change dbType to a different transport family, blank-secret preservation does not apply — provide the new credentials in full.
  • Discriminators: Keep "_class": "vector-db" at the top level and the matching transport.family value.
  • Save = encrypt + deploy: A successful update re-encrypts changed secrets and redeploys the connection to the workers.