연결 토큰 회전
POST
/api/v1/devices/{device_id}/agent/rotate-token
const url = 'https://dev.api.endueos.com/api/v1/devices/res_01J9ZK3Q8M4XW7D2N5R6T0V1BC/agent/rotate-token';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dev.api.endueos.com/api/v1/devices/res_01J9ZK3Q8M4XW7D2N5R6T0V1BC/agent/rotate-token \ --header 'Authorization: Bearer <token>'연결 토큰을 새로 발급한다. 옛 토큰은 즉시 무효. 에이전트가 접속 중이면 409 AGENT_CONNECTED.
virtual 이면 409 RESOURCE_MANAGED_BY_APP — OS 가 토큰을 관리한다.
가이드 — 기기
파라미터
섹션 제목: “파라미터”경로 파라미터
섹션 제목: “경로 파라미터”device_id
필수
Device 의 id — Resource 와 같은 res_ 다 (v0.1.0 이 이미 냈다).
string
예시
res_01J9ZK3Q8M4XW7D2N5R6T0V1BC200
섹션 제목: “200”성공.
Media typeapplication/json
object
data
필수
object
agent
필수
기기에 설치된 프로그램. 리소스와 1:1.
object
agent_id
필수
string
resource_id
필수
string
station_id
필수
string
kind
필수
string
status
필수
string
token_prefix
필수
연결 토큰의 앞부분 — osat_{agent_id}_ 에 비밀 부분 앞 4자.
string
online
필수
리소스의 online 과 같은 규칙.
boolean
info
필수
workspace_info 의 출력.
object
tool_count
필수
integer format: int32
created_at
필수
string format: date-time
updated_at
필수
string format: date-time
enrollment
필수
에이전트를 기기에 붙일 때 넣는 값.
object
token
필수
osat_{agent_id}_{hex 64}. 이 응답에서만 볼 수 있다. 에이전트는 불투명한 문자열로 다룬다.
string
endpoint
필수
wss://{host}/api/v1/relay/socket
string
meta
필수
object
request_id
필수
string
timestamp
필수
string format: date-time
duration
서버 처리 시간(ms).
integer format: int32
예시
{ "data": { "agent": { "agent_id": "agnt_01J9ZK3Q8M4XW7D2N5R6T0V1BC", "resource_id": "res_01J9ZK3Q8M4XW7D2N5R6T0V1BC", "station_id": "stn_01J9ZK3Q8M4XW7D2N5R6T0V1BC", "kind": "chrome", "status": "pending" } }}응답 헤더
섹션 제목: “응답 헤더”Cache-Control
필수
string
401
섹션 제목: “401”인증이 없거나 무효다 — UNAUTHORIZED. 본문은 오류 봉투.
404
섹션 제목: “404”없거나 내 것이 아니다 — *_NOT_FOUND. 본문은 오류 봉투.
409
섹션 제목: “409”지금 상태와 충돌한다 — 코드는 위 설명을 본다. 본문은 오류 봉투.
429
섹션 제목: “429”한도를 넘었다 — Retry-After 초 뒤에 다시. 본문은 오류 봉투.
500
섹션 제목: “500”서버 오류 — INTERNAL_ERROR. 본문은 오류 봉투.
503
섹션 제목: “503”의존 서비스에 닿지 못했다 — 잠시 뒤 다시. 본문은 오류 봉투.