v5

OpenAPI 3.1.0Proprietary2026-08-011476181.4 MB
Agent Management

Create an agent

Create a new agent with a specified policy. Returns the created agent and a device code that must be redeemed by the agent software to complete installation.

post/agents

Request body

namestring required

Human-readable name to identify the agent.

customerIdstring required

The ID of the customer this agent will operate on behalf of.

Example request

{
  "name": "Payroll Automation Agent",
  "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
  "policy": {
    "spendingLimits": {
      "currency": "USD",
      "perTransactionLimit": 50000,
      "dailyLimit": 500000,
      "dailyTransactionLimit": 10,
      "monthlyLimit": 5000000
    },
    "accountRestrictions": {
      "allowedAccountIds": [
        "Account:019542f5-b3e7-1d02-0000-000000000001"
      ],
      "accountRules": [
        {
          "accountId": "Account:019542f5-b3e7-1d02-0000-000000000001",
          "perTransactionLimit": 10000
        }
      ]
    },
    "approvalThresholds": {
      "currency": "USD",
      "amount": 100000
    }
  }
}

Response

Agent created successfully

Example response

{
  "agent": {
    "id": "Agent:019542f5-b3e7-1d02-0000-000000000001",
    "name": "Payroll Automation Agent",
    "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
    "isConnected": true,
    "policy": {
      "spendingLimits": {
        "currency": "USD",
        "perTransactionLimit": 50000,
        "dailyLimit": 500000,
        "dailyTransactionLimit": 10,
        "monthlyLimit": 5000000
      },
      "accountRestrictions": {
        "allowedAccountIds": [
          "Account:019542f5-b3e7-1d02-0000-000000000001"
        ],
        "accountRules": [
          {
            "accountId": "Account:019542f5-b3e7-1d02-0000-000000000001",
            "perTransactionLimit": 10000
          }
        ]
      },
      "approvalThresholds": {
        "currency": "USD",
        "amount": 100000
      }
    },
    "usage": {
      "dailyTransactionCount": 3,
      "dailySpend": 150000,
      "dailyResetDate": "2025-07-22",
      "monthlySpend": 750000,
      "monthlyResetMonth": "2025-08"
    },
    "createdAt": "2025-07-21T17:32:28Z",
    "updatedAt": "2025-07-21T17:32:28Z"
  },
  "deviceCode": {
    "code": "GRID-AGENT-X7K9-M2P4",
    "agentId": "Agent:019542f5-b3e7-1d02-0000-000000000001",
    "expiresAt": "2025-07-22T17:32:28Z"
  }
}