---
title: "Atualizar contexto do agente"
method: PUT
path: "/api/management/ai/agents/{agentId}/contexts/{contextId}"
tags: ["ai-agents", "agents", "contexts"]
---

# Atualizar contexto do agente

`PUT /api/management/ai/agents/{agentId}/contexts/{contextId}`

Atualiza um contexto do agente; o tipo não pode ser trocado. Em um contexto de texto, `content` é obrigatório. Em um contexto de arquivo, envie a requisição como `multipart/form-data` com um novo `file`, e o arquivo anterior é apagado.

## Request body

- object
  - `content` string
  - `is_active` boolean

## Response `200`

Sucesso

- object
  - `id` string
  - `ai_agent_id` string
  - `type` string
  - `content` string
  - `order` integer
  - `is_active` boolean
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `404` — Contexto não encontrado
- `422` — Erro de validação

## Changes

- **2026-09-22** `b43a04f35145` — 2 warning
  - removed the optional property `deleted_at` from the response with the `200` status
  - removed the optional property `mime_type` from the response with the `200` status
- **2026-09-18** `468063611950` — 4 info
  - added optional request body
  - added the media type `application/json` for the response with the status `200`
  - added the non-success response with the status `404`
  - added the non-success response with the status `422`

[Change history](https://skmtc.dev/olie-ai/apis/olie-api/changes/api/management/ai/agents/:agentId/contexts/:contextId/put.md)

---

[API](https://skmtc.dev/olie-ai/apis/olie-api.md) · [All operations](https://skmtc.dev/olie-ai/apis/olie-api/llms.txt) · [OpenAPI document](https://skmtc.dev/olie-ai/apis/olie-api/revisions/b43a04f35145?raw)
