Hosting
Update hosting configuration
Update the hosting configuration for a namespace. If there is no change, return it as it is.
PATCH
/
v1
/
namespace
/
{namespaceId}
/
hosting
TypeScript
import { Agentset } from "agentset";
const agentset = new Agentset({ apiKey: 'agentset_xxx' });
const ns = agentset.namespace('ns_xxx');
const updatedHosting = await ns.hosting.update({
title: "My Knowledge Base",
welcomeMessage: "Welcome to my knowledge base!",
searchEnabled: true,
});
console.log(updatedHosting);from agentset import Agentset
with Agentset(
namespace_id="ns_123",
token="AGENTSET_API_KEY",
) as a_client:
res = a_client.hosting.update()
# Handle response
print(res)curl --request PATCH \
--url https://api.agentset.ai/v1/namespace/{namespaceId}/hosting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"slug": "<string>",
"logo": "<string>",
"ogTitle": "<string>",
"ogDescription": "<string>",
"ogImage": "<string>",
"protected": true,
"allowedEmails": [
"jsmith@example.com"
],
"allowedEmailDomains": [
"<string>"
],
"systemPrompt": "<string>",
"exampleQuestions": [
"<string>"
],
"exampleSearchQueries": [
"<string>"
],
"welcomeMessage": "<string>",
"citationMetadataPath": "<string>",
"searchEnabled": true,
"topK": 50,
"rerankLimit": 50
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
slug: '<string>',
logo: '<string>',
ogTitle: '<string>',
ogDescription: '<string>',
ogImage: '<string>',
protected: true,
allowedEmails: ['jsmith@example.com'],
allowedEmailDomains: ['<string>'],
systemPrompt: '<string>',
exampleQuestions: ['<string>'],
exampleSearchQueries: ['<string>'],
welcomeMessage: '<string>',
citationMetadataPath: '<string>',
searchEnabled: true,
topK: 50,
rerankLimit: 50
})
};
fetch('https://api.agentset.ai/v1/namespace/{namespaceId}/hosting', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agentset.ai/v1/namespace/{namespaceId}/hosting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'slug' => '<string>',
'logo' => '<string>',
'ogTitle' => '<string>',
'ogDescription' => '<string>',
'ogImage' => '<string>',
'protected' => true,
'allowedEmails' => [
'jsmith@example.com'
],
'allowedEmailDomains' => [
'<string>'
],
'systemPrompt' => '<string>',
'exampleQuestions' => [
'<string>'
],
'exampleSearchQueries' => [
'<string>'
],
'welcomeMessage' => '<string>',
'citationMetadataPath' => '<string>',
'searchEnabled' => true,
'topK' => 50,
'rerankLimit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agentset.ai/v1/namespace/{namespaceId}/hosting"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"logo\": \"<string>\",\n \"ogTitle\": \"<string>\",\n \"ogDescription\": \"<string>\",\n \"ogImage\": \"<string>\",\n \"protected\": true,\n \"allowedEmails\": [\n \"jsmith@example.com\"\n ],\n \"allowedEmailDomains\": [\n \"<string>\"\n ],\n \"systemPrompt\": \"<string>\",\n \"exampleQuestions\": [\n \"<string>\"\n ],\n \"exampleSearchQueries\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"citationMetadataPath\": \"<string>\",\n \"searchEnabled\": true,\n \"topK\": 50,\n \"rerankLimit\": 50\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.agentset.ai/v1/namespace/{namespaceId}/hosting")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"logo\": \"<string>\",\n \"ogTitle\": \"<string>\",\n \"ogDescription\": \"<string>\",\n \"ogImage\": \"<string>\",\n \"protected\": true,\n \"allowedEmails\": [\n \"jsmith@example.com\"\n ],\n \"allowedEmailDomains\": [\n \"<string>\"\n ],\n \"systemPrompt\": \"<string>\",\n \"exampleQuestions\": [\n \"<string>\"\n ],\n \"exampleSearchQueries\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"citationMetadataPath\": \"<string>\",\n \"searchEnabled\": true,\n \"topK\": 50,\n \"rerankLimit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentset.ai/v1/namespace/{namespaceId}/hosting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"logo\": \"<string>\",\n \"ogTitle\": \"<string>\",\n \"ogDescription\": \"<string>\",\n \"ogImage\": \"<string>\",\n \"protected\": true,\n \"allowedEmails\": [\n \"jsmith@example.com\"\n ],\n \"allowedEmailDomains\": [\n \"<string>\"\n ],\n \"systemPrompt\": \"<string>\",\n \"exampleQuestions\": [\n \"<string>\"\n ],\n \"exampleSearchQueries\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"citationMetadataPath\": \"<string>\",\n \"searchEnabled\": true,\n \"topK\": 50,\n \"rerankLimit\": 50\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"namespaceId": "<string>",
"title": "<string>",
"slug": "<string>",
"logo": "<string>",
"ogTitle": "<string>",
"ogDescription": "<string>",
"ogImage": "<string>",
"systemPrompt": "<string>",
"exampleQuestions": [],
"exampleSearchQueries": [],
"welcomeMessage": "<string>",
"citationMetadataPath": "<string>",
"searchEnabled": true,
"rerankConfig": "<unknown>",
"llmConfig": "<unknown>",
"topK": 50,
"protected": true,
"allowedEmails": [],
"allowedEmailDomains": [],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"success": false,
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#bad-request"
}
}{
"success": false,
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#unauthorized"
}
}{
"success": false,
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#forbidden"
}
}{
"success": false,
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#not-found"
}
}{
"success": false,
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#conflict"
}
}{
"success": false,
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#invite-expired"
}
}{
"success": false,
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#unprocessable-entity"
}
}{
"success": false,
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#rate-limit_exceeded"
}
}{
"success": false,
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#internal-server_error"
}
}Authorizations
Default authentication mechanism
Path Parameters
The id of the namespace (prefixed with ns_)
Example:
"ns_123"
Body
application/json
Minimum string length:
1Required string length:
2 - 48Pattern:
^data:image\/(png|jpeg|jpg|gif|webp);base64,Maximum string length:
70Maximum string length:
200Pattern:
^data:image\/(png|jpeg|jpg|gif|webp);base64,Pattern:
^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$Maximum array length:
4Maximum array length:
4Available options:
cohere:rerank-v4.0-pro, cohere:rerank-v4.0-fast, cohere:rerank-v3.5, cohere:rerank-english-v3.0, cohere:rerank-multilingual-v3.0, zeroentropy:zerank-2, zeroentropy:zerank-1, zeroentropy:zerank-1-small Available options:
openai:gpt-4.1, openai:gpt-5.2, openai:gpt-5.1, openai:gpt-5, openai:gpt-5-mini, openai:gpt-5-nano Required range:
1 <= x <= 100Required range:
1 <= x <= 100⌘I
TypeScript
import { Agentset } from "agentset";
const agentset = new Agentset({ apiKey: 'agentset_xxx' });
const ns = agentset.namespace('ns_xxx');
const updatedHosting = await ns.hosting.update({
title: "My Knowledge Base",
welcomeMessage: "Welcome to my knowledge base!",
searchEnabled: true,
});
console.log(updatedHosting);from agentset import Agentset
with Agentset(
namespace_id="ns_123",
token="AGENTSET_API_KEY",
) as a_client:
res = a_client.hosting.update()
# Handle response
print(res)curl --request PATCH \
--url https://api.agentset.ai/v1/namespace/{namespaceId}/hosting \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"slug": "<string>",
"logo": "<string>",
"ogTitle": "<string>",
"ogDescription": "<string>",
"ogImage": "<string>",
"protected": true,
"allowedEmails": [
"jsmith@example.com"
],
"allowedEmailDomains": [
"<string>"
],
"systemPrompt": "<string>",
"exampleQuestions": [
"<string>"
],
"exampleSearchQueries": [
"<string>"
],
"welcomeMessage": "<string>",
"citationMetadataPath": "<string>",
"searchEnabled": true,
"topK": 50,
"rerankLimit": 50
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
slug: '<string>',
logo: '<string>',
ogTitle: '<string>',
ogDescription: '<string>',
ogImage: '<string>',
protected: true,
allowedEmails: ['jsmith@example.com'],
allowedEmailDomains: ['<string>'],
systemPrompt: '<string>',
exampleQuestions: ['<string>'],
exampleSearchQueries: ['<string>'],
welcomeMessage: '<string>',
citationMetadataPath: '<string>',
searchEnabled: true,
topK: 50,
rerankLimit: 50
})
};
fetch('https://api.agentset.ai/v1/namespace/{namespaceId}/hosting', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agentset.ai/v1/namespace/{namespaceId}/hosting",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'slug' => '<string>',
'logo' => '<string>',
'ogTitle' => '<string>',
'ogDescription' => '<string>',
'ogImage' => '<string>',
'protected' => true,
'allowedEmails' => [
'jsmith@example.com'
],
'allowedEmailDomains' => [
'<string>'
],
'systemPrompt' => '<string>',
'exampleQuestions' => [
'<string>'
],
'exampleSearchQueries' => [
'<string>'
],
'welcomeMessage' => '<string>',
'citationMetadataPath' => '<string>',
'searchEnabled' => true,
'topK' => 50,
'rerankLimit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.agentset.ai/v1/namespace/{namespaceId}/hosting"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"logo\": \"<string>\",\n \"ogTitle\": \"<string>\",\n \"ogDescription\": \"<string>\",\n \"ogImage\": \"<string>\",\n \"protected\": true,\n \"allowedEmails\": [\n \"jsmith@example.com\"\n ],\n \"allowedEmailDomains\": [\n \"<string>\"\n ],\n \"systemPrompt\": \"<string>\",\n \"exampleQuestions\": [\n \"<string>\"\n ],\n \"exampleSearchQueries\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"citationMetadataPath\": \"<string>\",\n \"searchEnabled\": true,\n \"topK\": 50,\n \"rerankLimit\": 50\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.agentset.ai/v1/namespace/{namespaceId}/hosting")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"logo\": \"<string>\",\n \"ogTitle\": \"<string>\",\n \"ogDescription\": \"<string>\",\n \"ogImage\": \"<string>\",\n \"protected\": true,\n \"allowedEmails\": [\n \"jsmith@example.com\"\n ],\n \"allowedEmailDomains\": [\n \"<string>\"\n ],\n \"systemPrompt\": \"<string>\",\n \"exampleQuestions\": [\n \"<string>\"\n ],\n \"exampleSearchQueries\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"citationMetadataPath\": \"<string>\",\n \"searchEnabled\": true,\n \"topK\": 50,\n \"rerankLimit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentset.ai/v1/namespace/{namespaceId}/hosting")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"slug\": \"<string>\",\n \"logo\": \"<string>\",\n \"ogTitle\": \"<string>\",\n \"ogDescription\": \"<string>\",\n \"ogImage\": \"<string>\",\n \"protected\": true,\n \"allowedEmails\": [\n \"jsmith@example.com\"\n ],\n \"allowedEmailDomains\": [\n \"<string>\"\n ],\n \"systemPrompt\": \"<string>\",\n \"exampleQuestions\": [\n \"<string>\"\n ],\n \"exampleSearchQueries\": [\n \"<string>\"\n ],\n \"welcomeMessage\": \"<string>\",\n \"citationMetadataPath\": \"<string>\",\n \"searchEnabled\": true,\n \"topK\": 50,\n \"rerankLimit\": 50\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"namespaceId": "<string>",
"title": "<string>",
"slug": "<string>",
"logo": "<string>",
"ogTitle": "<string>",
"ogDescription": "<string>",
"ogImage": "<string>",
"systemPrompt": "<string>",
"exampleQuestions": [],
"exampleSearchQueries": [],
"welcomeMessage": "<string>",
"citationMetadataPath": "<string>",
"searchEnabled": true,
"rerankConfig": "<unknown>",
"llmConfig": "<unknown>",
"topK": 50,
"protected": true,
"allowedEmails": [],
"allowedEmailDomains": [],
"createdAt": "<string>",
"updatedAt": "<string>"
}
}{
"success": false,
"error": {
"code": "bad_request",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#bad-request"
}
}{
"success": false,
"error": {
"code": "unauthorized",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#unauthorized"
}
}{
"success": false,
"error": {
"code": "forbidden",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#forbidden"
}
}{
"success": false,
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#not-found"
}
}{
"success": false,
"error": {
"code": "conflict",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#conflict"
}
}{
"success": false,
"error": {
"code": "invite_expired",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#invite-expired"
}
}{
"success": false,
"error": {
"code": "unprocessable_entity",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#unprocessable-entity"
}
}{
"success": false,
"error": {
"code": "rate_limit_exceeded",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#rate-limit_exceeded"
}
}{
"success": false,
"error": {
"code": "internal_server_error",
"message": "The requested resource was not found.",
"doc_url": "https://docs.agentset.ai/api-reference/errors#internal-server_error"
}
}