본문으로 이동

협업과 자동화

Actions API

어시스턴트, 에이전트, 서비스가 내 엔드포인트에서 승인된 작업 하나(예: 웹훅 전달)를 정해 둔 한도 안에서 실행할 수 있습니다.

로컬 미리보기

계약 1은 로컬 서비스에서만 제공합니다. 호스팅하거나 공개하지 않았고 버전도 고정하지 않아 내용이 바뀔 수 있습니다(명세의 미리보기 변경 기록 참고). Roye-Contract-Version이 없으면 계약 1로 처리하고, 응답에 처리한 버전을 적습니다. 과금은 없습니다. 이벤트, 내보내기, 증명, 즉시 조정은 이번 미리보기에 없습니다. 엔드포인트는 서비스 네트워크에서 접근할 수 있어야 합니다.

빠른 시작

백엔드는 자기 엔드포인트를 바인딩하고, 한 번만 받는 서명 시크릿을 보관한 뒤 엔드포인트를 검증합니다.

bind.http
# 1. Bind an endpoint you own. The signing secret is returned once, in this response only.
POST /v1/actions/bindings
Authorization: Bearer <backend key>
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
Content-Type: application/json

{ "idempotencyKey": "bind-orders-1", "connectorId": "https_webhook", "displayName": "orders",
  "endpointUrl": "https://hooks.example.com/roye" }

# 201 { "binding": { "id": "acb_…", "state": "pending_verification", "pending": { "revision": 1, … }, … },
#       "secret": "<store it now>", "secretVersion": 1, "secretStatus": "returned" }

# 2. Install the secret in your receiver, then ask for one possession-proof challenge.
POST /v1/actions/bindings/acb_…/verify
{ "idempotencyKey": "verify-orders-1" }
# 202 { "id": "acb_…", "verification": { "state": "pending", "expiresAt": 1760000300000, … }, … }

# Read the binding again for the outcome.
GET /v1/actions/bindings/acb_…
# 200 { "state": "active", "activeRevision": 1, "verification": { "state": "passed", "receipts": [ … ] }, … }

이어서 인보커를 등록하고, 토큰을 발급하고, 승인이 필요한 정책을 작성합니다.

invoker.http
# 3. An invoker, and a token for it. The token secret is returned once.
POST /v1/actions/invokers
{ "idempotencyKey": "inv-1", "kind": "agent", "displayName": "order-assistant" }
# 201 { "id": "aiv_…", "state": "active", "revision": 1, … }

POST /v1/actions/invokers/aiv_…/tokens
{ "idempotencyKey": "tok-1", "scopes": ["invoke", "read"], "ttlMs": 3600000 }
# 201 { "token": { "id": "atk_…", "state": "active", "expiresAt": 1760003600000, … },
#       "secret": "atk_…", "secretStatus": "returned" }
policy.http
# 4. A policy: this invoker may deliver refund.requested events to this binding, with approval, 10 an hour.
POST /v1/actions/policies
{ "idempotencyKey": "pol-1", "invokerIds": ["aiv_…"], "bindingId": "acb_…",
  "actionType": "https_webhook.deliver", "actionRevision": 1,
  "allowedEventTypes": ["refund.requested"], "maxPayloadBytes": 4096, "approval": "required",
  "countLimit": { "max": 10, "period": "hour" }, "dispatchWindowMs": 3600000 }
# 201 { "id": "apo_…", "state": "active", "current": { "revision": 1, … }, "revision": 1, … }

어시스턴트는 자기 토큰으로 액션을 요청합니다. 인텐트는 사람의 승인을 기다리고, 승인되면 서비스가 한 번 전송합니다.

invoke.http
# The assistant invokes with its invoker token: no project headers, and the token names the invoker.
POST /v1/actions/intents
Authorization: Bearer atk_…
Roye-Contract-Version: 1

{ "idempotencyKey": "refund-o-1001", "bindingId": "acb_…", "actionType": "https_webhook.deliver",
  "input": { "eventType": "refund.requested", "body": { "orderId": "o-1001", "amount": 42 } } }
