---
title: "Diagnostics for one BotInstance of an AI Agent (v2)"
method: GET
path: "/v2/agents/{idOrAddress}/bot-instances/{botInstanceId}/diag"
tags: ["Agents"]
---

# Diagnostics for one BotInstance of an AI Agent (v2)

`GET /v2/agents/{idOrAddress}/bot-instances/{botInstanceId}/diag`

## Request

- Base URL: `https://api.chat.ethora.com`
- URL: `https://api.chat.ethora.com/v2/agents/{idOrAddress}/bot-instances/{botInstanceId}/diag`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Returns the stored BotInstance plus the AI service's live view of it
(XMPP connected or not, joined rooms, last error, recent
conversations). When the AI service cannot be reached the call still
succeeds, with `aiService: null` and the reason in `aiServiceError`.

For a private agent, owner only. For someone else's public agent,
only bots in Apps the caller manages (403 otherwise). Supports
`User JWT` and `B2B Server JWT`.

## Path parameters

- `idOrAddress` string, required
- `botInstanceId` string, required

## Response `200`

```
{
  ok: true,
  botInstance: {
    id: string, agentId: string, appId: string, xmppUsername: string,
    status: 'on'|'off', joinedRooms: string[], lastActiveAt: ISODate|null
  },
  aiService: object|null,     // live state reported by the AI service
  aiServiceError: string|null
}
```

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: ``` { error: 'Forbidden', code: 'FORBIDDEN' } ```
- `404`: `AGENT_NOT_FOUND`, or `BOT_INSTANCE_NOT_FOUND` (no such BotInstance for this agent).
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/ethora/apis/platform-api.md) · [All operations](https://skmtc.dev/ethora/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ethora/apis/platform-api/revisions/01b6e64378ee?raw)
