---
title: "Listar contextos do agente"
method: GET
path: "/api/management/ai/agents/{agentId}/contexts"
tags: ["ai-agents", "agents", "contexts"]
---

# Listar contextos do agente

`GET /api/management/ai/agents/{agentId}/contexts`

Lista os contextos do agente na ordem em que são aplicados ao prompt. Em contextos do tipo `file`, `content` vem como um endereço temporário para baixar o arquivo.

## Response `200`

Sucesso

- object — Contextos do agente, na ordem de aplicação. Esta resposta não traz a chave `response`.
  - `contexts` object[] — Contextos do agente, ordenados por `order`.
    - `id` string, uuid — ID (UUID) do contexto.
    - `ai_agent_id` string, uuid — ID (UUID) do agente dono do contexto.
    - `type` 'text' | 'file' — Tipo do contexto: `text` para texto escrito à mão, `file` para arquivo enviado.
    - `content` string, nullable — Texto do contexto quando o tipo é `text`; endereço temporário para baixar o arquivo quando o tipo é `file`.
    - `mime_type` string, nullable — Tipo do arquivo enviado; nulo em contextos de texto.
    - `order` integer — Posição do contexto na sequência aplicada ao prompt, começando em zero.
    - `is_active` boolean — Indica se o contexto é aplicado ao prompt do agente.
    - `created_at` string, date-time — Data e hora de criação do contexto.
    - `updated_at` string, date-time — Data e hora da última alteração do contexto.
    - `deleted_at` string, date-time, nullable — Data e hora da exclusão lógica; nulo enquanto o contexto está ativo.

## Other responses

- `404` — Agente não encontrado

## Changes

- **2026-09-22** `d71b18b1685d` — 1 breaking, 2 warning, 2 info
  - the response property `contexts/items/content` became nullable for the status `200`
  - added the new `file` enum value to the `contexts/items/type` response property for the response status `200`
  - added the new `text` enum value to the `contexts/items/type` response property for the response status `200`
  - added the optional property `contexts/items/deleted_at` to the response with the `200` status
  - …1 more
- **2026-09-22** `b43a04f35145` — 2 warning
  - removed the optional property `contexts/items/deleted_at` from the response with the `200` status
  - removed the optional property `contexts/items/mime_type` from the response with the `200` status
- **2026-09-18** `468063611950` — 2 info
  - added the media type `application/json` for the response with the status `200`
  - added the non-success response with the status `404`

[Change history](https://skmtc.dev/olie-ai/apis/olie-api/changes/api/management/ai/agents/:agentId/contexts/get.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/d7bda7d32f67?raw)
