> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.lumenia.net/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.lumenia.net/_mcp/server.

# Update workspace

PATCH https://app.lumenia.net/api/v1/workspaces/{workspaceId}
Content-Type: application/json

Update selected workspace fields.

Reference: https://docs.lumenia.net/api-reference/workspaces/update-workspace

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <API_KEY>`, where `API_KEY` is your API key.

## Request

### Path parameters

- `workspaceId` (string, required) — Workspace to update.

### Headers

- `X-Account-Id` (string, required) — Account that owns the workspace.

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — New name shown to users.
- `chat` (V1WorkspacesWorkspaceIdPatchRequestBodyContentApplicationJsonSchemaChat, optional) — Conversation settings to update.
- `knowledgeSearch` (V1WorkspacesWorkspaceIdPatchRequestBodyContentApplicationJsonSchemaKnowledgeSearch, optional) — Knowledge search settings to update.
- `branding` (V1WorkspacesWorkspaceIdPatchRequestBodyContentApplicationJsonSchemaBranding, optional) — Chat-widget appearance (partial).

## Response

### 200

The updated workspace and its configuration.

## Errors

### 400 Bad Request Error

No updatable fields provided, or the update could not be applied

- `any`

### 403 Forbidden Error

The API key is missing or invalid, or the X-Account-Id does not belong to the partner.

- `message` (string, optional)

### 404 Not Found Error

Workspace not found for this account

- `any`

### 500 Internal Server Error

Internal Server Error

- `any`

## Types

### V1WorkspacesWorkspaceIdPatchRequestBodyContentApplicationJsonSchemaChat

Conversation settings to update.

- `mode` (enum, optional) — Response mode. chat allows general-knowledge answers when no relevant context is found; query restricts answers to the embedded documents.
  - Allowed values: `chat`, `query`
- `prompt` (string, optional, nullable) — Base system prompt for chat and knowledge-base responses. A pinned prompt template takes precedence.
- `historyLimit` (integer, optional) — Number of previous messages kept as conversation context.
- `temperature` (double, optional, nullable) — LLM sampling temperature. null resets to the provider default.

### V1WorkspacesWorkspaceIdPatchRequestBodyContentApplicationJsonSchemaKnowledgeSearch

Knowledge search settings to update.

- `topResults` (integer, optional) — Maximum number of document chunks retrieved per query.
- `similarityThreshold` (double, optional) — Minimum vector similarity (0 to 1) a chunk must meet to be included.
- `queryRefusalMessage` (string, optional, nullable) — Message returned in query mode when no relevant context is found.
- `searchMode` (enum, optional) — Retrieval strategy. Available only when reranking is supported.
  - Allowed values: `default`, `rerank`

### V1WorkspacesWorkspaceIdPatchRequestBodyContentApplicationJsonSchemaBranding

Chat-widget appearance (partial).

- `background` (string, optional) — Background color as a hex string.
- `foreground` (string, optional) — Foreground/text color as a hex string.

## Examples

### Rename the workspace

**Request**

```json
{
  "name": "Support (EU)"
}
```

**Response**

```json
{
  "workspace": {
    "branding": {
      "background": "#ffd940",
      "foreground": "#1a1a1a",
      "logo": null
    },
    "chat": {
      "historyLimit": 20,
      "mode": "chat",
      "prompt": "Answer only from the provided context.",
      "temperature": 0.7
    },
    "counts": {
      "attachedTools": 0,
      "embeddedDocuments": 0
    },
    "createdAt": "2026-06-15T05:24:00.000Z",
    "id": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "knowledgeSearch": {
      "queryRefusalMessage": "There is no relevant information in this workspace to answer your query.",
      "similarityThreshold": 0.25,
      "topResults": 4
    },
    "name": "New workspace name",
    "organizationId": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
    "telegram": {
      "connected": false
    },
    "voice": {
      "connected": false
    },
    "whatsapp": {
      "connected": false
    }
  }
}
```

**SDK Code**

```python Rename the workspace
import requests

