Skip to main content
POST
/
v2
/
workspace
/
apikeyconfig
/
update
Update API Key Config
curl --request POST \
  --url https://api.velt.dev/v2/workspace/apikeyconfig/update \
  --header 'Content-Type: application/json' \
  --header 'x-velt-api-key: <x-velt-api-key>' \
  --header 'x-velt-auth-token: <x-velt-auth-token>' \
  --data '
{
  "data": {
    "enablePrivateComments": true,
    "requireJwtToken": true,
    "requireAutoOrgUser": true,
    "defaultDocumentAccessType": "<string>",
    "aiModelApiKey": [
      {
        "provider": "<string>",
        "customerApiKey": "<string>"
      }
    ]
  }
}
'
{
  "result": {
    "status": "success",
    "message": "API key configuration updated successfully.",
    "data": {
      "requireJwtToken": true,
      "defaultDocumentAccessType": "restricted",
      "aiModelsConfig": {
        "openai": { "displayText": "sk-open...xxxxxxxxxxxxxxxxxxxxxxx" },
        "anthropic": { "displayText": "sk-ant-...xxxxxxxxxxxxxxxxxxxxx" },
        "gemini": { "displayText": "AIza...xxxxxxxxxxxxxxxxxxxxxxxxx" }
      }
    }
  }
}
Use this API to update the app configuration for a workspace API key. Every field is optional, but at least one must be provided. Unknown fields are rejected. All writes are field-merge only — no fields are removed.
This endpoint uses API-key-level auth: pass x-velt-api-key and x-velt-auth-token as headers. You can obtain these from the Get Auth Tokens endpoint.

Endpoint

POST https://api.velt.dev/v2/workspace/apikeyconfig/update

Headers

x-velt-api-key
string
required
Your API key.
x-velt-auth-token
string
required

Body

Params

data
object
required
At least one of the following fields must be provided.

Example Request

{
  "data": {
    "requireJwtToken": true,
    "defaultDocumentAccessType": "restricted",
    "aiModelApiKey": [
      { "provider": "openai", "customerApiKey": "sk-openai-..." },
      { "provider": "anthropic", "customerApiKey": "sk-ant-..." },
      { "provider": "gemini", "customerApiKey": "AIza..." }
    ]
  }
}

Example Response

Success Response

{
  "result": {
    "status": "success",
    "message": "API key configuration updated successfully.",
    "data": {
      "requireJwtToken": true,
      "defaultDocumentAccessType": "restricted",
      "aiModelsConfig": {
        "openai": { "displayText": "sk-open...xxxxxxxxxxxxxxxxxxxxxxx" },
        "anthropic": { "displayText": "sk-ant-...xxxxxxxxxxxxxxxxxxxxx" },
        "gemini": { "displayText": "AIza...xxxxxxxxxxxxxxxxxxxxxxxxx" }
      }
    }
  }
}
The response echoes the post-write values for the fields you provided. For aiModelApiKey, the keys come back masked under aiModelsConfig as a map of provider -> { displayText } (the same shape as Get API Key Config) — the raw key value is never returned. When enablePrivateComments is the only field and its value already matches the current value, the write is skipped internally and the response is simply { "enablePrivateComments": <value> }.

Failure Response

If no field is provided, or an unknown field is sent
{
  "error": {
    "status": "INVALID_ARGUMENT",
    "message": "At least one field must be provided for update"
  }
}
{
  "result": {
    "status": "success",
    "message": "API key configuration updated successfully.",
    "data": {
      "requireJwtToken": true,
      "defaultDocumentAccessType": "restricted",
      "aiModelsConfig": {
        "openai": { "displayText": "sk-open...xxxxxxxxxxxxxxxxxxxxxxx" },
        "anthropic": { "displayText": "sk-ant-...xxxxxxxxxxxxxxxxxxxxx" },
        "gemini": { "displayText": "AIza...xxxxxxxxxxxxxxxxxxxxxxxxx" }
      }
    }
  }
}