Skip to contentSkip to page list

Docs

Get Agents

Reads the latest version unless label or version is given. The id also takes a suffix: agent_1:production, agent_1:3 or agent_1:latest.

GET/api/v1/agents/{id}
Request and response examples
request.py
import osimport requests​origin = "https://app.langwatch.ai"path = "/api/v1/agents/<id>"api_key = os.environ["LANGWATCH_API_KEY"]headers = {    "X-Auth-Token": api_key,}​response = requests.get(    origin + path,    headers=headers,)print(response.json())

Success

application/json · Generated from schema

{  "id": "string",  "name": "string",  "type": "signature",  "config": {},  "environment": "string",  "ownerUserId": "string",  "hostLabel": "string",  "lastSeenAt": "2026-01-01T00:00:00Z",  "parameters": [    {      "name": "string",      "description": "string",      "defaultValue": "string",      "secret": false,      "type": "string",      "options": [        "string"      ],      "required": false    }  ],  "owner": {    "userId": "string",    "name": "string"  },  "status": "online",  "instances": [    {      "instanceId": "string",      "hostname": "string",      "username": "string",      "pid": 0,      "label": "string",      "sdk": {        "name": "string",        "version": "string",        "language": "string"      },      "connectedAt": "2026-01-01T00:00:00Z",      "inflight": 0,      "maxConcurrency": 0    }  ],  "selectable": false,  "notSelectableReason": "owned_by_another_person",  "version": 0,  "labels": [    {      "label": "string",      "version": 0    }  ],  "createdBy": {    "id": "string",    "name": "string"  },  "updatedBy": {    "id": "string",    "name": "string"  },  "createdAt": "2026-01-01T00:00:00Z",  "updatedAt": "2026-01-01T00:00:00Z",  "platformUrl": "string"}
api-reference/agents/get-agents

Authorization

X-Auth-Tokenstringheaderrequired

Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.

Path parameters

idstringrequired

The agent id.

At least 1 character

Query parameters

labelstring

A deploy label, for example production. Omit both to read the latest version.

At least 1 characterUp to 64 characters
versioninteger

A version number.

Maximum 9007199254740991

Responses

200

Success

application/json

idstringrequired
namestringrequired
typestringrequired

The kind of agent. A connected agent is registered from code by the SDK and cannot be created or reconfigured through this API.

One of"signature""code""workflow""http""connected""voice"
configobject | nullrequired
Option 1object
Option 2null
environmentstring | nullrequired

The environment a connected agent registered with, for example production or development. Null for every other kind.

ownerUserIdstring | nullrequired

The user a personal development agent belongs to. Only that user can run simulations against it. Null when the agent is shared.

hostLabelstring | nullrequired

The machine a development agent registered from with a project or service key. Null when the agent is personal or shared.

lastSeenAtstring (date-time) | nullrequired

When an instance of a connected agent was last connected. Null for every other kind.

Option 1string (date-time)
Option 2null
parametersobject[]required

The run parameters a connected agent declares from its function signature: name, type, options, default and description. Empty for every other kind.

namestringrequired
At least 1 character
descriptionstring
defaultValuestring | number | boolean
secretboolean
typestring
One of"string""number""boolean"
optionsstring | number | boolean[]
requiredboolean
ownerobject | nullrequired

The person a personal development agent belongs to. Null when the agent is shared or host-scoped.

Option 1object
userIdstringrequired
namestring | nullrequired
Option 2null
statusstringrequired

online while at least one process running the connected agent is connected; offline otherwise, and always for every other kind.

One of"online""offline"
instancesobject[]required

The processes currently connected for a connected agent: hostname, user, pid, SDK and how many calls each has in flight. Empty for every other kind.

instanceIdstringrequired
hostnamestringrequired
usernamestringrequired
pidnumberrequired
labelstring | nullrequired
sdkobjectrequired
connectedAtstring (date-time)required
inflightnumberrequired
maxConcurrencynumberrequired
selectablebooleanrequired

Whether the credential making this request can run simulations against the agent. False for a personal development agent that belongs to somebody else, which is listed all the same so it can be told apart from the other agents of the same name.

notSelectableReasonstring | nullrequired

Why the agent cannot be run by this credential. Null when it can.

Option 1string
Option 2null
versioninteger | nullrequired

The version this response shows: the latest, unless a label or a version was asked for. Null for connected agents, which are versioned by their code.

Option 1integer
Option 2null
labelsobject[]required

The deploy labels the agent carries, such as production, and the version each points at.

labelstringrequired
versionintegerrequired
Maximum 9007199254740991
createdByobject | nullrequired

The user who created the agent. Null when an API key created it, or it predates creators being recorded.

Option 1object
idstringrequired
namestring | nullrequired
Option 2null
updatedByobject | nullrequired

The user who changed the agent last. Null when an API key changed it.

Option 1object
idstringrequired
namestring | nullrequired
Option 2null
createdAtstring (date-time)required
updatedAtstring (date-time)required
platformUrlstring (uri)required

Documentation