API Documentation
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/createRequest Body
| Parameter | Type | Description |
|---|---|---|
| name | string | Name of the agent |
| description | string? | Optional description of the agent |
| metadata | object? | 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/:agentIdParameters
| Parameter | Type | Description |
|---|---|---|
| agentId | string | Unique 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/agentsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
| page | number? | Page number for pagination (default: 1) |
| limit | number? | Number of items per page (default: 20, max: 100) |
| search | string? | 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/:agentIdRequest Body
| Parameter | Type | Description |
|---|---|---|
| name | string? | New name for the agent |
| description | string? | New description for the agent |
| metadata | object? | 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
| Event | Description |
|---|---|
| agent.created | Triggered when a new agent is created |
| agent.updated | Triggered when an agent is updated |
| agent.deleted | Triggered 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"
}
}