{
  "version": 1,
  "description": "Greenflare API operations supported by API tokens and the Greenflare CLI. Every operation is enforced by its required scope.",
  "actions": [
    {
      "name": "Read account overview",
      "method": "GET",
      "path": "/v1/account",
      "scope": "account:read",
      "description": "Read account status and usage balance."
    },
    {
      "name": "List transactions",
      "method": "GET",
      "path": "/v1/transactions",
      "scope": "billing:read",
      "description": "Read account transaction history."
    },
    {
      "name": "Read automatic approval",
      "method": "GET",
      "path": "/v1/account/auto-approval",
      "scope": "billing:read",
      "description": "Read automatic approval settings."
    },
    {
      "name": "Update automatic approval",
      "method": "PATCH",
      "path": "/v1/account/auto-approval",
      "scope": "billing:write",
      "description": "Change automatic approval settings."
    },
    {
      "name": "List addresses",
      "method": "GET",
      "path": "/v1/addresses",
      "scope": "addresses:read",
      "description": "Read account addresses and their active state."
    },
    {
      "name": "List aliases",
      "method": "GET",
      "path": "/v1/aliases",
      "scope": "addresses:read",
      "description": "Read account aliases."
    },
    {
      "name": "Create an address",
      "method": "POST",
      "path": "/v1/addresses",
      "scope": "addresses:write",
      "description": "Create an address."
    },
    {
      "name": "Stop an address",
      "method": "DELETE",
      "path": "/v1/addresses",
      "scope": "addresses:write",
      "description": "Stop an address."
    },
    {
      "name": "List messages",
      "method": "GET",
      "path": "/v1/messages",
      "scope": "mail:read",
      "description": "List account messages."
    },
    {
      "name": "Read a message",
      "method": "GET",
      "path": "/v1/messages/{messageId}",
      "scope": "mail:read",
      "description": "Read message metadata and its encrypted content."
    },
    {
      "name": "Delete a message",
      "method": "DELETE",
      "path": "/v1/messages/{messageId}",
      "scope": "mail:write",
      "description": "Permanently delete a message."
    },
    {
      "name": "Send an email",
      "method": "POST",
      "path": "/v1/messages/send",
      "scope": "mail:write",
      "description": "Send one email from an active account address. The send and encrypted Sent-copy usage are charged to the account."
    },
    {
      "name": "Read notification settings",
      "method": "GET",
      "path": "/v1/notifications",
      "scope": "notifications:read",
      "description": "Read notification settings."
    },
    {
      "name": "Read notification configuration",
      "method": "GET",
      "path": "/v1/notifications/config",
      "scope": "notifications:read",
      "description": "Read notification service configuration."
    },
    {
      "name": "Update notification settings",
      "method": "PUT",
      "path": "/v1/notifications",
      "scope": "notifications:write",
      "description": "Update notification settings."
    },
    {
      "name": "Register a notification device",
      "method": "POST",
      "path": "/v1/notifications/subscription",
      "scope": "notifications:write",
      "description": "Register a notification subscription."
    },
    {
      "name": "Remove a notification device",
      "method": "DELETE",
      "path": "/v1/notifications/subscription",
      "scope": "notifications:write",
      "description": "Remove a notification subscription."
    },
    {
      "name": "Read Agent context",
      "method": "GET",
      "path": "/v1/agent/context",
      "scope": "agent:read",
      "description": "Read Agent instructions and reference files."
    },
    {
      "name": "List inbox Agents",
      "method": "GET",
      "path": "/v1/agent/profiles",
      "scope": "agent:read",
      "description": "List configured inbox Agents and their AI-chat permission state. Agent-scoped tokens only see their assigned inbox."
    },
    {
      "name": "Save Agent context",
      "method": "PUT",
      "path": "/v1/agent/context",
      "scope": "agent:write",
      "description": "Save Agent instructions and reference files."
    },
    {
      "name": "Save Agent setup",
      "method": "PUT",
      "path": "/v1/agent/setup",
      "scope": "agent:write",
      "description": "Atomically save an Agent model, instructions, and reference files as one charged database write."
    },
    {
      "name": "Read Agent settings",
      "method": "GET",
      "path": "/v1/agent/settings",
      "scope": "agent:read",
      "description": "Read Agent feature settings."
    },
    {
      "name": "Update Agent settings",
      "method": "PATCH",
      "path": "/v1/agent/settings",
      "scope": "agent:write",
      "description": "Update Agent feature settings."
    },
    {
      "name": "Chat with an inbox Agent or Greenflare assistant",
      "method": "POST",
      "path": "/v1/agent/chat",
      "scope": "agent:write",
      "description": "Send a paid chat request to a selected model."
    },
    {
      "name": "Run a Clef structured decision",
      "method": "POST",
      "path": "/v1/ai/decisions",
      "scope": "ai:decide",
      "description": "Evaluate a bounded state and 1–64 typed questions with Cloudflare Workers AI Clef. Optional image inputs are supported; input tokens are metered and output tokens are not charged. Send an Idempotency-Key header."
    },
    {
      "name": "Generate a FLUX image",
      "method": "POST",
      "path": "/v1/agent/image",
      "scope": "agent:write",
      "description": "Generate one separately confirmed, paid image using the selected FLUX model and published settings."
    },
    {
      "name": "List Container workspaces",
      "method": "GET",
      "path": "/v1/containers/sessions",
      "scope": "container:read",
      "description": "List the account's workspaces and their private or published preview status."
    },
    {
      "name": "Create a Container workspace",
      "method": "POST",
      "path": "/v1/containers/sessions",
      "scope": "container:write",
      "description": "Create a private workspace with its own project state and conversation."
    },
    {
      "name": "Read a Container workspace",
      "method": "GET",
      "path": "/v1/containers/sessions/{sessionId}",
      "scope": "container:read",
      "description": "Read an account-owned workspace, its preview, and any linked Worker deployment."
    },
    {
      "name": "Update a Container workspace",
      "method": "PATCH",
      "path": "/v1/containers/sessions/{sessionId}",
      "scope": "container:write",
      "description": "Update a workspace title or explicitly change its preview visibility."
    },
    {
      "name": "Delete a Container workspace",
      "method": "DELETE",
      "path": "/v1/containers/sessions/{sessionId}",
      "scope": "container:write",
      "description": "Delete a workspace, its conversation and saved project data. The deletion operation is billed at the published account-data operation rate. A linked Worker remains in the connected Cloudflare account."
    },
    {
      "name": "Read workspace messages",
      "method": "GET",
      "path": "/v1/containers/sessions/{sessionId}/messages",
      "scope": "container:read",
      "description": "Read the persisted conversation for an account-owned workspace."
    },
    {
      "name": "Send a workspace build request",
      "method": "POST",
      "path": "/v1/containers/sessions/{sessionId}/chat",
      "scope": "container:write",
      "description": "Send a metered build request to the selected workspace."
    },
    {
      "name": "Export a coding workspace",
      "method": "POST",
      "path": "/v1/containers/sessions/{sessionId}/export",
      "scope": "container:write",
      "description": "Create a compressed .tgz workspace export with Cloudflare-rate compute metering."
    }
  ]
}
