Skip to content

Get Agent by ID

client.agents.retrieve(stringagentID, RequestOptionsoptions?): Agent { id, acp_type, created_at, 9 more }
GET/agents/{agent_id}

Get an agent by its unique ID.

ParametersExpand Collapse
agentID: string
ReturnsExpand Collapse
Agent { id, acp_type, created_at, 9 more }
id: string

The unique identifier of the agent.

acp_type: AcpType

The type of the ACP Server (Either sync or async)

One of the following:
"sync"
"async"
"agentic"
created_at: string

The timestamp when the agent was created

formatdate-time
description: string

The description of the action.

name: string

The unique name of the agent.

updated_at: string

The timestamp when the agent was last updated

formatdate-time
agent_input_type?: "text" | "json" | null

The type of input the agent expects.

One of the following:
"text"
"json"
production_deployment_id?: string | null

ID of the current production deployment.

registered_at?: string | null

The timestamp when the agent was last registered

formatdate-time
registration_metadata?: Record<string, unknown> | null

The metadata for the agent’s registration.

status?: "Ready" | "Failed" | "Unknown" | 3 more

The status of the action, indicating if it’s building, ready, failed, etc.

One of the following:
"Ready"
"Failed"
"Unknown"
"Deleted"
"Unhealthy"
"BuildOnly"
status_reason?: string | null

The reason for the status of the action.

Get Agent by ID

import Agentex from 'agentex';

const client = new Agentex({
  apiKey: process.env['AGENTEX_SDK_API_KEY'], // This is the default and can be omitted
});

const agent = await client.agents.retrieve('agent_id');

console.log(agent.id);
{
  "id": "id",
  "acp_type": "sync",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "agent_input_type": "text",
  "production_deployment_id": "production_deployment_id",
  "registered_at": "2019-12-27T18:11:19.117Z",
  "registration_metadata": {
    "foo": "bar"
  },
  "status": "Ready",
  "status_reason": "status_reason"
}
Returns Examples
{
  "id": "id",
  "acp_type": "sync",
  "created_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "name": "name",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "agent_input_type": "text",
  "production_deployment_id": "production_deployment_id",
  "registered_at": "2019-12-27T18:11:19.117Z",
  "registration_metadata": {
    "foo": "bar"
  },
  "status": "Ready",
  "status_reason": "status_reason"
}