# 202 { "id": "aci_…", "state": "awaiting_approval", "approvalId": "apr_…", "attemptCount": 0, … }
# A policy without approval answers "state": "ready"; the dispatcher then sends it once.
# There is no approval field: a caller or a model can never name or create a decision.
# A person decides the approval (see Approvals below).

개념

리소스는 하나의 프로젝트와 환경에 속합니다. ID는 해석하지 말고 그대로 쓰세요. 시각은 밀리초이고, 바꿀 때는 읽은 revision을 expectedRevision으로 보냅니다.

리소스설명
커넥터리비전마다 고정된 읽기 전용 카탈로그 항목입니다. 액션 유형, 입력 한도, 송신 규칙을 정합니다.
바인딩 (acb_)엔드포인트와 서명 시크릿입니다. 시크릿은 한 번만 돌려주고 암호화해 보관하며 로그에 남기지 않습니다. 새 구성은 검증을 통과해야 적용됩니다. 상태: pending_verification, active, suspended, revoked, deleting, deleted.
인보커 (aiv_)agent 또는 service입니다. 정책에 들어가기 전에는 아무 권한이 없습니다. 상태: active, suspended, retired.
인보커 토큰 (atk_)수명이 짧은 자격 증명이고 범위는 invoke, read입니다. 시크릿은 한 번만 돌려줍니다. 인보커를 퇴출(retire)하면 토큰도 철회됩니다.
정책 (apo_)invokerIds가 bindingId에서 할 수 있는 일을 정합니다. 필드는 actionType(actionRevision 1), allowedEventTypes, maxPayloadBytes, approval(none, required), hour 또는 day당 countLimit, dispatchWindowMs, 선택 사항인 validUntil입니다. 리비전도 같은 필드를 받고, 만든 뒤에는 바뀌지 않습니다. 상태: active, revoked.
제공 액션인보커가 지금 할 수 있는 일입니다. 정책마다 바인딩, 액션 유형, 입력 한도, 허용 이벤트 유형, 승인 규칙, 정책, 횟수 한도를 담고, URL이나 시크릿은 담지 않습니다.
offered-actions.http
# What the invoker may do now, with a backend key or its own token. Never an endpoint URL or a secret.
GET /v1/actions/invokers/aiv_…/offered-actions
# 200 { "invokerId": "aiv_…", "items": [ { "bindingId": "acb_…", "actionType": "https_webhook.deliver",
#       "allowedEventTypes": ["refund.requested"], "approval": "required", … } ] }

자격 증명

자격 증명쓰는 곳할 수 있는 일
백엔드 키 (ryk_…)백엔드결정만 빼고 모두 할 수 있습니다.
인보커 토큰 (atk_…)어시스턴트액션을 요청하고, 엔드포인트에 적힌 조회와 취소를 합니다.
승인자 토큰 (apt_…)자체 UI승인 하나를 읽고 결정하며, 그 인텐트를 읽습니다.
콘솔 세션프로젝트 멤버승인을 결정하고, 승인됐지만 아직 쓰이지 않은 승인을 철회합니다. 소유자는 리소스도 관리합니다.

액터 연결, 멤버 토큰, 참가자 토큰은 리소스를 찾기 전에 403 forbidden을 받고, 인보커 토큰도 관리 경로에서는 마찬가지입니다. 키와 토큰은 브라우저에 두지 마세요. X-Roye-Project와 X-Roye-Environment는 백엔드 키와 함께만 보냅니다.

인보커 토큰은 리플레이와 롱 폴링 조회를 포함해 쓸 때마다 다시 확인합니다. 접수가 거절되면 인텐트가 생기지 않고 정책 한도도 줄지 않습니다.

엔드포인트 URL 규칙

endpointUrl과 선택 사항인 statusUrl은 만들 때, 수정할 때, 연결할 때마다 검사합니다. 규칙을 어긴 URL은 400 endpoint_not_permitted로 거절합니다.

규칙내용
스킴과 포트https와 443 포트만 쓰며, 포트 설정은 없습니다.
호스트완전한 DNS 이름이어야 합니다. IP 주소, localhost, 점이 없는 단일 이름은 안 됩니다.
구성 요소사용자 이름, 비밀번호, 프래그먼트는 쓸 수 없고 최대 2048자입니다.
statusUrlendpointUrl과 같은 호스트여야 합니다.
주소연결할 때마다 이름을 해석합니다. 사설, 루프백, 링크 로컬, 예약 주소가 하나라도 나오면 그 호스트를 거절합니다.
리디렉션따라가지 않습니다. 3xx도 하나의 결과로 봅니다.

