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 workspace = await client.workspaceAdmin.create({
metadata: { name: 'name' },
spec: {},
});
console.log(workspace.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
)
workspace = client.workspace_admin.create(
metadata={
"name": "name"
},
spec={},
)
print(workspace.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"),
)
workspace, err := client.WorkspaceAdmin.New(context.TODO(), cadenya.WorkspaceAdminNewParams{
Metadata: cadenya.WorkspaceAdminNewParamsMetadata{
Name: "name",
},
Spec: cadenya.WorkspaceSpecParam{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", workspace.Metadata)
}
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
workspace = cadenya.workspace_admin.create(metadata: {name: "name"}, spec: {})
puts(workspace)cadenya workspace-admin create \
--api-key 'My API Key' \
--metadata '{name: name}' \
--spec '{}'curl --request POST \
--url https://api.cadenya.com/v1/account/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "<string>",
"externalId": "<string>",
"labels": {}
},
"spec": {
"description": "<string>"
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadenya.com/v1/account/workspaces",
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([
'metadata' => [
'name' => '<string>',
'externalId' => '<string>',
'labels' => [
]
],
'spec' => [
'description' => '<string>'
]
]),
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/account/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"labels\": {}\n },\n \"spec\": {\n \"description\": \"<string>\"\n }\n}")
.asString();{
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"externalId": "<string>",
"labels": {},
"createdAt": "2023-11-07T05:31:56Z"
},
"spec": {
"description": "<string>"
},
"info": {
"totalAvailableTools": 123,
"totalMemoryEntries": 123,
"totalAgents": 123,
"totalAgentVariations": 123
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Workspace Admin
Create a workspace
Creates a new workspace in the account. Admin only.
POST
/
v1
/
account
/
workspaces
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 workspace = await client.workspaceAdmin.create({
metadata: { name: 'name' },
spec: {},
});
console.log(workspace.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
)
workspace = client.workspace_admin.create(
metadata={
"name": "name"
},
spec={},
)
print(workspace.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"),
)
workspace, err := client.WorkspaceAdmin.New(context.TODO(), cadenya.WorkspaceAdminNewParams{
Metadata: cadenya.WorkspaceAdminNewParamsMetadata{
Name: "name",
},
Spec: cadenya.WorkspaceSpecParam{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", workspace.Metadata)
}
require "cadenya"
cadenya = Cadenya::Client.new(api_key: "My API Key")
workspace = cadenya.workspace_admin.create(metadata: {name: "name"}, spec: {})
puts(workspace)cadenya workspace-admin create \
--api-key 'My API Key' \
--metadata '{name: name}' \
--spec '{}'curl --request POST \
--url https://api.cadenya.com/v1/account/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {
"name": "<string>",
"externalId": "<string>",
"labels": {}
},
"spec": {
"description": "<string>"
}
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cadenya.com/v1/account/workspaces",
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([
'metadata' => [
'name' => '<string>',
'externalId' => '<string>',
'labels' => [
]
],
'spec' => [
'description' => '<string>'
]
]),
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/account/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"metadata\": {\n \"name\": \"<string>\",\n \"externalId\": \"<string>\",\n \"labels\": {}\n },\n \"spec\": {\n \"description\": \"<string>\"\n }\n}")
.asString();{
"metadata": {
"id": "<string>",
"accountId": "account_01HXKD2E5NQM3T9AYWCFTJHJVF",
"name": "<string>",
"profileId": "profile_01HXKD2E5NQM3T9AYWCFS0AP08",
"externalId": "<string>",
"labels": {},
"createdAt": "2023-11-07T05:31:56Z"
},
"spec": {
"description": "<string>"
},
"info": {
"totalAvailableTools": 123,
"totalMemoryEntries": 123,
"totalAgents": 123,
"totalAgentVariations": 123
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}const workspace = await client.workspaceAdmin.create({
metadata: { name: 'Development', externalId: 'development' },
spec: {},
});
workspace, err := client.WorkspaceAdmin.New(ctx,
cadenya.WorkspaceAdminNewParams{
Metadata: cadenya.WorkspaceAdminNewParamsMetadata{
Name: "Development",
ExternalID: cadenya.String("development"),
},
Spec: cadenya.WorkspaceSpecParam{},
})
workspace = cadenya.workspace_admin.create(
metadata: {name: "Development", external_id: "development"},
spec: {}
)
curl -X POST "https://api.cadenya.com/v1/account/workspaces" \
-H "Authorization: Bearer ${CADENYA_API_KEY}" \
-H "Content-Type: application/json" \
-d '{ "metadata": { "name": "Development", "externalId": "development" }, "spec": {} }'
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
OK
AccountResourceMetadata is used to represent a resource that is associated to an account but not to a workspace.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Lifecycle status of the workspace. Archived workspaces reject all requests scoped to them. Server-populated.
Available options:
STATUS_ENABLED, STATUS_DISABLED, STATUS_ARCHIVED The workspace information
Show child attributes
Show child attributes
⌘I