# Read an agent with its task and runs.

> https://koi.dog/docs/api/agents/get-agent/

`GET /api/v1/agents/{id}` · Scope: `read`

No query parameters.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The agent's id. |

## Response.

200 OK: a JSON object. The example has placeholder values.

## Request.

```sh
curl "https://app.koi.dog/api/v1/agents/$ID" \
    -H "Authorization: Bearer $KOIDOG_API_KEY"
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/agents/${process.env.ID}`, {
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
  },
});
console.log(await res.json());
```

```python
import os

import requests

r = requests.get(
    f"https://app.koi.dog/api/v1/agents/{os.environ['ID']}",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "agent": {
    "id": "string",
    "crewId": "string",
    "taskId": "string",
    "role": "manager",
    "connectionId": "string",
    "harness": "claude-code",
    …
  },
  "task": {
    "id": "string",
    "crewId": "string",
    "key": "string",
    "title": "string",
    "instructions": "string",
    "acceptance": "string",
    …
  },
  "runs": [],
  "nodeName": "string",
  …
}
```