검증

액션은 검증된 활성 바인딩에만 전달합니다. POST /bindings/ID/verify는 서명한 일회용 챌린지를 대기 중인 엔드포인트에, 이어서 statusUrl에 보내고 202(verification.state pending)를 돌려줍니다. passed인지 failed인지는 바인딩을 다시 읽어 확인하세요.

항목값
요청specVersion(roye.verification.v1), bindingId, bindingRevision, secretVersion, challenge(무작위 32바이트, base64url), expiresAt이 든 JSON POST입니다.
서명밀리초 단위의 Roye-Timestamp와, v1,<secretVersion>= 뒤에 <timestamp>.<raw body>의 16진 HMAC-SHA256을 붙인 Roye-Signature입니다. 키는 시크릿의 UTF-8 텍스트이고 Idempotency-Key는 없습니다.
응답200과 challengeResponse입니다. 값은 roye.verification.v1.<bindingId>.<bindingRevision>.<challenge>의 base64url HMAC-SHA256입니다.
실패다른 상태 코드, 잘못된 본문, 챌린지를 되돌려준 응답, 틀린 MAC, 재사용되거나 오래된 챌린지, 5분 안에 오지 않은 응답(다시 보내지 않음)입니다. 전달 기록(receipt)에는 사유, 상태, 지연 시간만 남습니다.
수신 측원본 본문으로 서명을 검증하고, 5분 넘게 차이 나는 타임스탬프는 거절하고, 서명된 본문만 믿으세요.
receiver.ts
// The receiver proves it holds the secret. The MAC key is the secret's UTF-8 text exactly as returned.
import { createHmac, timingSafeEqual } from 'node:crypto';

function answerChallenge(secret: string, rawBody: Buffer, headers: Record<string, string>) {
  const timestamp = Number(headers['roye-timestamp']);
  if (!Number.isFinite(timestamp) || Math.abs(Date.now() - timestamp) > 5 * 60_000) throw new Error('stale');
  // Roye-Signature: v1,<secretVersion>=<hex HMAC-SHA256 of "<timestamp>." followed by the raw body>
  const mac = createHmac('sha256', secret).update(`${timestamp}.`).update(rawBody).digest('hex');
  const given = headers['roye-signature'].split(';').map((entry) => entry.split('=')[1] ?? '');
  if (!given.some((value) => value.length === mac.length && timingSafeEqual(Buffer.from(value), Buffer.from(mac)))) throw new Error('bad signature');
  const challenge = JSON.parse(rawBody.toString('utf8'));
  const proof = createHmac('sha256', secret)
    .update(`roye.verification.v1.${challenge.bindingId}.${challenge.bindingRevision}.${challenge.challenge}`)
    .digest('base64url');
  return { challengeResponse: proof }; // answer 200 with this JSON body
}

인텐트

액션은 POST /v1/actions/intents로 요청합니다. onApprovalRequired: refuse로 보내면, 승인이 필요한 정책에서는 인텐트를 만들지 않고 approval_required로 응답합니다.

상태의미
awaiting_approval사람의 승인을 기다리며 approvalId가 있습니다.
ready승인이 필요 없거나 승인됐습니다. 한 번 전송합니다.
dispatching전송하는 중입니다.
unknown전송했지만 결과를 모릅니다. 자동으로 다시 보내지 않습니다.
completed수신 측이 2xx로 응답했거나, 상태 확인(probe)에 applied로 답했습니다.
provider_rejected수신 측이 확정적인 4xx로 응답했습니다.
not_applied수신 측이 상태 확인에 not_applied로 답하고, 그 키를 영구히 거절했습니다.
unresolved조정 기간이 끝나거나 프로젝트가 삭제될 때까지 unknown이었습니다.
failed전송 재시도를 다 쓰고도 보내지 못했습니다.
denied승인이 거절됐습니다.
expired전송 전에 승인이나 전송 기간이 끝났습니다.
cancelled전송 시점 전에 취소됐거나, 바인딩, 인보커, 프로젝트가 없어졌습니다.
refused전송 전에 승인 철회(approval_revoked)나 정책 축소처럼 권한이 바뀌었습니다.