url = "https://app.lumenia.net/api/v1/workspaces/workspaceId"

payload = { "name": "Support (EU)" }
headers = {
    "X-Account-Id": "X-Account-Id",
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Rename the workspace
const url = 'https://app.lumenia.net/api/v1/workspaces/workspaceId';
const options = {
  method: 'PATCH',
  headers: {
    'X-Account-Id': 'X-Account-Id',
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"Support (EU)"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Rename the workspace
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/workspaces/workspaceId"

	payload := strings.NewReader("{\n  \"name\": \"Support (EU)\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Account-Id", "X-Account-Id")
	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Rename the workspace
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/workspaces/workspaceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Account-Id"] = 'X-Account-Id'
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Support (EU)\"\n}"

response = http.request(request)
puts response.read_body
```

```java Rename the workspace
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/workspaces/workspaceId")
  .header("X-Account-Id", "X-Account-Id")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Support (EU)\"\n}")
  .asString();
```

```php Rename the workspace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/workspaces/workspaceId', [
  'body' => '{
  "name": "Support (EU)"
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
    'X-Account-Id' => 'X-Account-Id',
  ],
]);

echo $response->getBody();
```

```csharp Rename the workspace
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/workspaces/workspaceId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Account-Id", "X-Account-Id");
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Support (EU)\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rename the workspace
import Foundation

