# Create an Agent

## Create an agent

<mark class="gb-c-orange">`POST`</mark> `/agents`

Create or Update agent tools

```json wrap showLineNumbers
curl --location 'https://ekoai.ekoapp.com/agents' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data '{
    "id": "{clientId}",
    "name": "API assistant",
    "networkId": "{networkId}",
    "type": "tools",
    "tools": {
        "report_builder": {
            "toolName": "report_builder",
            "config": {
                "timezone": "Asia/Bangkok"
            }
        },
        "research": {
            "toolName": "research",
            "config": {
                "allowedResearchTypes": [
                    "web_search",
                    "news",
                    "images",
                    "videos",
                    "shopping",
                    "places"
                ]
            }
        },
        "web_scraper": {
            "toolName": "web_scraper"
        },
        "image_generator": {
            "toolName": "image_generator",
            "config": {
                "image_preference": ""
            }
        },
        "query_knowledge_base": {
            "toolName": "query_knowledge_base",
            "config": {
                "knowledgebases": [
                    {
                        "id": {assistantId},
                        "description": "Knowledge Base 1",
                        "assistant_secret": "{assistantSecret}",
                        "language": "en"
                    }
                ]
            }
        }
    },
    "systemPrompt": "String",
    "model": "gpt-4o",
    "channels": [
        {
            "channelType": "eko",
            "clientId": "{clientId}",
            "clientSecret": "{clientSecret}",
            "ekoaiUrl": "https://ekogreen-h1.ekoapp.com",
            "channelId": "{clientId}"
        }
    ],
    "homeScreen": {
        "title": "",
        "description": "",
        "predefinedPrompts": [
            {
                "title": "Text me message",
                "text": "send me some message",
                "icon": {
                    "color": "#ffb400",
                    "id": "comment"
                }
            }
        ]
    }
}'
```

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>id*</td><td>String</td><td>The unique identifier for the agent.</td></tr><tr><td>name*</td><td>String</td><td>The name of the agent.</td></tr><tr><td>networkId*</td><td>String</td><td>The ID of the network to which the agent belongs.</td></tr><tr><td>type*</td><td>String</td><td><p></p><ul><li><code>'tools'</code>: Indicates that the agent uses a set of tools.</li><li><code>'botsplus'</code>: Indicates that the agent uses the BotsPlus configuration.</li><li><code>'ekoaistudio'</code>: Indicates that the agent uses the EkoaiStudio configuration.</li></ul></td></tr><tr><td>tools</td><td>Objects</td><td>An object containing the configuration for the tools used by the agent. Each key in the object represents a tool name, and the corresponding value is a <code>ToolAssistantConfig</code> object. This field is only applicable when the <code>type</code> is set to <code>'tools'</code>.</td></tr><tr><td>botsplusConfig</td><td>Objects</td><td><p></p><p>An object containing the configuration for the BotsPlus agent. It is only needed when the <code>type</code> is set to <code>'botsplus'</code>. It includes the following fields:</p><ul><li><code>secret</code> (string): The secret key for authenticating with the BotsPlus service.</li><li><code>endpoint</code> (string, optional): The endpoint URL for the BotsPlus service.</li></ul></td></tr><tr><td>ekoaiStudioConfig</td><td>Objects</td><td><p></p><p>An object containing the configuration for the EkoaiStudio agent. It is only needed when the <code>type</code> is set to <code>'ekoaistudio'</code>. It includes the following fields:</p><ul><li><code>secret</code> (string): The secret key for authenticating with the EkoaiStudio service.</li><li><code>endpoint</code> (string, optional): The endpoint URL for the EkoaiStudio service.</li><li><code>workflow</code> (string): The workflow identifier for the EkoaiStudio agent to interact with.</li></ul></td></tr><tr><td>logging</td><td>Objects</td><td><p></p><p>An object containing the logging configuration for the agent. It includes the following field:</p><ul><li><code>line_notify_token</code> (string, optional): The token for sending notifications via LINE Notify on all request response of the agent</li></ul></td></tr><tr><td>systemPrompt</td><td>String</td><td>The system prompt used by the agent to provide instructions or context.</td></tr><tr><td>model</td><td>AgentModel</td><td><p></p><p>The configuration for the agent's language model. Available options include:</p><ul><li><code>'gpt-3.5-turbo-0125'</code></li><li><code>'gpt-4-0125-preview'</code></li><li><code>'claude-3-haiku-20240307'</code></li><li><code>'claude-3-sonnet-20240229'</code></li><li><code>'claude-3-opus-20240229'</code></li><li><code>'accounts/fireworks/models/llama-v3-70b-instruct'</code></li><li><code>'accounts/fireworks/models/dbrx-instruct'</code></li></ul></td></tr><tr><td>channels</td><td>Array of Objects</td><td><p></p><p>An array of channel configurations for the agent, specifying the channels through which the agent can communicate. Currently only supports <code>eko</code> channel with the following JSON format</p><ul><li>\{<br />"clientId": &lt;clientId of eko bot&gt;,<br />"channelType": "eko",<br />"clientSecret": &lt;client secret of eko bot&gt;,<br />"ekoaiUrl": &lt;api endpoint of eko bot&gt;<a href="https://sea-staging-h1.ekoapp.com&quot;,/">,</a><br />"channelId": &lt;any random ID&gt;<br />\}</li></ul></td></tr><tr><td>feature</td><td>Objects</td><td><p></p><p>Set of feature flags and configuration to enable / disable for the assistant:</p><ul><li><code>generative_dashboard</code> - set to <code>true</code> to enable Generative Dashboard feature for all conversation between all users and this assistant</li><li><code>inner_thought</code> - set to <code>true</code> to enable chain-of-thought process before providing response. This allow bots to handle more complex answer and tool chaining</li><li><code>secure_report</code> - set to <code>true</code> to secure any report generated from this assistant. User will need to have access to the same Eko network.</li></ul></td></tr></tbody></table>

**Response**

**200**

```json
{
  "status": "success"
}
```