GET /v1/actions/intents/ID?waitMs=는 상태가 바뀌거나 대기가 끝나면 응답합니다. 전달 기록에는 상태, 지연 시간, 응답 다이제스트, reference가 있고, 응답 발췌는 백엔드 키로만 볼 수 있습니다. 얻지 못한 값은 0이 아니라 아예 빠집니다.

intents.http
# 1. A lost invoke response: find the intent by its key (never invoke again under a new key).
GET /v1/actions/intents?idempotencyKey=refund-o-1001              # with the token
GET /v1/actions/intents?invokerId=aiv_…&idempotencyKey=refund-o-1001   # with the backend key
# 200 { "items": [ { "id": "aci_…", … } ], "next": null }   (an empty list: no intent holds the key)

# 2. Observe with a bounded wait (at most 20000 ms); the same view returns either way.
GET /v1/actions/intents/aci_…?waitMs=10000
GET /v1/actions/intents/aci_…/attempts
GET /v1/actions/intents/aci_…/receipts
# 200 { "items": [ { "kind": "dispatch_response", "httpStatus": 200, "latencyMs": 84, "responseDigest": "…", … } ] }
# A field that was not observed is absent, never 0.

# 3. Cancel before the dispatch point (token or backend key). A sent intent is effect_unknown instead.
POST /v1/actions/intents/aci_…/cancel
{ "idempotencyKey": "cancel-o-1001" }

# 4. An unknown outcome is never repeated automatically. A backend may ask for one explicit redispatch,
#    acknowledging that the action may already have taken effect (same intent, same key, no new unit).
POST /v1/actions/intents/aci_…/redispatch
{ "idempotencyKey": "redispatch-o-1001-1", "acknowledgeDuplicateRisk": true }
# 200 { "state": "unknown", "pendingRedispatch": { "dispatchSequence": 1, "redispatchBy": …, "approvalId": "apr_…" }, … }

액션 결과

  • 수신 측은 2xx 응답이나 applied 상태 확인 응답에 JSON reference를 담을 수 있습니다. 그 결과를 가리키는 수신 측의 자체 ID로, 1자에서 200자이고 제어 문자, 양방향 제어 문자, 구분 문자, 폭 없는 문자는 쓸 수 없습니다.
  • 이 값은 인텐트가 완료되면 receiptId, observedAt과 함께 result에 들어가고, 그 전까지 result는 null입니다. reference는 응답 분류를 바꾸지 않고 Roye가 해석하지도 않습니다. 폐지된 receiverReceiptId 대신 씁니다.
results.http
# Your receiver answers the action with any 2xx and, if it likes, its own reference for the effect:
HTTP/1.1 201 Created
Content-Type: application/json

{ "reference": "TICKET-4821" }

# A status probe answer with "status": "applied" may carry it as well:
{ "intentId": "aci_…", "idempotencyKey": "refund-o-1001", "status": "applied", "reference": "TICKET-4821" }

# The invoker reads it from the completed intent.
GET /v1/actions/intents/aci_…?waitMs=10000
# 200 { "id": "aci_…", "state": "completed",
#       "result": { "reference": "TICKET-4821", "receiptId": "arc_…", "observedAt": 1760000012000 }, … }
# Before the intent completes, "result" is null. A 2xx without a usable reference completes with "reference": null.

GET /v1/actions/intents/aci_…/receipts
# 200 { "items": [ { "kind": "dispatch_response", "httpStatus": 201, "reference": "TICKET-4821", … } ] }

승인

승인 하나는 인텐트 하나의 전송 순번 하나만 허용합니다. 바인딩 리비전, 엔드포인트 호스트, 액션 유형과 리비전, 입력 다이제스트, 정책 리비전, 효과 한도를 묶으며 입력은 복사하지 않습니다. 상태: pending, approved, denied, expired, withdrawn, consumed, revoked.

경로는 /v1/actions/approvals 아래이며, 키는 actions 범위로 승인에 접근합니다. approvals 범위는 따로 없습니다.

