Agents
Get or create the workspace's primary agent
Returns the workspace’s primary agent, restoring it if it was archived or creating it if the workspace has none. Idempotent: repeated calls return the same agent.
POST
/
v1
/
agents
/
primary
Get or create the workspace's primary agent
curl --request POST \
--url https://api.lusor.ai/v1/agents/primary \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.lusor.ai/v1/agents/primary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/agents/primary"
payload = { "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>",
"avatar": "<string>",
"description": "<string>",
"model": "<string>",
"archivedAt": "2023-11-07T05:31:56Z",
"purgeAfter": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastTurnAt": "2023-11-07T05:31:56Z",
"lastTurnSnippet": "<string>",
"devices": [
{
"deviceId": "<string>",
"label": "<string>",
"description": "<string>",
"position": 123,
"createdAt": "2023-11-07T05:31:56Z"
}
],
"turns": [
{
"id": "<string>",
"sessionId": "<string>",
"prompt": "<string>",
"status": "<string>",
"deviceId": "<string>",
"summary": "<string>",
"recording": true,
"queued": true,
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
],
"turnsCursor": "<string>",
"turnsHasMore": true,
"activityAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Was this page helpful?
⌘I
Get or create the workspace's primary agent
curl --request POST \
--url https://api.lusor.ai/v1/agents/primary \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({workspaceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.lusor.ai/v1/agents/primary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.lusor.ai/v1/agents/primary"
payload = { "workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"color": "<string>",
"avatar": "<string>",
"description": "<string>",
"model": "<string>",
"archivedAt": "2023-11-07T05:31:56Z",
"purgeAfter": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"lastTurnAt": "2023-11-07T05:31:56Z",
"lastTurnSnippet": "<string>",
"devices": [
{
"deviceId": "<string>",
"label": "<string>",
"description": "<string>",
"position": 123,
"createdAt": "2023-11-07T05:31:56Z"
}
],
"turns": [
{
"id": "<string>",
"sessionId": "<string>",
"prompt": "<string>",
"status": "<string>",
"deviceId": "<string>",
"summary": "<string>",
"recording": true,
"queued": true,
"createdAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
],
"turnsCursor": "<string>",
"turnsHasMore": true,
"activityAt": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}
