Agent

Create

POST
Create a new agent

Request

This endpoint expects an object.
name
stringRequired
isActive
booleanOptional
initialMessage
stringOptional
prompt
stringOptional
llmModel
stringOptional
llmProvider
enumOptional
An enumeration.
description
stringOptional
avatar
stringOptional
type
enumOptional
An enumeration.
Allowed values: SUPERAGENTOPENAI_ASSISTANTLLM
parameters
objectOptional
metadata
map from strings to anyOptional
outputSchema
stringOptional

Response

This endpoint returns an object
success
boolean
data
objectOptional
Represents a Agent record
POST
1curl -X POST https://api.beta.superagent.sh/api/v1/agents \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "name": "name"
6}'
200
Successful
1{
2 "success": true,
3 "data": {
4 "id": "id",
5 "type": "SUPERAGENT",
6 "name": "name",
7 "description": "description",
8 "isActive": true,
9 "createdAt": "2024-01-15T09:30:00Z",
10 "updatedAt": "2024-01-15T09:30:00Z",
11 "apiUserId": "apiUserId",
12 "avatar": "avatar",
13 "initialMessage": "initialMessage",
14 "llms": [
15 {
16 "agentId": "agentId",
17 "llmId": "llmId",
18 "createdAt": "2024-01-15T09:30:00Z",
19 "updatedAt": "2024-01-15T09:30:00Z"
20 }
21 ],
22 "llmModel": "GPT_3_5_TURBO",
23 "prompt": "prompt",
24 "apiUser": {
25 "id": "id",
26 "createdAt": "2024-01-15T09:30:00Z",
27 "updatedAt": "2024-01-15T09:30:00Z",
28 "token": "token",
29 "email": "email",
30 "llms": [
31 {
32 "id": "id",
33 "provider": "OPENAI",
34 "apiKey": "apiKey",
35 "createdAt": "2024-01-15T09:30:00Z",
36 "updatedAt": "2024-01-15T09:30:00Z",
37 "apiUserId": "apiUserId"
38 }
39 ],
40 "datasources": [
41 {
42 "id": "id",
43 "name": "name",
44 "type": "TXT",
45 "apiUserId": "apiUserId",
46 "createdAt": "2024-01-15T09:30:00Z",
47 "updatedAt": "2024-01-15T09:30:00Z",
48 "status": "IN_PROGRESS"
49 }
50 ],
51 "tools": [
52 {
53 "id": "id",
54 "name": "name",
55 "description": "description",
56 "type": "ALGOLIA",
57 "returnDirect": true,
58 "createdAt": "2024-01-15T09:30:00Z",
59 "updatedAt": "2024-01-15T09:30:00Z",
60 "apiUserId": "apiUserId"
61 }
62 ],
63 "workflows": [
64 {
65 "id": "id",
66 "name": "name",
67 "createdAt": "2024-01-15T09:30:00Z",
68 "updatedAt": "2024-01-15T09:30:00Z",
69 "apiUserId": "apiUserId"
70 }
71 ],
72 "vectorDb": [
73 {
74 "id": "id",
75 "provider": "PINECONE",
76 "createdAt": "2024-01-15T09:30:00Z",
77 "updatedAt": "2024-01-15T09:30:00Z",
78 "apiUserId": "apiUserId"
79 }
80 ],
81 "workflowConfigs": [
82 {
83 "id": "id",
84 "createdAt": "2024-01-15T09:30:00Z",
85 "updatedAt": "2024-01-15T09:30:00Z",
86 "workflowId": "workflowId"
87 }
88 ],
89 "apiKeys": [
90 {
91 "id": "id",
92 "name": "name",
93 "displayApiKey": "displayApiKey",
94 "createdAt": "2024-01-15T09:30:00Z",
95 "updatedAt": "2024-01-15T09:30:00Z",
96 "apiUserId": "apiUserId"
97 }
98 ]
99 },
100 "datasources": [
101 {
102 "agentId": "agentId",
103 "datasourceId": "datasourceId",
104 "createdAt": "2024-01-15T09:30:00Z",
105 "updatedAt": "2024-01-15T09:30:00Z"
106 }
107 ],
108 "tools": [
109 {
110 "agentId": "agentId",
111 "toolId": "toolId",
112 "createdAt": "2024-01-15T09:30:00Z",
113 "updatedAt": "2024-01-15T09:30:00Z"
114 }
115 ],
116 "workflowSteps": [
117 {
118 "id": "id",
119 "order": 1,
120 "workflowId": "workflowId",
121 "createdAt": "2024-01-15T09:30:00Z",
122 "updatedAt": "2024-01-15T09:30:00Z",
123 "agentId": "agentId"
124 }
125 ],
126 "metadata": {
127 "key": "value"
128 },
129 "outputSchema": "outputSchema"
130 }
131}