approvals.http
# 1. The approval that waits for a person. A backend key reads it under the Actions headers.
GET /v1/actions/approvals?state=pending
GET /v1/actions/approvals/apr_…
Authorization: Bearer <backend key>
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1
# 200 { "id": "apr_…", "state": "pending",
#       "binding": { "intentId": "aci_…", "dispatchSequence": 0, "endpointHost": "hooks.example.com", "inputDigest": "…", … },
#       "expiresAt": 1760003600000, "requestedBy": { "principal": "atk_…" }, "decidedBy": null, "revision": 1, … }

# 2. A member decides in the console, or your UI decides with an approver token (below).
#    Persist the key with the body before the first send.
POST /v1/actions/approvals/apr_…/decide
{ "idempotencyKey": "decide-apr-1", "decision": "approved", "reason": "Refund confirmed with the customer.", "expectedRevision": 1 }
# 200 the decided approval. The same body with the same key again: the original, with Roye-Replayed: true.
# 403 { "error": { "code": "forbidden", … } }   with a backend key, an invoker token, or the requester's own identity
# 409 revision_conflict once it was decided or ended; 409 invalid_transition once it expired

# 3. The answer was lost: recover the decision with the credential that made it (never a new key).
POST /v1/operations/recover
{ "module": "actions", "kind": "approvals.decide", "target": { "approvalId": "apr_…" }, "idempotencyKey": "decide-apr-1" }
# 200 { "operationId": "op_…", "state": "succeeded", "result": { "status": 200, … }, … }

# 4. A member revokes an approved approval that was not used yet; the intent is then refused (approval_revoked).
POST /v1/actions/approvals/apr_…/revoke
{ "idempotencyKey": "revoke-apr-1", "reason": "Wrong order.", "expectedRevision": 2 }

결정 규칙

  • decide와 revoke는 멱등 키를 쓰는 호출(approvals.decide, approvals.revoke, 대상 approvalId)로, expectedRevision을 받고 같은 트랜잭션에서 인텐트를 바꿉니다.
  • 승인됐지만 아직 쓰이지 않은 승인은 콘솔 멤버만 철회합니다. 철회하면 인텐트가 거절(approval_revoked)되거나 재전송이 취소됩니다.
  • 만료시키려고 따로 호출할 필요는 없습니다. expiresAt이 지난 미사용 승인은 읽으면 expired이고, state=expired 목록에도 나옵니다.

결정할 수 있는 사람

  • 자기가 요청한 액션은 직접 승인할 수 없습니다(403 forbidden). 같은 신원인지로 판단합니다. 백엔드 키는 교체로 이어진 키 전체가 한 신원이고, 멤버는 콘솔에서든 개발자 토큰으로든 같은 신원이며, 승인자 토큰은 발급자의 신원으로 결정합니다.
  • 키와 그 키를 만든 멤버는 다른 신원이고, 인보커 토큰이 요청한 액션은 멤버 누구나, 어떤 승인자 토큰으로든 결정할 수 있습니다. 그래서 백엔드 혼자서도 요청과 승인을 모두 할 수 있습니다. 요청자와 승인자를 반드시 나누려면 승인하는 사람에게 백엔드 키를 주지 마세요.

승인자 토큰

승인자 토큰이 있으면 Roye 계정이 없는 사람도 자체 제품에서 승인 하나를 결정할 수 있습니다. 백엔드가 백엔드 키나 멤버의 개발자 토큰으로, 대기 중인 승인 하나에 쓸 토큰을 발급합니다. 그 승인을 요청한 신원으로는 발급할 수 없습니다. 토큰은 결정할 사람에게만 건네세요. Roye는 토큰을 누구에게도 보내지 않습니다.

  • apt_ 시크릿은 한 번만 돌려주고 SHA-256 다이제스트로만 저장하며, 로그에 남기지 않습니다. ttlMs는 승인의 expiresAt을 넘지 않습니다. 상태: active, expired, revoked.
  • 자체 UI는 이 토큰만으로 승인과 그 인텐트를 입력까지 읽고, 한 번 결정하고, 응답을 놓친 결정을 복구합니다. 그 밖의 호출은 403 forbidden, 404 not_found, 401 unauthorized, credential_expired, credential_revoked를 받습니다(오류 참고).
  • 발급한 키를 교체하면 토큰은 교체로 생긴 최신 키가 끝날 때까지, 멤버가 발급한 토큰은 그 멤버가 프로젝트를 떠날 때까지 씁니다. decidedBy에는 발급자와 approverTokenId가 남습니다.
  • POST /v1/actions/approver-tokens/ID/revoke로 철회하면 토큰은 바로 효력을 잃고, 이미 내린 결정은 그대로 남습니다. 콘솔은 승인자 토큰을 발급하지 않습니다.
