API reference
Ask for auto-approve
Ask for an auto-approve policy: an approval of kind auto_approve with a scope and an end at most 24 hours away, put to you (a person) or to the account's owners (an agent or an assistant). Approving it through Decide an approval, with the person's device-key proof, sets the account's policy and replaces an earlier one; asks on the never list still reach a person.
Needs scope approvals:write.
bearerAuthorizationBearer <JWT>An access token from the identity provider: a person's, or a customer's from the client credentials grant with an API key (developers.inorbit.hr). The gateway verifies it; the audience is iohr-api.
iohr.approvals.v1.RequestAutoApproveRequest; path variables override their fields
application/json- body
iohr.approvals.v1.RequestAutoApproveRequest
account_id?stringdevice?stringscope?iohr.approvals.v1.AutoApproveScope
until?stringiohr.approvals.v1.RequestAutoApproveResponse
application/json- response
iohr.approvals.v1.RequestAutoApproveResponse
approval?iohr.approvals.v1.Approval
approval_id*stringimport { ApiError, Public } from "@inorbithr/sdk";// Reads INORBIT_TOKEN, or INORBIT_KEY_ID and INORBIT_KEY_SECRET.const api = Public.fromEnv();try { const { value } = await api.approvals.requestAutoApprove({ device: "<device>", until: "<until>", }); console.log(value);} catch (e) { if (!(e instanceof ApiError)) throw e; console.error(`${e.code}: ${e.problem} (request id ${e.raw.requestId})`); process.exitCode = 1;}npm install @inorbithr/sdk. Calls the package's public surface; an operation newer than your package needs the next release or a client generated for your account. The SDKs.
{ "approval": { "account_id": "string", "agent": "string", "approval_id": "string", "approve_means": "string", "asked_of": "string", "auto_policy_id": "string", "auto_policy_signature_sha256": "string", "context": { "canvas_id": "string", "commits": [ { "repo": "string", "resolved": true, "sha": "string", "subject": "string" } ], "diagram_ids": [ "string" ], "documents": [ { "document_id": "string", "kind": "string", "number": "string", "resolved": true, "space_id": "string", "title": "string" } ], "explanation": { "approve": "string", "deny": "string", "effect": { "kind": "string", "ships": true, "summary": "string", "touches": [ "string" ] }, "evidence": [ { "kind": "string", "language": "string", "path": "string", "text": "string", "title": "string", "url": "string" } ], "risk": { "level": "string", "text": "string" }, "what": "string", "why": "string" }, "job_id": "string", "no_context_reason": "string", "plan_id": "string", "plan_item": "string", "scene_document_id": "string" }, "corrected_at": "string", "correction": "string", "created_at": "string", "decided_at": "string", "decided_by": "string", "decided_on": "string", "decision_note": "string", "decision_proof": { "key_id": "string", "nonce": "string", "signature": "string", "signed_at": "string" }, "deny_means": "string", "github": "string", "kind": "string", "links": [ "string" ], "payload": { "auto_approve": { "scope": { "ask_kinds": [ "string" ], "max_priority": 0, "requesters": [ "string" ] }, "until": "string" }, "decision": { "needs_person": true, "options": [ "string" ] }, "document": { "document_id": "string", "space_id": "string", "version": 0 }, "pull_request": { "head": "string", "number": 0, "repo": "string", "title": "string" }, "review": { "url": "string" }, "roll": { "behind": 0, "deployments": [ "string" ], "gate": [ "string" ], "gate_tree": "string", "main_commit": "string", "main_subject": "string", "migrations": [ "string" ], "other_commits": 0, "prs": [ { "number": 0, "title": "string" } ], "rollback": [ "string" ], "running_commit": "string", "steps": [ "string" ] }, "run": { "action": "string", "argv": [ "string" ], "cmd": "string", "effect": "string", "expires_at": "string", "nonce": "string", "plan_sha256": "string", "roll": { "behind": 0, "deployments": [ "string" ], "gate": [ "string" ], "gate_tree": "string", "main_commit": "string", "main_subject": "string", "migrations": [ "string" ], "other_commits": 0, "prs": [ { "number": 0, "title": "string" } ], "rollback": [ "string" ], "running_commit": "string", "steps": [ "string" ] }, "runner_id": "string", "runner_public_key": "string", "schema_id": "string", "script_sha256": "string", "version": 0 }, "runner_enrollment": { "fingerprint": "string", "label": "string", "public_key": "string" } }, "payload_sha256": "string", "requested_by": "string", "status": "string", "summary": "string", "supersedes": "string", "timeline": [ { "at": "string", "by": "string", "device": "string", "note": "string", "step": "string", "via": "string" } ], "title": "string", "updated_at": "string", "via": "string" }, "approval_id": "string"}