Agents API

Query Agent types, read and update Agent configuration, and clean up Agent sessions.

Agent configuration covers only the five types vod / issue / coding / qa / sre. chat is not an Agent configuration domain; passing chat returns 404.

Endpoints

Method Path Purpose Authentication
GET /api/agents/types List Agent types Public
GET /api/agents/{name}/{owner}/{repo} Read Agent configuration User-level
PUT /api/agents/{name}/{owner}/{repo} Update Agent configuration User-level
POST /api/agents/{name}/{owner}/{repo}/clean Clean up sessions User-level

"User-level" means a grape_ API key or a web JWT; tk_ session tokens return 403. For authentication details, see Authentication and credentials.

GET /api/agents/types

Public endpoint; it can be called without a token.

Response

{
  "types": [
    {
      "agent_type": "vod",
      "display_name": "Requirement insights",
      "description": "",
      "default_backend": "",
      "icon": "",
      "order_num": 1,
      "enable": true,
      "color": "",
      "bg": ""
    }
  ]
}

The outer value is an object and the list is in the types key; order is determined by order_num.

GET /api/agents/{name}/{owner}/{repo}

Reads the Agent configuration for a repository.

Path

Parameter Description
name vod / issue / coding / qa / sre
owner Repository owner
repo Repository name

Query

Parameter Default Description
issue_number — Highlight a specific Issue
keyword — Search event history by seq / issue_id / event_type / title
page 1 Page number
page_size 10 Number of items per page, up to 100

Key response fields

{
  "agent_type": "vod",
  "display_name": "Requirement insights",
  "backends": [],
  "declared_runtime_ids": [],
  "effective_runtime_id": 0,
  "skill": "<skill-name>",
  "skill_id": 0,
  "skill_scope": "repo",
  "repo_token_exists": false,
  "subscribe_events": [],
  "status": "idle",
  "metrics": {"total_events": 0, "event_stats": {}},
  "recent_events": [],
  "im": {"im_app_id": "", "connected": false, "conversations": []}
}

repo_token_exists only indicates whether a token is stored and does not return the token content; only VOD has an im object, and it is null for the others.

PUT /api/agents/{name}/{owner}/{repo}

Updates the Agent configuration.

Request body

Field Type Description
backend string Engine name (compatibility field)
backends array Set of engines
skill string Skill name (compatibility field)
skill_id int Skill id
skill_scope string official / repo / user
enable bool Enable or disable
subscribe_events array Subscribed events
im_app_id / im_app_secret string Feishu configuration
im_unbind bool VOD only: true unbinds IM without changing the engine or Skill

Response

{"message":"Agent configuration updated","session_id":"..."}

Common errors

Status Cause
400 Invalid engine, or a DevOps Agent bound to a personal engine
404 Unknown Agent

An invalid skill_id does not return 400; the server logs a warning and keeps the default Skill.

POST /api/agents/{name}/{owner}/{repo}/clean

Cleans up the Agent's session and sets runtime_session_id to empty.

Response

{"message":"Agent session cleared","cleaned":true,"agent_type":"vod"}

cleaned=false means there was no session row.

Scenes and engine configuration | Runtime and Worker | Authentication and credentials