approver-tokens.http
# 1. Your backend issues an approver token for one pending approval it did not request itself.
POST /v1/actions/approvals/apr_…/approver-tokens
Authorization: Bearer <backend key or a member's developer token>
X-Roye-Project: <projectId>
X-Roye-Environment: development
Roye-Contract-Version: 1

{ "idempotencyKey": "approver-o-1001", "ttlMs": 900000 }
# 201 { "token": { "id": "apt_…", "approvalId": "apr_…", "intentId": "aci_…", "state": "active",
#       "issuedBy": { "principal": "…" }, "issuedAt": 1760000000000, "expiresAt": 1760000900000 },
#       "secret": "apt_…", "secretStatus": "returned" }
# Hand the secret to the person who decides. It is returned once; a replay answers "secretStatus": "not_replayable".

GET /v1/actions/approvals/apr_…/approver-tokens        # metadata of every token, never a secret
POST /v1/actions/approver-tokens/apt_…/revoke
{ "idempotencyKey": "approver-o-1001-revoke" }

# 2. Your UI, holding only the approver token: no project headers.
GET /v1/actions/approvals/apr_…
GET /v1/actions/intents/aci_…                          # the intent this approval binds, input included
Authorization: Bearer apt_…
Roye-Contract-Version: 1

POST /v1/actions/approvals/apr_…/decide
{ "idempotencyKey": "decide-apr-1", "decision": "approved", "reason": "The customer confirmed the refund.", "expectedRevision": 1 }
# 200 { "id": "apr_…", "state": "approved", "decidedBy": { "principal": "…", "approverTokenId": "apt_…" }, … }
# Any other Actions or /v1/operations route: 403 forbidden. Another approval or intent: 404 not_found.
# Any route outside Actions and operations: 401 unauthorized, because the token is no credential there.
# 401 credential_expired once the token expired; 401 credential_revoked once it, or its issuer's access, was revoked.
# A lost answer: recover it as in Approvals, with this same token.

SDK

roye.actions(백엔드), RoyeActionsInvoker(어시스턴트), RoyeActionsApprover(자체 UI)는 메서드마다 계약 1 요청을 한 번 보내고 계약 스키마로 검증합니다. 폴링하거나 필드를 계산하지 않고, 시크릿을 보관하지 않습니다. 결정은 승인자 클라이언트만 하며 idempotencyKey가 필요합니다.

approver.ts
import { RoyeActionsApprover } from '@roye-ai/client';

// The backend reads approvals and issues approver tokens; it never decides. A member decides in the console.
const pending = await roye.actions.approvals.list({ state: 'pending' });
const grant = await roye.actions.approvals.tokens.issue(approvalId, { idempotencyKey: 'approver-o-1', ttlMs: 900000 });
// grant.secret is returned once: hand it, with the approval ID, to the person's UI over your own session.

// The person's UI: the approver token only, no project headers.
const approver = new RoyeActionsApprover({ baseURL, token: () => approverToken, approvalId });
const approval = await approver.approval();
const action = await approver.intent(); // the intent this approval binds, input included
const decided = await approver.decide({ decision: 'approved', reason: 'Refund confirmed.', expectedRevision: approval.revision, idempotencyKey: 'decide-apr-1' });
// After a lost answer: send the same decision again (decided.replayed), or approver.recover('decide-apr-1').

엔드포인트

경로는 /v1/actions 아래이며, 따로 적지 않으면 백엔드 키를 씁니다. 목록은 cursor, limit을 받고 items, next를 돌려줍니다. 쓰기는 idempotencyKey를, 리소스 변경은 expectedRevision도 받습니다. 생성은 201, 검증과 액션 요청은 202, 나머지 쓰기는 200으로 응답합니다.

