JavaScript
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const agent = await client.agents.unarchive('agent_01HXKD2E5NQM3T9AYWCFMGWT9Y', {
workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
});
console.log(agent.metadata);import os
from cadenya import Cadenya
client = Cadenya(
api_key=os.environ.get("CADENYA_API_KEY"), # This is the default and can be omitted
)
agent = client.agents.unarchive(
id="agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
workspace_id="workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
)
print(agent.metadata)package main
import (
"context"
"fmt"
"go.cadenya.com/cadenya-go"
"go.cadenya.com/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
agent, err := client.Agents.Unarchive(
context.TODO(),
"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
cadenya.AgentUnarchiveParams{
WorkspaceID: cadenya.String("workspace_01HXKD2E5NQM3T9AYWCF133E3Q"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", agent.Metadata)
}
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
agent = cadenya.agents.unarchive(
"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
workspace_id: "workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
)
puts(agent)cadenya agents unarchive \
--api-key 'My API Key' \
--workspace-id workspace_01HXKD2E5NQM3T9AYWCF133E3Q \
--id agent_01HXKD2E5NQM3T9AYWCFMGWT9Ycurl --request POST \
--url https://api.cadenya.com/v1/workspaces/{workspaceId}/agents/{id}:unarchive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadenya.com/v1/workspaces/{workspaceId}/agents/{id}:unarchive",
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([
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cadenya.com/v1/workspaces/{workspaceId}/agents/{id}:unarchive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();{
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"labels": {},
"updatedAt": "2023-11-07T05:31:56Z"
},
"spec": {
"description": "<string>",
"webhookEventsUrl": "<string>",
"systemPromptDataSchema": {},
"outputDefinition": {},
"enableEpisodicMemory": true,
"episodicMemoryTtl": 123
},
"info": {
"variationCount": 123,
"createdBy": {
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"externalId": "<string>",
"labels": {},
"createdAt": "2023-11-07T05:31:56Z"
},
"spec": {
"email": "<string>",
"name": "<string>"
}
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Agents
Unarchive an agent
Transitions an archived agent back to STATE_DRAFT. Publish the agent again to make it available for objectives.
POST
/
v1
/
workspaces
/
{workspaceId}
/
agents
/
{id}
:unarchive
JavaScript
import Cadenya from '@cadenya/cadenya';
const client = new Cadenya({
apiKey: process.env['CADENYA_API_KEY'], // This is the default and can be omitted
});
const agent = await client.agents.unarchive('agent_01HXKD2E5NQM3T9AYWCFMGWT9Y', {
workspaceId: 'workspace_01HXKD2E5NQM3T9AYWCF133E3Q',
});
console.log(agent.metadata);import os
from cadenya import Cadenya
client = Cadenya(
api_key=os.environ.get("CADENYA_API_KEY"), # This is the default and can be omitted
)
agent = client.agents.unarchive(
id="agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
workspace_id="workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
)
print(agent.metadata)package main
import (
"context"
"fmt"
"go.cadenya.com/cadenya-go"
"go.cadenya.com/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
agent, err := client.Agents.Unarchive(
context.TODO(),
"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
cadenya.AgentUnarchiveParams{
WorkspaceID: cadenya.String("workspace_01HXKD2E5NQM3T9AYWCF133E3Q"),
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", agent.Metadata)
}
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
agent = cadenya.agents.unarchive(
"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y",
workspace_id: "workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
)
puts(agent)cadenya agents unarchive \
--api-key 'My API Key' \
--workspace-id workspace_01HXKD2E5NQM3T9AYWCF133E3Q \
--id agent_01HXKD2E5NQM3T9AYWCFMGWT9Ycurl --request POST \
--url https://api.cadenya.com/v1/workspaces/{workspaceId}/agents/{id}:unarchive \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadenya.com/v1/workspaces/{workspaceId}/agents/{id}:unarchive",
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([
]),
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;
}HttpResponse<String> response = Unirest.post("https://api.cadenya.com/v1/workspaces/{workspaceId}/agents/{id}:unarchive")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();{
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"workspaceId": "workspace_01HXKD2E5NQM3T9AYWCF133E3Q",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"createdAt": "2023-11-07T05:31:56Z",
"externalId": "<string>",
"labels": {},
"updatedAt": "2023-11-07T05:31:56Z"
},
"spec": {
"description": "<string>",
"webhookEventsUrl": "<string>",
"systemPromptDataSchema": {},
"outputDefinition": {},
"enableEpisodicMemory": true,
"episodicMemoryTtl": 123
},
"info": {
"variationCount": 123,
"createdBy": {
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"externalId": "<string>",
"labels": {},
"createdAt": "2023-11-07T05:31:56Z"
},
"spec": {
"email": "<string>",
"name": "<string>"
}
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Workspace ID.
Example:
"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"
Agent ID. Accepts the canonical agent_… form or the external_id:<value> form.
Example:
"agent_01HXKD2E5NQM3T9AYWCFMGWT9Y"
Body
application/json
Unarchive agent request
Response
OK
Agent resource
Resource metadata
Show child attributes
Show child attributes
Agent specification
Show child attributes
Show child attributes
The current lifecycle state of the agent. Output only. Agents are created in STATE_DRAFT; use the :publish, :unpublish, :archive, and :unarchive actions to transition between states.
Available options:
STATE_UNSPECIFIED, STATE_DRAFT, STATE_PUBLISHED, STATE_ARCHIVED Agent information
Show child attributes
Show child attributes
⌘I