Skip to content
GasketDocs

Actions

A consequential operation, decided before it happens.

An action is created for every tool call in a run, and whenever your own code asks with POST /v1/actions. Use the latter when you run your own agent and want Gasket to decide and record its steps.

POST/v1/actionsscope actions:write

curl https://usegasket.xyz/api/v1/actions \
  -H "Authorization: Bearer $GASKET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agt_...",
    "service": "stripe",
    "operation": "refund.create",
    "amount": 75,
    "input": { "charge": "ch_..." },
    "idempotency_key": "refund-ch_123"
  }'
json
{
  "id": "act_...",
  "object": "action",
  "agent_id": "agt_...",
  "environment": "test",
  "service": "stripe",
  "operation": "refund.create",
  "input": { "charge": "ch_..." },
  "run_id": null,
  "amount": 75,
  "status": "pending_approval",
  "decision": {
    "effect": "require_approval",
    "rule_index": 1,
    "rule": { "effect": "require_approval", "match": "stripe.refund.create", "when": { "amount_gt": 50 } },
    "policy_id": "pol_...",
    "policy_version": 2,
    "reason": "Require approval for stripe.refund.create when amount > 50"
  },
  "output": null,
  "error": null,
  "request_id": "req_...",
  "decided_by": null,
  "decided_at": null,
  "completed_at": null,
  "expires_at": "2026-10-16T09:41:00.000Z",
  "created_at": "2026-10-15T09:41:00.000Z"
}

Lifecycle

statusMeaning
authorizedAllowed. Perform it, then report the result.
deniedRefused by policy.
pending_approvalWaiting for a person (24 hours).
rejectedA person said no.
expiredNobody decided in 24 hours.
succeeded / failedThe result your code (or the tool call) reported.

Something wrong or missing? Tell us · Stuck? Help center