> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionicfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The agent object

> Create and manage your platform's AI agent identities from your server.

```json Agent theme={null}
{
  "id": "agt_3Wd9Kp2Lm7Xq4R",
  "object": "agent",
  "owner_account_id": "mer_9Jt4Wx8Qn2Lp6V",
  "name": "Booking assistant",
  "handle": "@acme-booking",
  "description": "Books visits for front-desk staff.",
  "metadata": { "team": "front-desk" },
  "avatar_hue": null,
  "status": "active",
  "version": 1,
  "created_by": "sk_4Rt8Lm2Qx7Vn3Kp9Wd5Hs1Bz",
  "created_at": 1793782800,
  "updated_at": 1793782800,
  "last_active_at": null
}
```

An agent (`agt_…`) is the identity of an AI agent your platform runs. Your
server creates and manages it with a platform secret key. The identity holds no
access to any business: a business allows the agent through an
agent grant request, and the agent's
keys are issued in the Ionic dashboard. For the full flow, see
[Manage your platform's agents](https://docs.ionicfi.com/connect/agents.md).

## Attributes

**id** `string`

Unique identifier for the agent (`agt_…`).

**owner\_account\_id** `string`

The Account that owns the agent.

**name** `string`

The agent's display name, up to 120 characters.

**handle** `string`

The agent's permanent handle, with a leading `@`. It starts with your
Account's handle prefix.

**description** `string`

What the agent does, up to 2,000 characters. An empty string when not set.

**metadata** `object`

Up to 50 string entries for your own use.

**avatar\_hue** `integer | null`

Hue of the agent's tile, from 0 to 359. `null` uses the color derived from
the handle.

**status** `string`

`active`, `suspended`, or `deactivated`. See [Statuses](#statuses).

**version** `integer`

Increases with each change to the identity. Send it as `expected_version`
when you update, suspend, resume, or deactivate the agent.

**created\_by** `string`

The ID of the secret key (`sk_…`) that created the agent, or the dashboard
user (`user_…`). It never contains a key's secret.

**last\_active\_at** `integer | null`

Unix timestamp of the agent's most recent activity, or `null` before any.

## Endpoints

| Endpoint | Permission | Use it for |
| - | - | - |
| [Create an agent](https://docs.ionicfi.com/api-reference/agents/create-an-agent.md) | `agents:write` | Create an identity under your handle prefix. |
| [List your agents](https://docs.ionicfi.com/api-reference/agents/list-your-agents.md) | `agents:read` | Page through the agents your Account owns. |
| [Retrieve an agent](https://docs.ionicfi.com/api-reference/agents/retrieve-an-agent.md) | `agents:read` | Read an agent's current status and version. |
| [Update an agent](https://docs.ionicfi.com/api-reference/agents/update-an-agent.md) | `agents:write` | Change the name, description, metadata, or tile color. |
| [Suspend an agent](https://docs.ionicfi.com/api-reference/agents/suspend-an-agent.md) | `agents:write` | Pause the agent in both modes. |
| [Resume an agent](https://docs.ionicfi.com/api-reference/agents/resume-an-agent.md) | `agents:write` | Remove a suspension you applied. |
| [Deactivate an agent](https://docs.ionicfi.com/api-reference/agents/deactivate-an-agent.md) | `agents:write` | Retire the agent permanently. |
| [Retrieve your agent handle prefix](https://docs.ionicfi.com/api-reference/agents/retrieve-your-agent-handle-prefix.md) | `agents:read` | Read your claimed prefix, or check a candidate. |

## Statuses

| Status | Meaning |
| - | - |
| `active` | The agent can act for any business that has allowed it. |
| `suspended` | Paused by you or by Ionic. Resuming removes your suspension; one applied by Ionic stays in place. |
| `deactivated` | Retired permanently. The agent cannot be updated or resumed, and its handle stays reserved. |

## Rules

* Use a platform secret key that holds `agents:read`, `agents:write`, or both,
  and send requests without `Ionic-Account`. Write access does not include
  read access.
* Your Platform Program must allow delegated API access in the key's mode and
  include the permission.
* An agent identity belongs to both modes. A test key and a live key update,
  suspend, and deactivate the same agent.
* An owner or admin claims your Account's handle prefix once, permanently,
  under **Agents** in the dashboard. Creating an agent before then returns
  `409 AGENT_HANDLE_PREFIX_REQUIRED`.
* Send the agent's current `version` as `expected_version` with every change.
  A stale version returns `409 AGENT_VERSION_CONFLICT`: retrieve the agent and
  send a new request with a new `Idempotency-Key`.
* Send an `Idempotency-Key` with every change. To retry, send the same key with
  the same body bytes. For at least 24 hours, a retry returns the original
  result without repeating the change. See [Idempotency](https://docs.ionicfi.com/api-reference/idempotency.md).
* An agent connected through MCP cannot be changed with this API. Those
  changes return `403 AGENT_MCP_MANAGED`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.