> ## Documentation Index
> Fetch the complete documentation index at: https://docs.useproxy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update an agent

> Update agent details, status, limits, or policy.



## OpenAPI

````yaml openapi.json patch /agents/{agentId}
openapi: 3.0.3
info:
  title: Proxy API
  description: >-
    Card issuance and transaction management API for AI agents and automation.
    Proxy enables customers to issue virtual cards with policy-based spending
    controls.
  version: 1.0.0
  contact:
    name: Proxy Support
    url: https://useproxy.ai
servers:
  - url: https://api.useproxy.ai/v1
    description: Production API
security:
  - BearerAuth: []
tags:
  - name: KYC
    description: Know Your Customer application management
  - name: Customers
    description: Manage customers who own agents and cards
  - name: Agents
    description: Manage autonomous agents that can spend on behalf of customers
  - name: Cards
    description: Manage virtual spending cards with policy controls
  - name: Intents
    description: Pre-transaction declarations for spend approval workflows
  - name: Spend
    description: Spend policy evaluation
  - name: Access Events
    description: Card credential access grants with attestation windows
  - name: Transactions
    description: View and manage transaction records
  - name: Balances
    description: View customer balances and funding instructions
  - name: Webhooks
    description: Configure outbound webhook subscriptions
paths:
  /agents/{agentId}:
    patch:
      tags:
        - Agents
      summary: Update an agent
      description: Update agent details, status, limits, or policy.
      operationId: updateAgent
      parameters:
        - $ref: '#/components/parameters/AgentId'
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRequest'
      responses:
        '200':
          description: Agent updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    AgentId:
      name: agentId
      in: path
      required: true
      description: Agent ID (e.g., agt_...)
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: Unique key for idempotent requests (24-hour cache)
      schema:
        type: string
  schemas:
    UpdateAgentRequest:
      type: object
      properties:
        name:
          type: string
        status:
          type: string
          enum:
            - active
            - paused
            - disabled
        limits:
          $ref: '#/components/schemas/SpendingLimit'
        policy:
          $ref: '#/components/schemas/Policy'
        metadata:
          type: object
          additionalProperties: true
    Agent:
      type: object
      properties:
        id:
          type: string
          description: Unique agent ID
        customerId:
          type: string
          nullable: true
          description: Parent customer ID
        externalId:
          type: string
          nullable: true
          description: External identifier for the agent
        name:
          type: string
          description: Agent name
        status:
          type: string
          enum:
            - active
            - paused
            - disabled
          description: Agent status
        limits:
          $ref: '#/components/schemas/SpendingLimit'
        policy:
          $ref: '#/components/schemas/Policy'
        metadata:
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
          nullable: true
      required:
        - id
        - name
        - status
    SpendingLimit:
      type: object
      properties:
        amount:
          type: number
          description: Limit amount in cents
        currency:
          type: string
          description: Currency code (e.g., usd)
        interval:
          type: string
          nullable: true
          description: >-
            Limit interval (e.g., daily, weekly, monthly, all_time,
            per_authorization)
      required:
        - amount
        - currency
    Policy:
      type: object
      description: Spending policy controls
      properties:
        requireIntent:
          type: boolean
          description: Require an intent before card access
        requireAttestation:
          type: boolean
          description: Require attestation for card access
        requireApproval:
          type: boolean
          description: Require manual approval for intents
        autoApproveBelow:
          type: number
          description: Auto-approve intents below this amount (in cents)
        attestationWindowMinutes:
          type: number
          description: Minutes that access credentials remain valid
        cooldownMinutes:
          type: number
          description: Minimum minutes between transactions
        ttlMinutes:
          type: number
          description: Card time-to-live in minutes
        ttlDays:
          type: number
          description: Card time-to-live in days
        limits:
          type: object
          properties:
            perAuth:
              type: number
              description: Maximum amount per authorization (in cents)
            perDay:
              type: number
              description: Maximum daily spend (in cents)
            perMonth:
              type: number
              description: Maximum monthly spend (in cents)
        allowedMccs:
          type: array
          items:
            type: string
          description: Allowed merchant category codes
        blockedMccs:
          type: array
          items:
            type: string
          description: Blocked merchant category codes
        allowedMerchants:
          type: array
          items:
            type: string
          description: Allowed merchant names
        lockToFirstMerchant:
          type: boolean
          description: Lock card to first merchant used
    Error:
      type: object
      properties:
        error:
          oneOf:
            - type: string
            - type: object
              properties:
                code:
                  type: string
                message:
                  type: string
                details:
                  type: object
                  nullable: true
              required:
                - code
                - message
      required:
        - error
  responses:
    BadRequest:
      description: Bad request - invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized - missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: unauthorized
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: not_found
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Include your API key in the Authorization header
        as `Bearer <api_key>`.

````