---
docId: doc_8c3eaa8266324133b1bd60e13a67275d
title: Get an agent
description: "Retrieves agent details and the versions used by its draft and publication."
api:
  group: agentes
  auth: bearer
  operations:
    - operationId: getAgent
      method: GET
      path: '/v1/agents/{agentId}'
      postmanName: Get an agent
---

<script>
  import { Ways } from '$lib/components';
</script>

# Get an agent

Check an agent’s details and read `hasUnpublishedChanges` to see whether changes are waiting to be published. The response includes its name, photo, status, owners, draft version and published version.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl https://api.platic.ai/v1/agents/$AGENT_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.get("agent_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent id | ✓ |

## Response

```json
{
  "status": "success",
  "data": {
    "id": "Xq8mTe2LwP4kZ1aB9cDf",
    "name": "Sales",
    "imageUrl": "/images/agents/avatars/p12.jpg",
    "status": "active",
    "owners": ["ana@acme.com"],
    "draft": { "versionId": "v4", "number": 4 },
    "publication": { "versionId": "v3", "number": 3 },
    "hasUnpublishedChanges": true,
    "createdAt": "2026-10-28T12:00:00.000Z"
  }
}
```

## Response fields

| Field | Description |
|-------|-------------|
| `id` | Agent id |
| `name` | Agent name. It isn't part of the versions: it is the same in all of them |
| `imageUrl` | URL or path of the agent’s photo. Platica assigns one when the agent is created if no photo is provided |
| `status` | `active` or `inactive` |
| `owners` | Owners' emails |
| `draft.versionId` | Version the draft is on, for example `v4` |
| `draft.number` | Number of that version |
| `publication.versionId` | Published version, the one that answers your contacts |
| `publication.number` | Number of that version |
| `hasUnpublishedChanges` | `true` when the draft has changes that aren't published |
| `createdAt` | Creation date in ISO 8601 format |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `404` | `AGENT_NOT_FOUND` | The agent doesn't exist in the workspace or was deleted |

```json
{
  "code": 404,
  "error": "Not Found - The resource doesn't exist",
  "details": {
    "code": "AGENT_NOT_FOUND",
    "message": "Agent Xq8mTe2LwP4kZ1aB9cDf not found"
  }
}
```

## Notes

- This response does not include the configuration. Read it with [Get the draft](/api-reference/agents/drafts/get) or [Get a version](/api-reference/agents/versions/get).
- To change `name`, `imageUrl`, `status` or `owners`, use [Update an agent](/api-reference/agents/update).