경로참고
GET /connectors[/ID/revisions/N]인보커 토큰도 쓸 수 있습니다.
POST /bindings, GET /bindings[/ID]인보커 토큰은 제공 액션의 바인딩을 읽습니다.
POST /bindings/ID/{verify,revisions,suspend,resume,revoke,delete}삭제하면 시크릿과 구성을 지우고 삭제 기록(tombstone)을 남깁니다.
POST /invokers[/ID], GET /invokers[/ID]인보커 토큰은 자기 인보커만 읽습니다.
POST /invokers/ID/{suspend,resume,retire}퇴출(retire)하면 철회한 토큰을 affected.tokens로 알려 줍니다.
POST /invokers/ID/tokens, GET /invokers/ID/tokens[/ID], POST /tokens/ID/revokescopes, ttlMs로 발급합니다.
POST /policies, GET /policies[/ID], POST /policies/ID/{revisions,revoke}철회는 되돌릴 수 없습니다.
GET /invokers/ID/offered-actions인보커 자신의 토큰도 쓸 수 있습니다.
POST /intentsinvoke 범위의 인보커 토큰이나 invokerId를 지정한 백엔드 키를 씁니다. onApprovalRequired(request, refuse)는 선택 사항입니다.
GET /intents[/ID], GET /intents/ID/{attempts,receipts}state, bindingId, invokerId, idempotencyKey로 거릅니다. read 범위의 인보커 토큰도 쓸 수 있고, 승인자 토큰은 자기 승인의 인텐트만 읽습니다.
POST /intents/ID/{cancel,redispatch}취소에는 인보커 토큰도 쓸 수 있습니다. 재전송에는 acknowledgeDuplicateRisk: true가 필요합니다.
GET /approvals[/ID]state로 거릅니다. 승인자 토큰으로는 자기 승인의 GET /approvals/ID만 호출할 수 있습니다.
POST /approvals/ID/{decide,revoke}decision(approved, denied), reason, expectedRevision을 받습니다. 결정은 콘솔 멤버나 승인자 토큰이, 철회는 콘솔 멤버만 합니다.
POST /approvals/ID/approver-tokens, GET /approvals/ID/approver-tokens, POST /approver-tokens/ID/revokettlMs로 발급합니다. 멤버의 개발자 토큰으로도 발급할 수 있지만, 요청자는 발급할 수 없습니다.
POST /v1/operations/recover원래 호출을 한 자격 증명으로 키를 지정해 복구합니다.

한도

한도는 로컬 미리보기의 임시 값이라 바뀔 수 있습니다. 프로필 리비전은 capabilities 응답에서 확인하세요.

한도값
액션 본문, maxPayloadBytes64 KiB
이벤트 유형하나에 64자, 정책당 32개
정책당 인보커, 인보커당 활성 정책32개, 64개
dispatchWindowMs1분에서 7일
인보커 토큰 ttlMs1분에서 24시간, 기본 1시간. 인보커당 활성 토큰 32개이며, 만료된 토큰은 개수에서 빠집니다.
승인자 토큰 ttlMs60000에서 3600000, 기본 900000. 승인 하나에 철회되거나 만료된 것까지 합쳐 8개.
waitMs20000까지
재전송한 번에 하나, 인텐트당 최대 2번
전달연결과 TLS 5초, 응답 15초, 응답은 16 KiB까지 읽음
페이지 크기64

오류

오류는 공통 오류 형식(error.code, category, message, retryable, nextAction)을 쓰고 시크릿을 담지 않습니다. 메시지가 아니라 코드로 처리하세요.

