> ## 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.

# Atualizar Digital Employee

> Atualiza um ou mais campos de um digital employee existente.

### **Exemplos de Código**

<CodeGroup>
  ```http cURL theme={null}
  curl --request PUT \
    --url 'https://api.tess.im/digital-employees/123' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --header 'x-workspace-id: YOUR_WORKSPACE_ID' \
    --data '{
      "name": "Finance Ops Updated",
      "status": "active",
      "execution_approval_mode": "approval_required"
    }'
  ```

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

  const employeeId = 123;

  const config = {
    method: 'put',
    url: `https://api.tess.im/digital-employees/${employeeId}`,
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
      'x-workspace-id': 'YOUR_WORKSPACE_ID'
    },
    data: {
      name: 'Finance Ops Updated',
      status: 'active',
      execution_approval_mode: 'approval_required'
    }
  };

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

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

  employee_id = 123
  url = f"https://api.tess.im/digital-employees/{employee_id}"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
      "x-workspace-id": "YOUR_WORKSPACE_ID"
  }
  payload = {
      "name": "Finance Ops Updated",
      "status": "active",
      "execution_approval_mode": "approval_required"
  }

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

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

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.tess.im/digital-employees/{$employeeId}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_POSTFIELDS => json_encode([
      "name" => "Finance Ops Updated",
      "status" => "active",
      "execution_approval_mode" => "approval_required"
    ]),
    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 employeeId = 123;
  String body = """
      {
        "name": "Finance Ops Updated",
        "status": "active",
        "execution_approval_mode": "approval_required"
      }
      """;

  HttpClient client = HttpClient.newHttpClient();
  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.tess.im/digital-employees/" + employeeId))
      .header("Authorization", "Bearer YOUR_API_KEY")
      .header("Content-Type", "application/json")
      .header("x-workspace-id", "YOUR_WORKSPACE_ID")
      .PUT(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() {
      employeeId := 123
      payload := strings.NewReader(`{
          "name": "Finance Ops Updated",
          "status": "active",
          "execution_approval_mode": "approval_required"
      }`)

      client := &http.Client{}
      url := fmt.Sprintf("https://api.tess.im/digital-employees/%d", employeeId)
      req, _ := http.NewRequest("PUT", 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 employeeId = 123;

  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 Updated",
        "status": "active",
        "execution_approval_mode": "approval_required"
      }
      """;

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

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

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

  request = Net::HTTP::Put.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 Updated',
    status: 'active',
    execution_approval_mode: 'approval_required'
  }.to_json

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

### **Headers**

<Note>Passe sua chave de API como Bearer token no header `Authorization`.</Note>

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

### **Parâmetros de Caminho**

<ParamField path="employeeId" type="integer" required>
  ID do digital employee a ser atualizado.
</ParamField>

### **Corpo da Requisição**

Todos os campos são opcionais. Apenas os campos informados serão atualizados.

<ParamField body="name" type="string">
  Nome do employee. Máximo de 255 caracteres.
</ParamField>

<ParamField body="status" type="string">
  Define o status do employee. Valores: `idle` ou `active`.
</ParamField>

<ParamField body="execution_mode" type="string">
  Modo de execução. Valores: `agent` (autônomo) ou `chat`.
</ParamField>

<ParamField body="execution_approval_mode" type="string">
  Define se as execuções requerem aprovação manual. Valores: `autonomous` ou `approval_required`.
</ParamField>

<ParamField body="heartbeat_cron" type="string">
  Expressão cron para execuções agendadas (ex.: `0 9 * * 1-5`). Máximo de 128 caracteres.
</ParamField>

<ParamField body="heartbeat_schedule_json" type="object">
  Configuração do construtor de agendamento (alternativa ao `heartbeat_cron`).
</ParamField>

<ParamField body="execution_timezone" type="string">
  Fuso horário para execução do agendamento (ex.: `America/Sao_Paulo`). Máximo de 64 caracteres.
</ParamField>

<ParamField body="default_interval_seconds" type="integer">
  Intervalo mínimo em segundos entre execuções. Deve ser `0` (sem limite) ou `>= 60`.
</ParamField>

<ParamField body="system_prompt_override" type="string">
  Prompt de sistema personalizado para este employee. Máximo de 4096 caracteres.
</ParamField>

<ParamField body="model_override" type="string">
  Substitui o modelo de IA (ex.: `tess-6`). Máximo de 100 caracteres.
</ParamField>

<ParamField body="tools_override" type="string">
  Substitui a configuração de ferramentas. Máximo de 255 caracteres.
</ParamField>

<ParamField body="search_intelligence_enabled" type="boolean">
  Ativa o Search Intelligence para as execuções.
</ParamField>

<ParamField body="connectors_json" type="array">
  Array de identificadores de conectores a habilitar.
</ParamField>

<ParamField body="skills_override_json" type="array">
  Array de identificadores de skills a substituir.
</ParamField>

<ParamField body="max_consecutive_failures" type="integer">
  Número máximo de falhas consecutivas antes da pausa automática. Intervalo: 1–100.
</ParamField>

<ParamField body="execution_order" type="integer">
  Ordem de prioridade de execução. Intervalo: 0–999.
</ParamField>

<ParamField body="share_memory_with_owner" type="boolean">
  Define se o employee compartilha memória com seu agente proprietário.
</ParamField>

<ParamField body="knowledge_base_file_ids" type="array">
  Array de IDs de arquivos para a base de conhecimento. Máximo de 20 entradas.
</ParamField>

<ParamField body="avatar" type="string">
  URL da imagem de avatar. Máximo de 2048 caracteres.
</ParamField>

<ParamField body="avatar_thumbnail" type="string">
  URL da imagem de miniatura. Máximo de 2048 caracteres.
</ParamField>

<ParamField body="personality_type" type="string">
  Tipo de personalidade MBTI (ex.: `INTJ`).
</ParamField>

<ParamField body="wake_policy_json" type="object">
  Objeto de configuração da política de ativação.
</ParamField>

<ParamField body="budget_policy_json" type="object">
  Objeto de configuração da política de orçamento.
</ParamField>

<ParamField body="goal_json" type="object">
  Objeto de configuração de objetivo.
</ParamField>

<ParamField body="work_policy_json" type="object">
  Objeto de configuração da política de trabalho.
</ParamField>

<ParamField body="voice_realtime_voice" type="string">
  Identificador de voz para o modo de voz em tempo real.
</ParamField>

<ParamField body="delegation_config_json" type="object">
  Objeto de configuração de delegação. Campos suportados:

  * `trigger`: `on_delegate_tag` | `on_schedule` | `on_parent_complete`
  * `parallel`: boolean — executar filhos em paralelo
  * `context_mode`: `summary` | `full` | `none`
  * `max_concurrent_children`: inteiro (1–10)
  * `inherit_budget`: boolean
  * `auto_delegate_on_schedule`: boolean
</ParamField>

### **Resposta**

```json theme={null}
{
  "data": {
    "id": 123,
    "name": "Finance Ops Updated",
    "status": "active"
  }
}
```
