> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tess.im/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Employee from Agent

> Creates a new Digital Employee linked to an existing agent.

### **Code Examples**

<CodeGroup>
  ```http cURL theme={null}
  curl --request POST \
    --url 'https://api.tess.im/digital-employees/agents/99' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --header 'x-workspace-id: YOUR_WORKSPACE_ID' \
    --data '{
      "name": "Finance Ops",
      "execution_mode": "agent",
      "execution_approval_mode": "autonomous",
      "heartbeat_cron": "0 9 * * 1-5",
      "execution_timezone": "America/Sao_Paulo"
    }'
  ```

  ```json Node.js theme={null}
  const axios = require('axios');

  const agentId = 99;

  const config = {
    method: 'post',
    url: `https://api.tess.im/digital-employees/agents/${agentId}`,
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
      'x-workspace-id': 'YOUR_WORKSPACE_ID'
    },
    data: {
      name: 'Finance Ops',
      execution_mode: 'agent',
      execution_approval_mode: 'autonomous',
      heartbeat_cron: '0 9 * * 1-5',
      execution_timezone: 'America/Sao_Paulo'
    }
  };

  try {
    const response = await axios(config);
    console.log(response.data);
  } catch (error) {
    console.error(error);
  }
  ```

  ```python Python theme={null}
  import requests

  agent_id = 99
  url = f"https://api.tess.im/digital-employees/agents/{agent_id}"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
      "x-workspace-id": "YOUR_WORKSPACE_ID"
  }
  payload = {
      "name": "Finance Ops",
      "execution_mode": "agent",
      "execution_approval_mode": "autonomous",
      "heartbeat_cron": "0 9 * * 1-5",
      "execution_timezone": "America/Sao_Paulo"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```php PHP theme={null}
  <?php
  $agentId = 99;
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.tess.im/digital-employees/agents/{$agentId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => json_encode([
      "name" => "Finance Ops",
      "execution_mode" => "agent",
      "execution_approval_mode" => "autonomous",
      "heartbeat_cron" => "0 9 * * 1-5",
      "execution_timezone" => "America/Sao_Paulo"
    ]),
    CURLOPT_HTTPHEADER => [
      "Authorization: Bearer YOUR_API_KEY",
      "Content-Type: application/json",
      "x-workspace-id: YOUR_WORKSPACE_ID"
    ]
  ]);

  $response = curl_exec($curl);
  curl_close($curl);
  echo $response;
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  int agentId = 99;
  String body = """
      {
        "name": "Finance Ops",
        "execution_mode": "agent",
        "execution_approval_mode": "autonomous",
        "heartbeat_cron": "0 9 * * 1-5",
        "execution_timezone": "America/Sao_Paulo"
      }
      """;

  HttpClient client = HttpClient.newHttpClient();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.tess.im/digital-employees/agents/" + agentId))
      .header("Authorization", "Bearer YOUR_API_KEY")
      .header("Content-Type", "application/json")
      .header("x-workspace-id", "YOUR_WORKSPACE_ID")
      .POST(HttpRequest.BodyPublishers.ofString(body))
      .build();

  HttpResponse<String> response = client.send(request,
      HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```

  ```go Go theme={null}
  package main

  import (
      "fmt"
      "io/ioutil"
      "net/http"
      "strings"
  )

  func main() {
      agentId := 99
      payload := strings.NewReader(`{
          "name": "Finance Ops",
          "execution_mode": "agent",
          "execution_approval_mode": "autonomous",
          "heartbeat_cron": "0 9 * * 1-5",
          "execution_timezone": "America/Sao_Paulo"
      }`)

      client := &http.Client{}
      url := fmt.Sprintf("https://api.tess.im/digital-employees/agents/%d", agentId)
      req, _ := http.NewRequest("POST", url, payload)
      req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Add("Content-Type", "application/json")
      req.Header.Add("x-workspace-id", "YOUR_WORKSPACE_ID")
      resp, _ := client.Do(req)
      defer resp.Body.Close()
      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```jsonnet .NET theme={null}
  using System.Net.Http;
  using System.Text;

  int agentId = 99;

  using var client = new HttpClient();
  client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_KEY");
  client.DefaultRequestHeaders.Add("x-workspace-id", "YOUR_WORKSPACE_ID");

  var json = """
      {
        "name": "Finance Ops",
        "execution_mode": "agent",
        "execution_approval_mode": "autonomous",
        "heartbeat_cron": "0 9 * * 1-5",
        "execution_timezone": "America/Sao_Paulo"
      }
      """;

  var content = new StringContent(json, Encoding.UTF8, "application/json");
  var response = await client.PostAsync(
      $"https://api.tess.im/digital-employees/agents/{agentId}", content);
  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'json'

  agent_id = 99
  uri = URI("https://api.tess.im/digital-employees/agents/#{agent_id}")
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri)
  request['Authorization'] = 'Bearer YOUR_API_KEY'
  request['Content-Type'] = 'application/json'
  request['x-workspace-id'] = 'YOUR_WORKSPACE_ID'
  request.body = {
    name: 'Finance Ops',
    execution_mode: 'agent',
    execution_approval_mode: 'autonomous',
    heartbeat_cron: '0 9 * * 1-5',
    execution_timezone: 'America/Sao_Paulo'
  }.to_json

  response = http.request(request)
  puts response.read_body
  ```
</CodeGroup>

### **Headers**

<Note>Pass your API key as a Bearer token in the `Authorization` header.</Note>

<ParamField header="x-workspace-id" type="integer" required>
  ID of the workspace.
</ParamField>

### **Path Parameters**

<ParamField path="agentId" type="integer" required>
  ID of the existing agent to link the new Digital Employee to.
</ParamField>

### **Request Body**

<ParamField body="name" type="string" required>
  Employee name. Max 255 characters.
</ParamField>

<ParamField body="execution_mode" type="string">
  Execution mode. Values: `agent` (autonomous) or `chat`. Default: `agent`.
</ParamField>

<ParamField body="execution_approval_mode" type="string">
  Whether runs require manual approval. Values: `autonomous` or `approval_required`.
</ParamField>

<ParamField body="heartbeat_cron" type="string">
  Cron expression for scheduled runs (e.g. `0 9 * * 1-5`). Max 128 characters.
</ParamField>

<ParamField body="heartbeat_schedule_json" type="object">
  Schedule builder config (alternative to `heartbeat_cron`).
</ParamField>

<ParamField body="execution_timezone" type="string">
  Timezone for schedule execution (e.g. `America/Sao_Paulo`). Max 64 characters.
</ParamField>

<ParamField body="default_interval_seconds" type="integer">
  Minimum seconds between runs. Either `0` (no limit) or `>= 60`.
</ParamField>

<ParamField body="system_prompt_override" type="string">
  Custom system prompt for this employee. Max 4096 characters.
</ParamField>

<ParamField body="model_override" type="string">
  Override the AI model (e.g. `tess-6`). Max 100 characters.
</ParamField>

<ParamField body="tools_override" type="string">
  Override tool configuration. Max 255 characters.
</ParamField>

<ParamField body="search_intelligence_enabled" type="boolean">
  Enable Search Intelligence for runs.
</ParamField>

<ParamField body="connectors_json" type="array">
  Array of connector identifiers to enable.
</ParamField>

<ParamField body="skills_override_json" type="array">
  Array of skill identifiers to override.
</ParamField>

<ParamField body="max_consecutive_failures" type="integer">
  Max consecutive run failures before auto-pause. Range: 1–100.
</ParamField>

<ParamField body="execution_order" type="integer">
  Execution priority order. Range: 0–999.
</ParamField>

<ParamField body="share_memory_with_owner" type="boolean">
  Whether the employee shares memory with its owner agent.
</ParamField>

<ParamField body="avatar" type="string">
  Avatar image URL. Max 2048 characters.
</ParamField>

<ParamField body="avatar_thumbnail" type="string">
  Thumbnail image URL. Max 2048 characters.
</ParamField>

<ParamField body="personality_type" type="string">
  MBTI personality type (e.g. `INTJ`).
</ParamField>

<ParamField body="wake_policy_json" type="object">
  Wake policy configuration object.
</ParamField>

<ParamField body="budget_policy_json" type="object">
  Budget policy configuration object.
</ParamField>

<ParamField body="goal_json" type="object">
  Goal configuration object.
</ParamField>

<ParamField body="work_policy_json" type="object">
  Work policy configuration object.
</ParamField>

<ParamField body="voice_realtime_voice" type="string">
  Voice identifier for real-time voice mode.
</ParamField>

### **Response**

```json theme={null}
{
  "data": {
    "id": 124,
    "agent_id": 99
  }
}
```
