Agents API

Create, manage, and retrieve AI agents for payment automation and integration.

Create Agent

Register a new AI agent for your organization or application.

bash
POST /api/agents/create

Request Body

ParameterTypeDescription
namestringName of the agent
descriptionstring?Optional description of the agent
metadataobject?Optional custom metadata (JSON object)

Example Request

json
{
  "name": "TaskBot",
  "description": "AI agent for automating task payments",
  "metadata": {
    "team": "automation"
  }
}

Example Response

json
{
  "success": true,
  "data": {
    "agentId": "agent_abc123",
    "name": "TaskBot",
    "description": "AI agent for automating task payments",
    "metadata": {
      "team": "automation"
    },
    "createdAt": "2024-03-20T12:00:00Z"
  }
}

Get Agent

Retrieve details of a specific agent.

bash
GET /api/agents/:agentId

Parameters

ParameterTypeDescription
agentIdstringUnique identifier of the agent

Example Response

json
{
  "success": true,
  "data": {
    "agentId": "agent_abc123",
    "name": "TaskBot",
    "description": "AI agent for automating task payments",
    "metadata": {
      "team": "automation"
    },
    "createdAt": "2024-03-20T12:00:00Z"
  }
}

List Agents

Retrieve a list of your registered AI agents.

bash
GET /api/agents

Query Parameters

ParameterTypeDescription
pagenumber?Page number for pagination (default: 1)
limitnumber?Number of items per page (default: 20, max: 100)
searchstring?Filter agents by name or description

Example Response

json
{
  "success": true,
  "data": {
    "items": [
      {
        "agentId": "agent_abc123",
        "name": "TaskBot",
        "description": "AI agent for automating task payments",
        "metadata": {
          "team": "automation"
        },
        "createdAt": "2024-03-20T12:00:00Z"
      }
    ],
    "pagination": {
      "total": 10,
      "page": 1,
      "limit": 20,
      "totalPages": 1
    }
  }
}

Update Agent

Update the details or metadata of an existing agent.

bash
PATCH /api/agents/:agentId

Request Body

ParameterTypeDescription
namestring?New name for the agent
descriptionstring?New description for the agent
metadataobject?Updated metadata (JSON object)

Example Request

json
{
  "name": "TaskBot v2",
  "description": "Updated description",
  "metadata": {
    "team": "automation",
    "version": "2.0"
  }
}

Example Response

json
{
  "success": true,
  "data": {
    "agentId": "agent_abc123",
    "name": "TaskBot v2",
    "description": "Updated description",
    "metadata": {
      "team": "automation",
      "version": "2.0"
    },
    "createdAt": "2024-03-20T12:00:00Z",
    "updatedAt": "2024-03-21T09:00:00Z"
  }
}

Agent Webhooks

Subscribe to agent events using webhooks to receive real-time updates.

To receive webhook notifications, you need to register a webhook endpoint in your developer settings.

Event Types

EventDescription
agent.createdTriggered when a new agent is created
agent.updatedTriggered when an agent is updated
agent.deletedTriggered when an agent is deleted

Example Webhook Payload

json
{
  "event": "agent.updated",
  "data": {
    "agentId": "agent_abc123",
    "name": "TaskBot v2",
    "description": "Updated description",
    "metadata": {
      "team": "automation",
      "version": "2.0"
    },
    "updatedAt": "2024-03-21T09:00:00Z"
  }
}