# List agent mode conversation items

:::::::::operation{method="GET" path="/api/2.0/genie/agents/{agent_id}/conversations/{conversation_id}/items" md="/genie/v1/agent-mode-list-conversation-items.md"}

Lists a conversation's items in chronological order, with cursor pagination.

**API scopes:** `genie`

## Path parameters

::::::::attribute{name="agent_id" type="string" required loc="path"}
The ID of the Genie agent.
::::::::

::::::::attribute{name="conversation_id" type="string" required loc="path"}
The conversation ID.
::::::::

## Query parameters

::::::::attribute{name="limit" type="integer" default="100" loc="query" constraints="1 to 100"}
Maximum number of items to return.
::::::::

::::::::attribute{name="after" type="string" loc="query"}
Pagination cursor. Pass the previous response's `last_id`.
::::::::

::::::::attribute{name="order" type="string" default="asc" enum="asc,desc" loc="query"}
Sort order. Use `asc` for oldest first or `desc` for newest first.
::::::::

## Response

The response uses the `application/json` content type.

::::::::attribute{name="object" type="string" enum="list"}
Always `"list"`.
::::::::

::::::::attribute{name="data" type="array of object"}
The conversation's output items in chronological order. User input appears as
a `message` whose ID has an `_input` suffix. Each item is polymorphic on `type`.

:::::::attribute{name="reasoning" type="object"}
The agent's reasoning. Contains `reasoning_text` content items and a status.
:::::::

:::::::attribute{name="function_call" type="object"}
An SQL query the agent ran. Contains `call_id`, the name `"execute_sql"`, and
arguments encoded as a JSON string. It is paired with `function_call_output`
by `call_id`.
:::::::

:::::::attribute{name="function_call_output" type="object"}
The query result. Its ID is always `{call_id}_output`; when completed, `output`
contains the query title followed by a Markdown table.
:::::::

:::::::attribute{name="message" type="object"}
A user question, assistant report, or system error. Assistant content contains
`output_text` chunks; table chunks include metadata for columns, preview rows,
total row count, status, and SQL.
:::::::
::::::::

::::::::attribute{name="first_id" type="string"}
ID of the first item in the page. Absent when `data` is empty.
::::::::

::::::::attribute{name="last_id" type="string"}
ID of the last item in the page. Pass it as `after` for the next page. Absent
when `data` is empty.
::::::::

::::::::attribute{name="has_more" type="boolean"}
Whether more items follow this page.
::::::::

::::::::attribute{name="status" type="string"}
Status of the latest response in the conversation.
::::::::

## Errors

| HTTP status | Error code | Description |
|---|---|---|
| `400` | `INVALID_PARAMETER_VALUE` | A query parameter is invalid, such as a `limit` outside the allowed range or an unknown `order` value. |
| `403` | `PERMISSION_DENIED` | The caller lacks CAN QUERY on the Genie agent. |
| `404` | `NOT_FOUND` | The Genie agent or conversation does not exist. |
| `429` | `RATE_LIMIT_EXCEEDED` | The per-workspace rate limit was exceeded. |
| `500` | `INTERNAL_ERROR` | An unexpected server error occurred. |

:::sample{label="Response" language="json"}
```json
{
  "object": "list",
  "data": [
    {
      "type": "message",
      "role": "user",
      "content": [
        {
          "type": "input_text",
          "text": "What were our top 10 customers by revenue last quarter?"
        }
      ],
      "id": "01f14fe4e34b..._input",
      "status": "completed"
    },
    {
      "type": "function_call",
      "id": "01f14fe4f24e...",
      "call_id": "01f14fe4f24e...",
      "status": "completed",
      "name": "execute_sql",
      "arguments": "{\"title\": \"Top 10 Customers\", \"sql\": \"SELECT customer, SUM(revenue) AS total FROM sales GROUP BY customer ORDER BY total DESC LIMIT 10\"}"
    },
    {
      "type": "function_call_output",
      "id": "01f14fe4f24e..._output",
      "call_id": "01f14fe4f24e...",
      "status": "completed",
      "output": "Top 10 Customers\n\n| customer | total |\n| --- | --- |\n| Acme Corp | 1500000 |"
    },
    {
      "type": "message",
      "id": "01f14fe5383f...",
      "role": "assistant",
      "status": "completed",
      "content": [
        {
          "type": "output_text",
          "text": "Acme Corp leads with $1.5M [1](https://<workspace-url>/genie/rooms/<space_id>/chats/<conversation_id>?o=<workspace_id>&gra_focus=<attachment_id>)."
        }
      ]
    }
  ],
  "first_id": "01f14fe4e34b..._input",
  "last_id": "01f14fe5383f...",
  "has_more": false,
  "status": "completed"
}
```
:::

:::::::::
