Skip to main content
Your platform can create, read, update, suspend, resume, and deactivate its Agent identities through the API. The Account that owns the platform credential owns each Agent. An Agent needs a separate grant from a business before it can act for that business. Ionic must enable Agent management for your platform. Its Program must allow delegated API access in your key’s mode and include the requested Agent permission in its permission ceiling.

Prepare your platform

  1. Have an owner or admin open Agents in the dashboard and claim your Account’s handle prefix. This claim is permanent. A prefix of acme permits handles such as acme-booking.
  2. Open your platform’s credentials in the dashboard and select the Agent management preset for a new secret key. It contains agents:read and agents:write. Request only the permissions your integration needs.
  3. Store the secret on your server. Send it as a bearer credential. Omit Ionic-Account and dashboard session cookies from Agent identity requests.
agents:read and agents:write are independent: write access does not include read access. Ordinary Account keys and Agent runtime keys cannot use these management operations.
Agent identity is shared by test and live. An authorized test key can update, suspend, resume, or deactivate the same Agent used in live mode. Grants and runtime credentials keep their existing mode boundaries.

Create an Agent

Read the claimed prefix with GET /v1/agents/handle_prefix. If prefix is null, claim it in the dashboard before creating an Agent. Creation without a claimed prefix returns 409 AGENT_HANDLE_PREFIX_REQUIRED.
The 201 response is the Agent identity:
Save id and version. created_by is the public credential record ID for an API-created Agent: sk_ followed by 24 letters or digits. A dashboard-created Agent has a user_ creator. These IDs contain no credential secret. Activity attributes API changes to the credential, without assigning a human actor. Agent runtime keys are issued, rotated, and revoked in the dashboard. Creating an identity returns no runtime key.

Read and change the identity

The list returns data, has_more, and a next_cursor when another page exists. Send that cursor as starting_after. limit defaults to 20 and accepts 1–100. The list includes your Account’s Agents across both modes. Updates require the current expected_version and at least one editable field:
Omitted fields stay unchanged. metadata replaces the entire map; send {} to clear it. Set avatar_hue to an integer from 0 to 359, or to null to restore the color derived from the handle. description: null clears the description. The owner, handle, and creator are immutable. Suspend, resume, and deactivate take expected_version and a nonblank reason:
Suspension applies the owner’s restriction. Resume removes that restriction; an Ionic system restriction can keep the returned status suspended. Deactivation is permanent. A deactivated Agent cannot be edited or resumed. A stale version returns 409 AGENT_VERSION_CONFLICT. Retrieve the Agent, review the intervening change, and submit a new operation with its current version and a new retry key. Runtime activity and changes to last_active_at do not advance the identity version. Agents connected through MCP cannot be changed through this management API, including after the MCP connection is disconnected. Those mutations return 403 AGENT_MCP_MANAGED. A metadata.source value does not change that rule.

Retry a mutation

Every machine POST above requires one nonblank Idempotency-Key, at most 255 bytes, and a JSON body no larger than 64 KiB. A larger body returns 413 REQUEST_TOO_LARGE. Keep the same key and identical body bytes when retrying an operation. Even different whitespace counts as a different body and returns 422 IDEMPOTENCY_BODY_MISMATCH. Retry keys are scoped to the owning Account, credential, operation, and target Agent across both modes. Another credential cannot replay the result. Ionic retains successful response snapshots for at least 24 hours. A retry checks the current Account, credential, permissions, and Program before returning the saved response. A revoked key or removed permission cannot replay an earlier success. The saved response is returned before checking the Agent’s current version, so an unchanged retry does not repeat the mutation. A snapshot describes the original result. For the Agent’s current status, retrieve it again. An earlier active response does not establish current runtime access. After the retention window, retrieve the Agent before deciding whether to submit another operation.

Connect an Agent to a merchant

Keep the Agent owned by your platform. Use the connected merchant’s Account ID in an Agent grant request:
  1. With a platform secret key that has platform:act, call POST /v1/agent_grant_requests with agent_id, the merchant’s account, and the requested permissions. Omit Ionic-Account from this request.
  2. The business must have an active Connection in the key’s mode. Each permission must be grantable to Agents, allowed by that Connection, and within your Program’s permission ceiling.
  3. Send the returned url to the business owner. The owner approves or declines in the dashboard within seven days. An admin can view the request but cannot decide it.
  4. Retrieve GET /v1/agent_grant_requests/{id} to read the decision. After approval, issue the Agent’s platform key in the dashboard. The Agent uses that key with Ionic-Account set to the merchant’s Account ID for supported runtime operations.
Platform secret keys include platform:act, so the same key can submit a grant request when the current Connection and Program allow it. The Agent identity scopes do not grant the business’s consent. An approved grant authorizes only its permissions in its mode. For example, an Agent key with customers:read can call GET /v1/customers/{id}. An approved request remains approved if the business later revokes its grant. Read the nested agent_grant.status for the grant’s current status. The agent_grant_request.updated event reports approval, decline, or cancellation; expiry and later grant revocation do not emit that request-update event.