Ler o Atendente LiteZap
/v1/instances/{id}/attendantdesde M5btoken da instância ou adminQuando usar
Provedor, modelo, limites e uso de hoje. As chaves nunca voltam (api_key_set, audio_api_key_set).
Autenticação
Aceita o token da instância (só a própria instância) ou o token admin. Um token de outra instância recebe 403 forbidden (ou 404 not_found em webhooks de outra instância).
Parâmetros
Caminho
| Nome | Tipo | Descrição |
|---|---|---|
idobrigatório | string | Id da instância (inst_...). |
Exemplo
curl -s "$LITEZAP_URL/v1/instances/$ID/attendant" \ -H "Authorization: Bearer $LITEZAP_TOKEN"const res = await fetch("http://localhost:8787/v1/instances/inst_7f3a9c2e5b1d4086/attendant", { headers: { Authorization: `Bearer ${process.env.LITEZAP_TOKEN}` },});console.log(res.status, res.status === 204 ? "" : await res.json());import osimport requests
r = requests.get( "http://localhost:8787/v1/instances/inst_7f3a9c2e5b1d4086/attendant", headers={"Authorization": f"Bearer {os.environ['LITEZAP_TOKEN']}"}, timeout=150,)print(r.status_code, r.json() if r.content else "")package main
import ( "fmt" "io" "net/http" "os")
func main() { req, _ := http.NewRequest("GET", "http://localhost:8787/v1/instances/inst_7f3a9c2e5b1d4086/attendant", nil) req.Header.Set("Authorization", "Bearer "+os.Getenv("LITEZAP_TOKEN")) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, _ := io.ReadAll(resp.Body) fmt.Println(resp.Status, string(out))}<?phprequire 'vendor/autoload.php'; // composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client(['base_uri' => 'http://localhost:8787']);$res = $client->request('GET', '/v1/instances/inst_7f3a9c2e5b1d4086/attendant', [ 'headers' => ['Authorization' => 'Bearer ' . getenv('LITEZAP_TOKEN')], 'http_errors' => false,]);echo $res->getStatusCode(), ' ', $res->getBody(), PHP_EOL;Nos exemplos, LITEZAP_URL é a URL base (ex.: http://localhost:8787) e o token vem deLITEZAP_TOKEN (instância) ou LITEZAP_ADMIN_TOKEN.
Resposta
200 Configuração do atendente embutido.
Campos de AttendantSettings
configured | boolean | |
provider | "anthropic" | "openai" | |
model | string | |
base_url | string | |
max_tokens | integer | |
daily_call_cap | integer | |
chat_daily_call_cap | integer | |
simulate_daily_cap | integer | |
active_agent_id | string | |
vision | boolean | |
audio | AttendantAudio | |
audio.base_url | string | Servidor OpenAI-compatível; vazio com provider openai = o mesmo servidor. |
audio.transcription_model | string | Ex.: whisper-1; vazio desliga a transcrição. |
audio.speech_model | string | Ex.: gpt-4o-mini-tts; vazio desliga a voz. |
audio.voice | string | |
price_input_per_mtok | number | |
price_output_per_mtok | number | |
api_key_set | boolean | |
audio_api_key_set | boolean | |
ready | boolean | |
not_ready | string | |
transcription | boolean | |
speech | boolean | |
today | object | |
today.day | string | |
today.calls | integer | |
today.input_tokens | integer | |
today.output_tokens | integer | |
today.cost_usd | number |
Erros
| Código | HTTP | Retentável | O que fazer |
|---|---|---|---|
unauthorized | 401 | não | Envie Authorization: Bearer <token> válido. |
forbidden | 403 | não | Use o token certo (admin, ou o da própria instância). |
instance_not_found | 404 | não | Confira o id da instância. |
Todo erro usa o envelope {"error":{"code","message","retryable"}}. Tabela completa em Erros.
Outras operações de Atendente IA: Ler hook de agente · Configurar hook de agente · Remover hook de agente · Ligar ou desligar o atendente numa conversa · Últimas chamadas do atendente · Configurar provedor do atendente · Modos prontos do atendente · Listar agentes · Criar agente · Ler agente · Alterar agente · Excluir agente · Ativar agente · Simular conversa · Uso e custo do atendente