let headers = [
  "X-Account-Id": "X-Account-Id",
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = ["name": "Support (EU)"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/workspaces/workspaceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Change only the base system prompt

**Request**

```json
{
  "chat": {
    "prompt": "Answer only from the provided context. If the context does not contain the answer, say so."
  }
}
```

**Response**

```json
{
  "workspace": {
    "branding": {
      "background": "#ffd940",
      "foreground": "#1a1a1a",
      "logo": null
    },
    "chat": {
      "historyLimit": 20,
      "mode": "chat",
      "prompt": "Answer only from the provided context.",
      "temperature": 0.7
    },
    "counts": {
      "attachedTools": 0,
      "embeddedDocuments": 0
    },
    "createdAt": "2026-06-15T05:24:00.000Z",
    "id": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "knowledgeSearch": {
      "queryRefusalMessage": "There is no relevant information in this workspace to answer your query.",
      "similarityThreshold": 0.25,
      "topResults": 4
    },
    "name": "New workspace name",
    "organizationId": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
    "telegram": {
      "connected": false
    },
    "voice": {
      "connected": false
    },
    "whatsapp": {
      "connected": false
    }
  }
}
```

**SDK Code**

```python Change only the base system prompt
import requests

url = "https://app.lumenia.net/api/v1/workspaces/workspaceId"

payload = { "chat": { "prompt": "Answer only from the provided context. If the context does not contain the answer, say so." } }
headers = {
    "X-Account-Id": "X-Account-Id",
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Change only the base system prompt
const url = 'https://app.lumenia.net/api/v1/workspaces/workspaceId';
const options = {
  method: 'PATCH',
  headers: {
    'X-Account-Id': 'X-Account-Id',
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: '{"chat":{"prompt":"Answer only from the provided context. If the context does not contain the answer, say so."}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Change only the base system prompt
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/workspaces/workspaceId"

	payload := strings.NewReader("{\n  \"chat\": {\n    \"prompt\": \"Answer only from the provided context. If the context does not contain the answer, say so.\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Account-Id", "X-Account-Id")
	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Change only the base system prompt
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/workspaces/workspaceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Account-Id"] = 'X-Account-Id'
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"chat\": {\n    \"prompt\": \"Answer only from the provided context. If the context does not contain the answer, say so.\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Change only the base system prompt
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/workspaces/workspaceId")
  .header("X-Account-Id", "X-Account-Id")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"chat\": {\n    \"prompt\": \"Answer only from the provided context. If the context does not contain the answer, say so.\"\n  }\n}")
  .asString();
```

```php Change only the base system prompt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/workspaces/workspaceId', [
  'body' => '{
  "chat": {
    "prompt": "Answer only from the provided context. If the context does not contain the answer, say so."
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
    'X-Account-Id' => 'X-Account-Id',
  ],
]);

echo $response->getBody();
```

```csharp Change only the base system prompt
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/workspaces/workspaceId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Account-Id", "X-Account-Id");
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"chat\": {\n    \"prompt\": \"Answer only from the provided context. If the context does not contain the answer, say so.\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change only the base system prompt
import Foundation

let headers = [
  "X-Account-Id": "X-Account-Id",
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = ["chat": ["prompt": "Answer only from the provided context. If the context does not contain the answer, say so."]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/workspaces/workspaceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Tune retrieval only (more results, stricter threshold, custom refusal)

**Request**

```json
{
  "knowledgeSearch": {
    "topResults": 6,
    "similarityThreshold": 0.35,
    "queryRefusalMessage": "Sorry, I could not find that in our knowledge base."
  }
}
```

**Response**

```json
{
  "workspace": {
    "branding": {
      "background": "#ffd940",
      "foreground": "#1a1a1a",
      "logo": null
    },
    "chat": {
      "historyLimit": 20,
      "mode": "chat",
      "prompt": "Answer only from the provided context.",
      "temperature": 0.7
    },
    "counts": {
      "attachedTools": 0,
      "embeddedDocuments": 0
    },
    "createdAt": "2026-06-15T05:24:00.000Z",
    "id": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "knowledgeSearch": {
      "queryRefusalMessage": "There is no relevant information in this workspace to answer your query.",
      "similarityThreshold": 0.25,
      "topResults": 4
    },
    "name": "New workspace name",
    "organizationId": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
    "telegram": {
      "connected": false
    },
    "voice": {
      "connected": false
    },
    "whatsapp": {
      "connected": false
    }
  }
}
```

**SDK Code**

```python Tune retrieval only (more results, stricter threshold, custom refusal)
import requests

url = "https://app.lumenia.net/api/v1/workspaces/workspaceId"

payload = { "knowledgeSearch": {
        "topResults": 6,
        "similarityThreshold": 0.35,
        "queryRefusalMessage": "Sorry, I could not find that in our knowledge base."
    } }
headers = {
    "X-Account-Id": "X-Account-Id",
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Tune retrieval only (more results, stricter threshold, custom refusal)
const url = 'https://app.lumenia.net/api/v1/workspaces/workspaceId';
const options = {
  method: 'PATCH',
  headers: {
    'X-Account-Id': 'X-Account-Id',
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: '{"knowledgeSearch":{"topResults":6,"similarityThreshold":0.35,"queryRefusalMessage":"Sorry, I could not find that in our knowledge base."}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Tune retrieval only (more results, stricter threshold, custom refusal)
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/workspaces/workspaceId"

	payload := strings.NewReader("{\n  \"knowledgeSearch\": {\n    \"topResults\": 6,\n    \"similarityThreshold\": 0.35,\n    \"queryRefusalMessage\": \"Sorry, I could not find that in our knowledge base.\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Account-Id", "X-Account-Id")
	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Tune retrieval only (more results, stricter threshold, custom refusal)
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/workspaces/workspaceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Account-Id"] = 'X-Account-Id'
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"knowledgeSearch\": {\n    \"topResults\": 6,\n    \"similarityThreshold\": 0.35,\n    \"queryRefusalMessage\": \"Sorry, I could not find that in our knowledge base.\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Tune retrieval only (more results, stricter threshold, custom refusal)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/workspaces/workspaceId")
  .header("X-Account-Id", "X-Account-Id")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"knowledgeSearch\": {\n    \"topResults\": 6,\n    \"similarityThreshold\": 0.35,\n    \"queryRefusalMessage\": \"Sorry, I could not find that in our knowledge base.\"\n  }\n}")
  .asString();
```

```php Tune retrieval only (more results, stricter threshold, custom refusal)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/workspaces/workspaceId', [
  'body' => '{
  "knowledgeSearch": {
    "topResults": 6,
    "similarityThreshold": 0.35,
    "queryRefusalMessage": "Sorry, I could not find that in our knowledge base."
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
    'X-Account-Id' => 'X-Account-Id',
  ],
]);

echo $response->getBody();
```

```csharp Tune retrieval only (more results, stricter threshold, custom refusal)
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/workspaces/workspaceId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Account-Id", "X-Account-Id");
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"knowledgeSearch\": {\n    \"topResults\": 6,\n    \"similarityThreshold\": 0.35,\n    \"queryRefusalMessage\": \"Sorry, I could not find that in our knowledge base.\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Tune retrieval only (more results, stricter threshold, custom refusal)
import Foundation

let headers = [
  "X-Account-Id": "X-Account-Id",
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = ["knowledgeSearch": [
    "topResults": 6,
    "similarityThreshold": 0.35,
    "queryRefusalMessage": "Sorry, I could not find that in our knowledge base."
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/workspaces/workspaceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update the chat-widget colors only

**Request**

```json
{
  "branding": {
    "background": "#0f172a",
    "foreground": "#f8fafc"
  }
}
```

**Response**

```json
{
  "workspace": {
    "branding": {
      "background": "#ffd940",
      "foreground": "#1a1a1a",
      "logo": null
    },
    "chat": {
      "historyLimit": 20,
      "mode": "chat",
      "prompt": "Answer only from the provided context.",
      "temperature": 0.7
    },
    "counts": {
      "attachedTools": 0,
      "embeddedDocuments": 0
    },
    "createdAt": "2026-06-15T05:24:00.000Z",
    "id": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "knowledgeSearch": {
      "queryRefusalMessage": "There is no relevant information in this workspace to answer your query.",
      "similarityThreshold": 0.25,
      "topResults": 4
    },
    "name": "New workspace name",
    "organizationId": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
    "telegram": {
      "connected": false
    },
    "voice": {
      "connected": false
    },
    "whatsapp": {
      "connected": false
    }
  }
}
```

**SDK Code**

```python Update the chat-widget colors only
import requests

url = "https://app.lumenia.net/api/v1/workspaces/workspaceId"

payload = { "branding": {
        "background": "#0f172a",
        "foreground": "#f8fafc"
    } }
headers = {
    "X-Account-Id": "X-Account-Id",
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update the chat-widget colors only
const url = 'https://app.lumenia.net/api/v1/workspaces/workspaceId';
const options = {
  method: 'PATCH',
  headers: {
    'X-Account-Id': 'X-Account-Id',
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: '{"branding":{"background":"#0f172a","foreground":"#f8fafc"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update the chat-widget colors only
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/workspaces/workspaceId"

	payload := strings.NewReader("{\n  \"branding\": {\n    \"background\": \"#0f172a\",\n    \"foreground\": \"#f8fafc\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Account-Id", "X-Account-Id")
	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update the chat-widget colors only
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/workspaces/workspaceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Account-Id"] = 'X-Account-Id'
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"branding\": {\n    \"background\": \"#0f172a\",\n    \"foreground\": \"#f8fafc\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Update the chat-widget colors only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/workspaces/workspaceId")
  .header("X-Account-Id", "X-Account-Id")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"branding\": {\n    \"background\": \"#0f172a\",\n    \"foreground\": \"#f8fafc\"\n  }\n}")
  .asString();
```

```php Update the chat-widget colors only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/workspaces/workspaceId', [
  'body' => '{
  "branding": {
    "background": "#0f172a",
    "foreground": "#f8fafc"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
    'X-Account-Id' => 'X-Account-Id',
  ],
]);

echo $response->getBody();
```

```csharp Update the chat-widget colors only
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/workspaces/workspaceId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Account-Id", "X-Account-Id");
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"branding\": {\n    \"background\": \"#0f172a\",\n    \"foreground\": \"#f8fafc\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update the chat-widget colors only
import Foundation

let headers = [
  "X-Account-Id": "X-Account-Id",
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = ["branding": [
    "background": "#0f172a",
    "foreground": "#f8fafc"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/workspaces/workspaceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Update name, chat, knowledgeSearch and branding together

**Request**

```json
{
  "name": "New workspace name",
  "chat": {
    "mode": "chat",
    "prompt": "Answer only from the provided context.",
    "historyLimit": 20,
    "temperature": 0.7
  },
  "knowledgeSearch": {
    "topResults": 4,
    "similarityThreshold": 0.25,
    "queryRefusalMessage": "There is no relevant information in this workspace to answer your query."
  },
  "branding": {
    "background": "#ffd940",
    "foreground": "#1a1a1a"
  }
}
```

**Response**

```json
{
  "workspace": {
    "branding": {
      "background": "#ffd940",
      "foreground": "#1a1a1a",
      "logo": null
    },
    "chat": {
      "historyLimit": 20,
      "mode": "chat",
      "prompt": "Answer only from the provided context.",
      "temperature": 0.7
    },
    "counts": {
      "attachedTools": 0,
      "embeddedDocuments": 0
    },
    "createdAt": "2026-06-15T05:24:00.000Z",
    "id": "9b8a7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "knowledgeSearch": {
      "queryRefusalMessage": "There is no relevant information in this workspace to answer your query.",
      "similarityThreshold": 0.25,
      "topResults": 4
    },
    "name": "New workspace name",
    "organizationId": "3f2e1d0c-9b8a-4c7d-8e6f-5a4b3c2d1e0f",
    "telegram": {
      "connected": false
    },
    "voice": {
      "connected": false
    },
    "whatsapp": {
      "connected": false
    }
  }
}
```

**SDK Code**

```python Update name, chat, knowledgeSearch and branding together
import requests

url = "https://app.lumenia.net/api/v1/workspaces/workspaceId"

payload = {
    "name": "New workspace name",
    "chat": {
        "mode": "chat",
        "prompt": "Answer only from the provided context.",
        "historyLimit": 20,
        "temperature": 0.7
    },
    "knowledgeSearch": {
        "topResults": 4,
        "similarityThreshold": 0.25,
        "queryRefusalMessage": "There is no relevant information in this workspace to answer your query."
    },
    "branding": {
        "background": "#ffd940",
        "foreground": "#1a1a1a"
    }
}
headers = {
    "X-Account-Id": "X-Account-Id",
    "Authorization": "Bearer <API_KEY>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Update name, chat, knowledgeSearch and branding together
const url = 'https://app.lumenia.net/api/v1/workspaces/workspaceId';
const options = {
  method: 'PATCH',
  headers: {
    'X-Account-Id': 'X-Account-Id',
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: '{"name":"New workspace name","chat":{"mode":"chat","prompt":"Answer only from the provided context.","historyLimit":20,"temperature":0.7},"knowledgeSearch":{"topResults":4,"similarityThreshold":0.25,"queryRefusalMessage":"There is no relevant information in this workspace to answer your query."},"branding":{"background":"#ffd940","foreground":"#1a1a1a"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Update name, chat, knowledgeSearch and branding together
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://app.lumenia.net/api/v1/workspaces/workspaceId"

	payload := strings.NewReader("{\n  \"name\": \"New workspace name\",\n  \"chat\": {\n    \"mode\": \"chat\",\n    \"prompt\": \"Answer only from the provided context.\",\n    \"historyLimit\": 20,\n    \"temperature\": 0.7\n  },\n  \"knowledgeSearch\": {\n    \"topResults\": 4,\n    \"similarityThreshold\": 0.25,\n    \"queryRefusalMessage\": \"There is no relevant information in this workspace to answer your query.\"\n  },\n  \"branding\": {\n    \"background\": \"#ffd940\",\n    \"foreground\": \"#1a1a1a\"\n  }\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("X-Account-Id", "X-Account-Id")
	req.Header.Add("Authorization", "Bearer <API_KEY>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Update name, chat, knowledgeSearch and branding together
require 'uri'
require 'net/http'

url = URI("https://app.lumenia.net/api/v1/workspaces/workspaceId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["X-Account-Id"] = 'X-Account-Id'
request["Authorization"] = 'Bearer <API_KEY>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"New workspace name\",\n  \"chat\": {\n    \"mode\": \"chat\",\n    \"prompt\": \"Answer only from the provided context.\",\n    \"historyLimit\": 20,\n    \"temperature\": 0.7\n  },\n  \"knowledgeSearch\": {\n    \"topResults\": 4,\n    \"similarityThreshold\": 0.25,\n    \"queryRefusalMessage\": \"There is no relevant information in this workspace to answer your query.\"\n  },\n  \"branding\": {\n    \"background\": \"#ffd940\",\n    \"foreground\": \"#1a1a1a\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Update name, chat, knowledgeSearch and branding together
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://app.lumenia.net/api/v1/workspaces/workspaceId")
  .header("X-Account-Id", "X-Account-Id")
  .header("Authorization", "Bearer <API_KEY>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"New workspace name\",\n  \"chat\": {\n    \"mode\": \"chat\",\n    \"prompt\": \"Answer only from the provided context.\",\n    \"historyLimit\": 20,\n    \"temperature\": 0.7\n  },\n  \"knowledgeSearch\": {\n    \"topResults\": 4,\n    \"similarityThreshold\": 0.25,\n    \"queryRefusalMessage\": \"There is no relevant information in this workspace to answer your query.\"\n  },\n  \"branding\": {\n    \"background\": \"#ffd940\",\n    \"foreground\": \"#1a1a1a\"\n  }\n}")
  .asString();
```

```php Update name, chat, knowledgeSearch and branding together
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://app.lumenia.net/api/v1/workspaces/workspaceId', [
  'body' => '{
  "name": "New workspace name",
  "chat": {
    "mode": "chat",
    "prompt": "Answer only from the provided context.",
    "historyLimit": 20,
    "temperature": 0.7
  },
  "knowledgeSearch": {
    "topResults": 4,
    "similarityThreshold": 0.25,
    "queryRefusalMessage": "There is no relevant information in this workspace to answer your query."
  },
  "branding": {
    "background": "#ffd940",
    "foreground": "#1a1a1a"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <API_KEY>',
    'Content-Type' => 'application/json',
    'X-Account-Id' => 'X-Account-Id',
  ],
]);

echo $response->getBody();
```

```csharp Update name, chat, knowledgeSearch and branding together
using RestSharp;

var client = new RestClient("https://app.lumenia.net/api/v1/workspaces/workspaceId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("X-Account-Id", "X-Account-Id");
request.AddHeader("Authorization", "Bearer <API_KEY>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"New workspace name\",\n  \"chat\": {\n    \"mode\": \"chat\",\n    \"prompt\": \"Answer only from the provided context.\",\n    \"historyLimit\": 20,\n    \"temperature\": 0.7\n  },\n  \"knowledgeSearch\": {\n    \"topResults\": 4,\n    \"similarityThreshold\": 0.25,\n    \"queryRefusalMessage\": \"There is no relevant information in this workspace to answer your query.\"\n  },\n  \"branding\": {\n    \"background\": \"#ffd940\",\n    \"foreground\": \"#1a1a1a\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update name, chat, knowledgeSearch and branding together
import Foundation

let headers = [
  "X-Account-Id": "X-Account-Id",
  "Authorization": "Bearer <API_KEY>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "New workspace name",
  "chat": [
    "mode": "chat",
    "prompt": "Answer only from the provided context.",
    "historyLimit": 20,
    "temperature": 0.7
  ],
  "knowledgeSearch": [
    "topResults": 4,
    "similarityThreshold": 0.25,
    "queryRefusalMessage": "There is no relevant information in this workspace to answer your query."
  ],
  "branding": [
    "background": "#ffd940",
    "foreground": "#1a1a1a"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://app.lumenia.net/api/v1/workspaces/workspaceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```