Workspaces
Add an agent to a workspace
Requires workspaces:write, not agents:write — the workspace-agent CREATE rule delegates to the workspace’s own UPDATE privacy.
POST
/
workspaces
/
{workspace_id_or_name}
/
workspace_agents
Add an agent to a workspace
curl --request POST \
--url https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"should_autoupdate": true,
"is_default_chat_agent": false,
"event_id": null
}
'import requests
url = "https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"should_autoupdate": True,
"is_default_chat_agent": False,
"event_id": None
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
should_autoupdate: true,
is_default_chat_agent: false,
event_id: null
})
};
fetch('https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents', 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.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'should_autoupdate' => true,
'is_default_chat_agent' => false,
'event_id' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"should_autoupdate\": true,\n \"is_default_chat_agent\": false,\n \"event_id\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"should_autoupdate\": true,\n \"is_default_chat_agent\": false,\n \"event_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"should_autoupdate\": true,\n \"is_default_chat_agent\": false,\n \"event_id\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_default_chat_agent": true,
"should_autoupdate": true,
"required_credentials_mode": "SHARED",
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"agent_type": "GUILD_TYPESCRIPT",
"description": "<string>",
"is_public": true,
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cached_forks_count": 123,
"cached_installs_count": 123,
"cached_likes_count": 123,
"is_pinned": true,
"moderation_state": "ACTIVE",
"status": "CREATED",
"archived_at": "2023-11-07T05:31:56Z",
"archived_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"avatar_url": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"creation_template": "LLM",
"forked_from_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generated_description": "<string>",
"maintainer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archived_by": "<unknown>",
"category": "<unknown>",
"forks_count": 123,
"full_name": "<string>",
"git_url": "<string>",
"installs_count": 123,
"is_description_autogenerated": "<unknown>",
"latest_published_version": "<unknown>",
"latest_version": "<unknown>",
"likes_count": 123,
"maintainer": {},
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"cached_forks_count": 123,
"cached_forks_public_count": 123,
"cached_installs_count": 123,
"cached_installs_public_count": 123,
"cached_likes_count": 123,
"cached_likes_public_count": 123,
"avatar_url": "<string>",
"banner_url": "<string>",
"bio": "<string>",
"discord_url": "<string>",
"email_domain": "<string>",
"full_name": "<string>",
"github_url": "<string>",
"linkedin_url": "<string>",
"threads_url": "<string>",
"website_url": "<string>",
"x_url": "<string>",
"youtube_url": "<string>",
"member_count": "<unknown>",
"viewer_membership_id": "<unknown>",
"viewer_membership_public": "<unknown>",
"viewer_role": "ADMIN",
"type": "organization"
},
"public_profile_url": "<unknown>",
"type": "<unknown>",
"viewer_can_edit": true
},
"agent_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"author_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"validation_status": "SKIPPED",
"dependencies": {},
"description": "<string>",
"env_references": [
"<unknown>"
],
"input_schema": {},
"output_schema": {},
"published_at": "2023-11-07T05:31:56Z",
"publishing_started_at": "2023-11-07T05:31:56Z",
"raw_tools": [
"<unknown>"
],
"runtime_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sha": "<string>",
"summary": "<string>",
"tools": [
"<unknown>"
],
"version_number": "<string>",
"agent": "<unknown>",
"author": "<unknown>",
"status": "<unknown>",
"version_type": "<unknown>"
},
"creator": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"name": "<string>",
"cached_forks_count": 123,
"cached_forks_public_count": 123,
"cached_installs_count": 123,
"cached_installs_public_count": 123,
"cached_likes_count": 123,
"cached_likes_public_count": 123,
"is_operator": true,
"notification_email_level": "NONE",
"avatar_url": "<string>",
"banner_url": "<string>",
"bio": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"discord_url": "<string>",
"full_name": "<string>",
"github_url": "<string>",
"hubspot_synced_at": "2023-11-07T05:31:56Z",
"linkedin_url": "<string>",
"threads_url": "<string>",
"username_set_at": "2023-11-07T05:31:56Z",
"website_url": "<string>",
"x_url": "<string>",
"youtube_url": "<string>",
"type": "user"
},
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrict_account_credentials": true,
"should_restrict_members": true,
"unlimited_power_mode": true,
"archived_at": "2023-11-07T05:31:56Z",
"archived_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"required_credentials_mode": "SHARED",
"archived_by": "<unknown>",
"creator": "<unknown>",
"full_name": "<string>",
"is_viewer_member": "<unknown>",
"members_enabled": "<unknown>",
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"cached_forks_count": 123,
"cached_forks_public_count": 123,
"cached_installs_count": 123,
"cached_installs_public_count": 123,
"cached_likes_count": 123,
"cached_likes_public_count": 123,
"avatar_url": "<string>",
"banner_url": "<string>",
"bio": "<string>",
"discord_url": "<string>",
"email_domain": "<string>",
"full_name": "<string>",
"github_url": "<string>",
"linkedin_url": "<string>",
"threads_url": "<string>",
"website_url": "<string>",
"x_url": "<string>",
"youtube_url": "<string>",
"member_count": "<unknown>",
"viewer_membership_id": "<unknown>",
"viewer_membership_public": "<unknown>",
"viewer_role": "ADMIN",
"type": "organization"
},
"unlimited_power_mode_enabled": "<unknown>"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Account API key: key id as the username, secret as the password.
Path Parameters
Body
application/json
Response
Successful response
The user or API key that added this agent version to the workspace.
If True, this workspace agent is used for new chat sessions when no explicit agent is provided.
If True, the agent will automatically update when a new version is published.
Whose credentials this agent may run with: SHARED = only org-side credentials serve, MEMBER = only the acting member's own. Unset = the workspace's declaration applies, and no requirement when that is unset too.
Available options:
SHARED, MEMBER Show child attributes
Show child attributes
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Add an agent to a workspace
curl --request POST \
--url https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"should_autoupdate": true,
"is_default_chat_agent": false,
"event_id": null
}
'import requests
url = "https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents"
payload = {
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"should_autoupdate": True,
"is_default_chat_agent": False,
"event_id": None
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
should_autoupdate: true,
is_default_chat_agent: false,
event_id: null
})
};
fetch('https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents', 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.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'should_autoupdate' => true,
'is_default_chat_agent' => false,
'event_id' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents"
payload := strings.NewReader("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"should_autoupdate\": true,\n \"is_default_chat_agent\": false,\n \"event_id\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.post("https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"should_autoupdate\": true,\n \"is_default_chat_agent\": false,\n \"event_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.guild.ai/v1/workspaces/{workspace_id_or_name}/workspace_agents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"should_autoupdate\": true,\n \"is_default_chat_agent\": false,\n \"event_id\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_default_chat_agent": true,
"should_autoupdate": true,
"required_credentials_mode": "SHARED",
"agent": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"agent_type": "GUILD_TYPESCRIPT",
"description": "<string>",
"is_public": true,
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cached_forks_count": 123,
"cached_installs_count": 123,
"cached_likes_count": 123,
"is_pinned": true,
"moderation_state": "ACTIVE",
"status": "CREATED",
"archived_at": "2023-11-07T05:31:56Z",
"archived_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"avatar_url": "<string>",
"category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"creation_template": "LLM",
"forked_from_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"generated_description": "<string>",
"maintainer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archived_by": "<unknown>",
"category": "<unknown>",
"forks_count": 123,
"full_name": "<string>",
"git_url": "<string>",
"installs_count": 123,
"is_description_autogenerated": "<unknown>",
"latest_published_version": "<unknown>",
"latest_version": "<unknown>",
"likes_count": 123,
"maintainer": {},
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"cached_forks_count": 123,
"cached_forks_public_count": 123,
"cached_installs_count": 123,
"cached_installs_public_count": 123,
"cached_likes_count": 123,
"cached_likes_public_count": 123,
"avatar_url": "<string>",
"banner_url": "<string>",
"bio": "<string>",
"discord_url": "<string>",
"email_domain": "<string>",
"full_name": "<string>",
"github_url": "<string>",
"linkedin_url": "<string>",
"threads_url": "<string>",
"website_url": "<string>",
"x_url": "<string>",
"youtube_url": "<string>",
"member_count": "<unknown>",
"viewer_membership_id": "<unknown>",
"viewer_membership_public": "<unknown>",
"viewer_role": "ADMIN",
"type": "organization"
},
"public_profile_url": "<unknown>",
"type": "<unknown>",
"viewer_can_edit": true
},
"agent_version": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"author_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"validation_status": "SKIPPED",
"dependencies": {},
"description": "<string>",
"env_references": [
"<unknown>"
],
"input_schema": {},
"output_schema": {},
"published_at": "2023-11-07T05:31:56Z",
"publishing_started_at": "2023-11-07T05:31:56Z",
"raw_tools": [
"<unknown>"
],
"runtime_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sha": "<string>",
"summary": "<string>",
"tools": [
"<unknown>"
],
"version_number": "<string>",
"agent": "<unknown>",
"author": "<unknown>",
"status": "<unknown>",
"version_type": "<unknown>"
},
"creator": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"email": "<string>",
"name": "<string>",
"cached_forks_count": 123,
"cached_forks_public_count": 123,
"cached_installs_count": 123,
"cached_installs_public_count": 123,
"cached_likes_count": 123,
"cached_likes_public_count": 123,
"is_operator": true,
"notification_email_level": "NONE",
"avatar_url": "<string>",
"banner_url": "<string>",
"bio": "<string>",
"closed_at": "2023-11-07T05:31:56Z",
"discord_url": "<string>",
"full_name": "<string>",
"github_url": "<string>",
"hubspot_synced_at": "2023-11-07T05:31:56Z",
"linkedin_url": "<string>",
"threads_url": "<string>",
"username_set_at": "2023-11-07T05:31:56Z",
"website_url": "<string>",
"x_url": "<string>",
"youtube_url": "<string>",
"type": "user"
},
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"restrict_account_credentials": true,
"should_restrict_members": true,
"unlimited_power_mode": true,
"archived_at": "2023-11-07T05:31:56Z",
"archived_by_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"required_credentials_mode": "SHARED",
"archived_by": "<unknown>",
"creator": "<unknown>",
"full_name": "<string>",
"is_viewer_member": "<unknown>",
"members_enabled": "<unknown>",
"owner": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"creator_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"cached_forks_count": 123,
"cached_forks_public_count": 123,
"cached_installs_count": 123,
"cached_installs_public_count": 123,
"cached_likes_count": 123,
"cached_likes_public_count": 123,
"avatar_url": "<string>",
"banner_url": "<string>",
"bio": "<string>",
"discord_url": "<string>",
"email_domain": "<string>",
"full_name": "<string>",
"github_url": "<string>",
"linkedin_url": "<string>",
"threads_url": "<string>",
"website_url": "<string>",
"x_url": "<string>",
"youtube_url": "<string>",
"member_count": "<unknown>",
"viewer_membership_id": "<unknown>",
"viewer_membership_public": "<unknown>",
"viewer_role": "ADMIN",
"type": "organization"
},
"unlimited_power_mode_enabled": "<unknown>"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}