코드HTTP와 분류원인 또는 대응
invalid_request, payload_limit400, 413 invalid_input입력을 고치세요. 알 수 없는 필드, https_webhook이 아닌 커넥터, 빈 범위, 지난 validUntil 등입니다.
endpoint_not_permitted400 invalid_bindingURL 규칙을 확인하세요.
contract_version_unsupported400 unsupported서비스가 제공하는 버전으로 보내세요.
unauthorized401 denied토큰이 없거나 유효하지 않거나, 승인자 토큰을 Actions와 operations 밖에서 썼습니다.
credential_expired, credential_revoked401 revoked토큰을 새로 받으세요. 승인자 토큰은 발급자가 프로젝트 권한을 잃어도 끝납니다.
forbidden403 denied경로에 맞지 않는 자격 증명, 자기 승인, 또는 승인 밖에서 쓴 승인자 토큰입니다.
action_not_permitted403 denied허용하는 활성 정책이 없거나 인보커가 퇴출(retire)됐습니다.
approval_required403 denied승인이 필요한데 onApprovalRequired: refuse로 요청했습니다.
not_found404 denied없거나 볼 수 없는 리소스입니다. 폐지된 /v1/approvals 경로는 누가 호출하든 이 코드입니다.
binding_not_active409 not_ready바인딩 상태 때문에 호출할 수 없습니다.
revision_conflict, invalid_transition409 conflictexpectedRevision이 오래됐거나, 이미 결정된 승인이거나, 상태가 맞지 않습니다(예: 만료). 다시 읽으세요.
idempotency_conflict409 conflict이미 다른 본문에 쓴 키입니다. 원래 호출을 복구하세요.
intent_not_cancellable, redispatch_not_allowed, redispatch_limit409 conflict인텐트가 끝났거나, unknown이 아니거나, 재전송이 대기 중이거나, 한도가 찼습니다.
count_limit_reached, approval_backlog_full409 exhausted정책 횟수나 대기 중인 승인 수를 다 썼습니다.
effect_unknown409 pending_original이미 전송됐을 수 있어 취소할 수 없습니다. 조회하거나 재전송하세요.
quota_exceeded429 exhausted토큰, 정책, 승인자 토큰 한도가 찼습니다.
unavailable503 transient같은 키와 본문으로 다시 시도하세요. 시크릿 보관이 구성되지 않았을 때도 이 코드입니다.

복구

처음 보내기 전에 idempotencyKey를 입력과 함께 저장하거나, 인텐트 저장소를 주입해 roye.intents.resume()을 쓰세요. 새 키로 다시 시도하지 마세요.

상황대응
응답 유실읽기 전용 POST /v1/operations/recover에 module actions, kind, target, 키를 보내거나, 같은 본문과 키로 다시 보내세요(Roye-Replayed: true).
시크릿 유실리플레이 응답에는 시크릿 없이 secretStatus not_replayable만 있습니다. 바인딩은 삭제하거나 철회하고, 인보커 토큰이나 승인자 토큰은 철회한 뒤 새 키로 다시 만드세요.
액션 요청 유실GET /v1/actions/intents?idempotencyKey=로 찾고, 백엔드 키는 invokerId도 지정합니다. 빈 목록이면 그 키로 만든 인텐트가 없습니다.
결정 유실다시 보내거나, 결정한 자격 증명으로 approvals.decide(대상 approvalId)를 복구하세요.
취소전송 시점 전까지만 취소할 수 있고, 그 뒤에는 effect_unknown으로 응답합니다.
결과 미확인백엔드는 acknowledgeDuplicateRisk: true로 한 번에 하나씩, 인텐트당 최대 2번 재전송할 수 있습니다. 같은 인텐트와 키를 쓰며, 정책이 요구하면 새 승인을 받습니다.
recovery.http
# The create response was lost. Recover the original by key: read-only, never a second binding.
POST /v1/operations/recover
{ "module": "actions", "kind": "bindings.create", "target": {}, "idempotencyKey": "bind-orders-1" }
# 200 { "operationId": "op_…", "state": "succeeded", "result": { "status": 201, "resource": { "domain": "actions", "type": "binding", "id": "acb_…" } }, … }

# Re-sending the same body with the same key returns the stored original with Roye-Replayed: true,
# and no secret: it is gone after the first response.
POST /v1/actions/bindings
{ "idempotencyKey": "bind-orders-1", "connectorId": "https_webhook", "displayName": "orders", "endpointUrl": "https://hooks.example.com/roye" }
# 201 { "binding": { … }, "secretVersion": 1, "secretStatus": "not_replayable" }

# Next action: delete or revoke that binding, then create a new one under a new key.
POST /v1/actions/bindings/acb_…/delete
{ "idempotencyKey": "del-1", "expectedRevision": 1 }