Refresh Runner connection credentials

Requires agent_runner.manage. Revokes the old JTI, updates the current binding, and returns a new connect_cmd while retaining Runner/Edge IDs. This differs from Edge holder automatic renew and does not guarantee the same token on repeated calls.

POST https://api.moi.matrixorigin.cn/v5/agent-runners/{id}/refresh-token

Before you call this API

BASE_URL uses the product API prefix https://api.moi.matrixorigin.cn/v5. For a dedicated deployment, use its corresponding product API address.

Prepare identity and identifiers.

Request

curl --request POST \
  "$BASE_URL/agent-runners/$RUNNER_ID/refresh-token" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID"

Parameter

Location

Type

Required

Description

X-Workspace-ID

Header

string

Yes

Target workspace in the same environment; no workspace segment in the path.

id

Path

string

Yes

Accessible Runner ID in the same workspace, from creation or list results.

Successful response

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "id": "runner-example",
    "workspace_id": "workspace-example",
    "user_id": "user-example",
    "name": "示例Runner",
    "runner_type": "custom",
    "edge_agent_id": "runner-runner-example",
    "phase": "pending",
    "token_expires_at": "2026-12-12T01:00:00Z",
    "created_at": "2026-11-12T01:00:00Z",
    "updated_at": "2026-11-12T01:00:00Z",
    "connect_cmd": "astra-edge --edge-id runner-runner-example --server-url wss://edge.example.invalid --token example-edge-token --reconnect true"
  }
}

Field

Type

Description

code

string

OK on success.

msg

string

Response information; OK on success.

data

object

Response objects and omission rules.

Error response

Errors and recovery boundaries distinguishes Runner, Edge renewal, and compute observations. They do not share one numeric error table.

Last updated on