Skip to content

AI Agents API Reference

The AI Agents API provides endpoints for creating and managing autonomous AI agents that react to board events in real-time. Agents can assist with tutoring, moderation, time management, and custom automation tasks.

Overview

AI Agents are autonomous programs that observe board activity and take actions based on configurable instructions:

  • Event-Driven: React to board events (object changes, participant actions, frame navigation)
  • Scheduled Actions: Execute periodic tasks (timers, reminders, notifications)
  • Scoped Operation: Limit agent activity to specific frames, participants, or object types
  • Budget Control: Set rate limits and token budgets to control costs
  • Stealth Mode: Operate invisibly without appearing as a participant

Key Concepts

ConceptDescription
PersonaAgent role: tutor, moderator, timer, facilitator, custom
InstructionsBehavior definition: goals, rules, triggers, schedule
TriggersEvent-action mappings (e.g., when sticky note created → evaluate answer)
ScopeRestrictions: which frames, participants, object types the agent monitors
StatusAgent state: active, paused, completed, error
VisibilityHow agent appears: visible (shows as participant), stealth (hidden)

Agent Capabilities

Action TypeDescription
create_objectCreate new objects on board (sticky notes, shapes, text)
update_objectModify existing objects (edit text, change color)
delete_objectRemove objects from board
move_objectsReposition objects (organize, group)
send_notificationSend messages to participants
move_to_frameNavigate participants to specific frames
evaluate_answerAssess student responses using AI
generate_hintCreate helpful hints for stuck students
summarizeGenerate content summaries
notify_teacherAlert teacher to important events

Authentication

All AI Agents API endpoints require API key authentication:

bash
curl -H "X-API-Key: your-api-key" \
  https://api.boardapi.io/api/v1/boards/:boardId/agents

API keys are passed via the X-API-Key header. Get your API key from the Developer Dashboard.

Base URL

https://api.boardapi.io/api/v1

For development:

http://localhost:4000/api/v1

Endpoints Overview

MethodEndpointDescription
POST/boards/:boardId/agentsCreate a new agent
GET/boards/:boardId/agentsList all agents for a board
GET/boards/:boardId/agents/:idGet a specific agent
PATCH/boards/:boardId/agents/:idUpdate agent configuration
DELETE/boards/:boardId/agents/:idDelete an agent
POST/boards/:boardId/agents/:id/pausePause agent activity
POST/boards/:boardId/agents/:id/resumeResume paused agent
POST/boards/:boardId/agents/:id/resetReset agent memory
GET/boards/:boardId/agents/:id/actionsGet agent action log
GET/boards/:boardId/agents/:id/statsGet agent statistics
GET/agent-presetsList available agent presets
GET/agent-presets/:personaGet a specific preset

Create Agent

Creates a new autonomous AI agent on a board with custom instructions and behavior.

Request

http
POST /boards/:boardId/agents
X-API-Key: your-api-key
Content-Type: application/json

{
  "name": "AI Tutor",
  "persona": "tutor",
  "instructions": {
    "description": "Helpful AI assistant for language learning",
    "goals": [
      "Help students understand vocabulary",
      "Provide hints without giving answers",
      "Encourage critical thinking"
    ],
    "rules": [
      "Never give direct answers",
      "Always be supportive and encouraging",
      "Respond only when student asks for help"
    ],
    "triggers": [
      {
        "event": "object:created",
        "condition": "object.type === 'sticky-note' && object.data.needsHelp",
        "action": "generate_hint",
        "params": {
          "style": "socratic"
        }
      }
    ]
  },
  "scope": {
    "frames": ["frame-uuid-1"],
    "objectTypes": ["sticky-note", "text"]
  },
  "maxActionsPerMinute": 10,
  "budgetTokens": 50000,
  "priority": 5,
  "visibility": "visible",
  "scanExisting": false
}

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID

Request Body Parameters

ParameterTypeRequiredDescription
namestringYesAgent display name (max 100 characters)
personastringYesAgent role: tutor, moderator, timer, facilitator, custom
instructionsobjectYesAgent behavior definition (see Instructions Schema)
scopeobjectNoOperational restrictions (frames, participants, object types)
maxActionsPerMinutenumberNoRate limit (default: 10, range: 1-60)
budgetTokensnumberNoToken budget limit (null = unlimited)
prioritynumberNoAgent priority (default: 5, range: 1-10)
visibilitystringNovisible or stealth (default: visible)
scanExistingbooleanNoProcess existing board content on creation (default: false)

Instructions Schema

json
{
  "description": "Agent purpose and role",
  "goals": ["Goal 1", "Goal 2"],
  "rules": ["Rule 1", "Rule 2"],
  "triggers": [
    {
      "event": "object:created",
      "condition": "object.type === 'sticky-note'",
      "action": "evaluate_answer",
      "params": {},
      "allowSelfEvents": false
    }
  ],
  "schedule": [
    {
      "at": "every:5min",
      "action": "send_notification",
      "params": {
        "message": "5 minutes remaining"
      }
    }
  ]
}

Trigger Events

EventFires When
object:createdNew object added to board
object:updatedExisting object modified
object:deletedObject removed from board
participant:joinedUser joins board
participant:leftUser leaves board
participant:idleUser inactive for threshold time
frame:enteredParticipant enters frame
frame:leftParticipant leaves frame
timer:tickPeriodic timer event
schedule:triggerScheduled action fires

Schedule Syntax

PatternDescription
every:5minEvery 5 minutes
every:30secEvery 30 seconds
every:1hourEvery hour
at:09:00At specific time (UTC)
cron:*/5 * * * *Custom cron expression

Response

Status Code: 201 Created

json
{
  "id": "agent-uuid-123",
  "boardUuid": "board-uuid-456",
  "name": "AI Tutor",
  "persona": "tutor",
  "status": "active",
  "instructions": {
    "description": "Helpful AI assistant for language learning",
    "goals": ["Help students understand vocabulary"],
    "rules": ["Never give direct answers"],
    "triggers": [
      {
        "event": "object:created",
        "condition": "object.type === 'sticky-note'",
        "action": "generate_hint"
      }
    ]
  },
  "scope": {
    "frames": ["frame-uuid-1"],
    "objectTypes": ["sticky-note", "text"]
  },
  "priority": 5,
  "visibility": "visible",
  "isThinking": false,
  "maxActionsPerMinute": 10,
  "budgetTokens": 50000,
  "spentTokens": 0,
  "stats": {
    "actionsCount": 0,
    "tokensSpent": 0,
    "lastActionAt": null
  },
  "createdAt": "2025-11-28T10:00:00Z",
  "createdBy": "user-uuid-789"
}

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'AI Tutor',
      persona: 'tutor',
      instructions: {
        description: 'Helpful AI assistant',
        goals: ['Help students'],
        rules: ['Be encouraging'],
        triggers: [
          {
            event: 'object:created',
            condition: "object.type === 'sticky-note'",
            action: 'evaluate_answer'
          }
        ]
      },
      maxActionsPerMinute: 10,
      budgetTokens: 50000
    })
  }
);

const agent = await response.json();
console.log(`Agent created: ${agent.id}`);

cURL:

bash
curl -X POST https://api.boardapi.io/api/v1/boards/board-uuid-456/agents \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "AI Tutor",
    "persona": "tutor",
    "instructions": {
      "description": "Helpful AI assistant",
      "goals": ["Help students"],
      "rules": ["Be encouraging"],
      "triggers": [
        {
          "event": "object:created",
          "condition": "object.type === \"sticky-note\"",
          "action": "evaluate_answer"
        }
      ]
    },
    "maxActionsPerMinute": 10,
    "budgetTokens": 50000
  }'

PHP:

php
<?php
$ch = curl_init('https://api.boardapi.io/api/v1/boards/board-uuid-456/agents');

curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: your-api-key',
        'Content-Type: application/json'
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'name' => 'AI Tutor',
        'persona' => 'tutor',
        'instructions' => [
            'description' => 'Helpful AI assistant',
            'goals' => ['Help students'],
            'rules' => ['Be encouraging'],
            'triggers' => [
                [
                    'event' => 'object:created',
                    'condition' => 'object.type === "sticky-note"',
                    'action' => 'evaluate_answer'
                ]
            ]
        ],
        'maxActionsPerMinute' => 10,
        'budgetTokens' => 50000
    ]),
    CURLOPT_RETURNTRANSFER => true
]);

$agent = json_decode(curl_exec($ch), true);
echo "Agent created: {$agent['id']}\n";

Use Cases

  • Create AI tutors for educational boards
  • Add moderation agents to detect inappropriate content
  • Set up timer agents for timed activities
  • Build custom automation workflows

Possible Errors

Status CodeErrorDescription
400Bad RequestInvalid agent data (missing required fields, invalid triggers)
404Not FoundBoard does not exist
401UnauthorizedInvalid or missing API key

List All Agents

Retrieves all agents on a board with their current status and statistics.

Request

http
GET /boards/:boardId/agents
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID

Response

Status Code: 200 OK

json
[
  {
    "id": "agent-uuid-123",
    "boardUuid": "board-uuid-456",
    "name": "AI Tutor",
    "persona": "tutor",
    "status": "active",
    "priority": 5,
    "visibility": "visible",
    "isThinking": false,
    "maxActionsPerMinute": 10,
    "budgetTokens": 50000,
    "spentTokens": 1250,
    "stats": {
      "actionsCount": 15,
      "tokensSpent": 1250,
      "lastActionAt": "2025-11-28T10:30:00Z"
    },
    "createdAt": "2025-11-28T10:00:00Z",
    "createdBy": "user-uuid-789"
  },
  {
    "id": "agent-uuid-456",
    "boardUuid": "board-uuid-456",
    "name": "Timer Bot",
    "persona": "timer",
    "status": "active",
    "priority": 3,
    "visibility": "visible",
    "isThinking": false,
    "maxActionsPerMinute": 5,
    "budgetTokens": null,
    "spentTokens": 0,
    "stats": {
      "actionsCount": 6,
      "tokensSpent": 0,
      "lastActionAt": "2025-11-28T10:25:00Z"
    },
    "createdAt": "2025-11-28T10:05:00Z",
    "createdBy": "user-uuid-789"
  }
]

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents',
  {
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const agents = await response.json();
console.log(`Total agents: ${agents.length}`);

agents.forEach(agent => {
  console.log(`- ${agent.name} (${agent.status}): ${agent.stats.actionsCount} actions`);
});

cURL:

bash
curl -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents'

PHP:

php
<?php
$headers = ['X-API-Key: your-api-key'];
$agents = json_decode(
  file_get_contents(
    'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents',
    false,
    stream_context_create(['http' => ['header' => implode("\r\n", $headers)]])
  ),
  true
);

foreach ($agents as $agent) {
    echo "{$agent['name']} ({$agent['status']}): {$agent['stats']['actionsCount']} actions\n";
}

Possible Errors

Status CodeErrorDescription
404Not FoundBoard does not exist
401UnauthorizedInvalid API key

Get Agent

Retrieves details of a specific agent including its current state and configuration.

Request

http
GET /boards/:boardId/agents/:id
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Response

Status Code: 200 OK

json
{
  "id": "agent-uuid-123",
  "boardUuid": "board-uuid-456",
  "name": "AI Tutor",
  "persona": "tutor",
  "status": "active",
  "instructions": {
    "description": "Helpful AI assistant for language learning",
    "goals": ["Help students understand vocabulary"],
    "rules": ["Never give direct answers"],
    "triggers": [
      {
        "event": "object:created",
        "condition": "object.type === 'sticky-note'",
        "action": "generate_hint"
      }
    ]
  },
  "scope": {
    "frames": ["frame-uuid-1"],
    "objectTypes": ["sticky-note", "text"]
  },
  "priority": 5,
  "visibility": "visible",
  "isThinking": false,
  "maxActionsPerMinute": 10,
  "budgetTokens": 50000,
  "spentTokens": 1250,
  "stats": {
    "actionsCount": 15,
    "tokensSpent": 1250,
    "lastActionAt": "2025-11-28T10:30:00Z"
  },
  "createdAt": "2025-11-28T10:00:00Z",
  "createdBy": "user-uuid-789"
}

Example Requests

JavaScript/TypeScript:

javascript
const agentId = 'agent-uuid-123';
const response = await fetch(
  `https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/${agentId}`,
  {
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const agent = await response.json();
console.log(`Agent: ${agent.name}`);
console.log(`Status: ${agent.status}`);
console.log(`Actions: ${agent.stats.actionsCount}`);
console.log(`Tokens spent: ${agent.spentTokens}/${agent.budgetTokens}`);

cURL:

bash
curl -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123'

Possible Errors

Status CodeErrorDescription
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Update Agent

Updates agent configuration such as instructions, scope, or rate limits.

Request

http
PATCH /boards/:boardId/agents/:id
X-API-Key: your-api-key
Content-Type: application/json

{
  "name": "AI Tutor v2",
  "instructions": {
    "description": "Enhanced AI assistant",
    "goals": ["Help students", "Track progress"],
    "rules": ["Be encouraging", "Provide hints only"],
    "triggers": [
      {
        "event": "object:created",
        "condition": "object.type === 'sticky-note'",
        "action": "evaluate_answer"
      }
    ]
  },
  "maxActionsPerMinute": 15,
  "budgetTokens": 100000
}

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Request Body Parameters

All fields are optional. Only provided fields will be updated.

ParameterTypeDescription
namestringNew agent name (max 100 characters)
instructionsobjectUpdated behavior definition
scopeobjectNew operational restrictions
maxActionsPerMinutenumberNew rate limit (range: 1-60)
budgetTokensnumberNew token budget (null = unlimited)
prioritynumberNew priority (range: 1-10)

Response

Status Code: 200 OK

json
{
  "id": "agent-uuid-123",
  "boardUuid": "board-uuid-456",
  "name": "AI Tutor v2",
  "persona": "tutor",
  "status": "active",
  "instructions": {
    "description": "Enhanced AI assistant",
    "goals": ["Help students", "Track progress"],
    "rules": ["Be encouraging", "Provide hints only"],
    "triggers": [
      {
        "event": "object:created",
        "condition": "object.type === 'sticky-note'",
        "action": "evaluate_answer"
      }
    ]
  },
  "maxActionsPerMinute": 15,
  "budgetTokens": 100000,
  "spentTokens": 1250,
  "stats": {
    "actionsCount": 15,
    "tokensSpent": 1250,
    "lastActionAt": "2025-11-28T10:30:00Z"
  },
  "createdAt": "2025-11-28T10:00:00Z",
  "createdBy": "user-uuid-789"
}

Example Requests

JavaScript/TypeScript:

javascript
// Increase rate limit
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123',
  {
    method: 'PATCH',
    headers: {
      'X-API-Key': 'your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      maxActionsPerMinute: 20,
      budgetTokens: 100000
    })
  }
);

const updated = await response.json();
console.log(`Updated: ${updated.name}`);

cURL:

bash
curl -X PATCH https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123 \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "maxActionsPerMinute": 20,
    "budgetTokens": 100000
  }'

Possible Errors

Status CodeErrorDescription
400Bad RequestInvalid update data
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Delete Agent

Permanently removes an agent and its action history.

Request

http
DELETE /boards/:boardId/agents/:id
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Response

Status Code: 204 No Content

No response body is returned on success.

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123',
  {
    method: 'DELETE',
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

if (response.status === 204) {
  console.log('Agent deleted successfully');
}

cURL:

bash
curl -X DELETE \
  -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123'

Possible Errors

Status CodeErrorDescription
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Pause Agent

Stops the agent from reacting to new events. Agent remains on the board but inactive.

Request

http
POST /boards/:boardId/agents/:id/pause
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Response

Status Code: 200 OK

json
{
  "id": "agent-uuid-123",
  "boardUuid": "board-uuid-456",
  "name": "AI Tutor",
  "persona": "tutor",
  "status": "paused",
  "isThinking": false,
  "stats": {
    "actionsCount": 15,
    "tokensSpent": 1250,
    "lastActionAt": "2025-11-28T10:30:00Z"
  },
  "createdAt": "2025-11-28T10:00:00Z",
  "createdBy": "user-uuid-789"
}

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/pause',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const agent = await response.json();
console.log(`Agent ${agent.name} is now ${agent.status}`);

cURL:

bash
curl -X POST \
  -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/pause'

Use Cases

  • Pause agent during group discussion
  • Temporarily disable agent for teacher intervention
  • Stop agent when activity changes

Possible Errors

Status CodeErrorDescription
400Bad RequestAgent is already paused
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Resume Agent

Resumes a paused agent, allowing it to react to events again.

Request

http
POST /boards/:boardId/agents/:id/resume
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Response

Status Code: 200 OK

json
{
  "id": "agent-uuid-123",
  "boardUuid": "board-uuid-456",
  "name": "AI Tutor",
  "persona": "tutor",
  "status": "active",
  "isThinking": false,
  "stats": {
    "actionsCount": 15,
    "tokensSpent": 1250,
    "lastActionAt": "2025-11-28T10:30:00Z"
  },
  "createdAt": "2025-11-28T10:00:00Z",
  "createdBy": "user-uuid-789"
}

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/resume',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const agent = await response.json();
console.log(`Agent ${agent.name} resumed`);

cURL:

bash
curl -X POST \
  -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/resume'

Possible Errors

Status CodeErrorDescription
400Bad RequestAgent is not paused
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Reset Agent Memory

Clears the agent's working memory (context between events). Instructions and configuration remain unchanged.

Request

http
POST /boards/:boardId/agents/:id/reset
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Response

Status Code: 200 OK

json
{
  "id": "agent-uuid-123",
  "boardUuid": "board-uuid-456",
  "name": "AI Tutor",
  "persona": "tutor",
  "status": "active",
  "isThinking": false,
  "stats": {
    "actionsCount": 15,
    "tokensSpent": 1250,
    "lastActionAt": "2025-11-28T10:30:00Z"
  },
  "createdAt": "2025-11-28T10:00:00Z",
  "createdBy": "user-uuid-789"
}

Example Requests

JavaScript/TypeScript:

javascript
// Reset agent memory for new activity
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/reset',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const agent = await response.json();
console.log('Agent memory reset');

cURL:

bash
curl -X POST \
  -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/reset'

Use Cases

  • Clear agent context when starting new activity
  • Reset agent state after error
  • Force agent to re-evaluate situation

Possible Errors

Status CodeErrorDescription
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Get Agent Action Log

Retrieves the history of all actions performed by the agent.

Request

http
GET /boards/:boardId/agents/:id/actions?limit=50&offset=0
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Query Parameters

ParameterTypeRequiredDescription
limitnumberNoMaximum actions to return (default: 50)
offsetnumberNoNumber of actions to skip (default: 0)

Response

Status Code: 200 OK

json
[
  {
    "id": "action-uuid-1",
    "agentId": "agent-uuid-123",
    "triggerEventType": "object:created",
    "triggerEventData": {
      "objectId": "obj-123",
      "type": "sticky-note",
      "data": {
        "text": "What is photosynthesis?"
      }
    },
    "shouldAct": true,
    "reasoning": "Student asked a question about photosynthesis. Should provide a hint.",
    "actionType": "generate_hint",
    "actionParams": {
      "style": "socratic",
      "targetObjectId": "obj-123"
    },
    "success": true,
    "result": {
      "hintObjectId": "obj-456",
      "hintText": "Think about how plants get energy from sunlight..."
    },
    "errorMessage": null,
    "tokensUsed": 85,
    "latencyMs": 1250,
    "createdAt": "2025-11-28T10:30:15Z"
  },
  {
    "id": "action-uuid-2",
    "agentId": "agent-uuid-123",
    "triggerEventType": "participant:idle",
    "triggerEventData": {
      "participantId": "user-789",
      "idleDurationMs": 300000
    },
    "shouldAct": true,
    "reasoning": "Student has been idle for 5 minutes. Send gentle reminder.",
    "actionType": "send_notification",
    "actionParams": {
      "message": "Need any help? Feel free to ask!",
      "participantId": "user-789"
    },
    "success": true,
    "result": {
      "notificationSent": true
    },
    "errorMessage": null,
    "tokensUsed": 42,
    "latencyMs": 850,
    "createdAt": "2025-11-28T10:25:00Z"
  }
]

Response Fields

FieldTypeDescription
idstringAction log entry UUID
agentIdstringAgent UUID
triggerEventTypestringEvent that triggered this action
triggerEventDataobjectEvent payload data
shouldActbooleanWhether agent decided to act
reasoningstringAgent's reasoning for decision
actionTypestringType of action performed
actionParamsobjectAction parameters
successbooleanWhether action completed successfully
resultobjectAction result data
errorMessagestringError details (if failed)
tokensUsednumberLLM tokens consumed
latencyMsnumberAction execution time
createdAtstringISO 8601 timestamp

Example Requests

JavaScript/TypeScript:

javascript
// Get last 100 actions
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/actions?limit=100',
  {
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const actions = await response.json();
console.log(`Total actions: ${actions.length}`);

// Analyze action success rate
const successful = actions.filter(a => a.success).length;
console.log(`Success rate: ${(successful / actions.length * 100).toFixed(1)}%`);

cURL:

bash
# Get last 50 actions
curl -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/actions?limit=50'

Use Cases

  • Debug agent behavior
  • Analyze action patterns
  • Monitor token usage per action
  • Track agent performance

Possible Errors

Status CodeErrorDescription
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

Get Agent Statistics

Returns aggregate statistics about the agent's activity.

Request

http
GET /boards/:boardId/agents/:id/stats
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
boardIdstringBoard UUID
idstringAgent UUID

Response

Status Code: 200 OK

json
{
  "actionsCount": 47,
  "tokensSpent": 3850,
  "lastActionAt": "2025-11-28T10:45:30Z",
  "successRate": 0.957,
  "averageLatencyMs": 1120,
  "actionsByType": {
    "generate_hint": 18,
    "evaluate_answer": 12,
    "send_notification": 10,
    "create_object": 7
  },
  "budgetRemaining": 46150,
  "budgetPercentUsed": 7.7
}

Response Fields

FieldTypeDescription
actionsCountnumberTotal actions performed
tokensSpentnumberTotal LLM tokens consumed
lastActionAtstringISO 8601 timestamp of last action
successRatenumberPercentage of successful actions (0-1)
averageLatencyMsnumberAverage action execution time
actionsByTypeobjectBreakdown of actions by type
budgetRemainingnumberRemaining token budget (if set)
budgetPercentUsednumberBudget utilization percentage

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/stats',
  {
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const stats = await response.json();
console.log(`Agent stats:`);
console.log(`- Total actions: ${stats.actionsCount}`);
console.log(`- Tokens spent: ${stats.tokensSpent}`);
console.log(`- Success rate: ${(stats.successRate * 100).toFixed(1)}%`);
console.log(`- Budget used: ${stats.budgetPercentUsed.toFixed(1)}%`);

cURL:

bash
curl -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/stats'

Possible Errors

Status CodeErrorDescription
404Not FoundAgent or board not found
401UnauthorizedInvalid API key

List Agent Presets

Retrieves available predefined agent personas with default configurations.

Request

http
GET /agent-presets
X-API-Key: your-api-key

Response

Status Code: 200 OK

json
[
  {
    "id": "preset-uuid-1",
    "name": "AI Tutor",
    "persona": "tutor",
    "description": "Helpful AI assistant that provides hints and guidance without giving direct answers",
    "avatarUrl": "https://cdn.boardapi.io/avatars/tutor.png",
    "defaultInstructions": {
      "description": "AI tutor for educational boards",
      "goals": [
        "Help students understand concepts",
        "Provide hints without giving answers",
        "Encourage critical thinking"
      ],
      "rules": [
        "Never give direct answers",
        "Always be supportive",
        "Adapt to student level"
      ],
      "triggers": [
        {
          "event": "object:created",
          "condition": "object.data.needsHelp === true",
          "action": "generate_hint"
        }
      ]
    },
    "configurableFields": ["scope", "maxActionsPerMinute", "budgetTokens"],
    "category": "education",
    "isActive": true,
    "createdAt": "2025-11-01T00:00:00Z"
  },
  {
    "id": "preset-uuid-2",
    "name": "Moderator Bot",
    "persona": "moderator",
    "description": "Monitors board activity and enforces rules",
    "avatarUrl": "https://cdn.boardapi.io/avatars/moderator.png",
    "defaultInstructions": {
      "description": "Content moderation agent",
      "goals": [
        "Maintain respectful environment",
        "Detect inappropriate content",
        "Alert teacher to issues"
      ],
      "rules": [
        "Flag offensive content",
        "Be impartial",
        "Escalate serious issues"
      ],
      "triggers": [
        {
          "event": "object:created",
          "action": "evaluate_content"
        }
      ]
    },
    "configurableFields": ["scope"],
    "category": "moderation",
    "isActive": true,
    "createdAt": "2025-11-01T00:00:00Z"
  }
]

Example Requests

JavaScript/TypeScript:

javascript
const response = await fetch(
  'https://api.boardapi.io/api/v1/agent-presets',
  {
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
);

const presets = await response.json();
console.log('Available agent presets:');
presets.forEach(preset => {
  console.log(`- ${preset.name} (${preset.persona}): ${preset.description}`);
});

cURL:

bash
curl -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/agent-presets'

Use Cases

  • Display preset selector in UI
  • Quick-start agent creation
  • Discover available agent types

Possible Errors

Status CodeErrorDescription
401UnauthorizedInvalid API key

Get Agent Preset

Retrieves details of a specific agent preset including default instructions.

Request

http
GET /agent-presets/:persona
X-API-Key: your-api-key

URL Parameters

ParameterTypeDescription
personastringPreset identifier (e.g., tutor, moderator)

Response

Status Code: 200 OK

json
{
  "id": "preset-uuid-1",
  "name": "AI Tutor",
  "persona": "tutor",
  "description": "Helpful AI assistant that provides hints and guidance without giving direct answers",
  "avatarUrl": "https://cdn.boardapi.io/avatars/tutor.png",
  "defaultInstructions": {
    "description": "AI tutor for educational boards",
    "goals": [
      "Help students understand concepts",
      "Provide hints without giving answers",
      "Encourage critical thinking"
    ],
    "rules": [
      "Never give direct answers",
      "Always be supportive",
      "Adapt to student level"
    ],
    "triggers": [
      {
        "event": "object:created",
        "condition": "object.data.needsHelp === true",
        "action": "generate_hint"
      }
    ]
  },
  "configurableFields": ["scope", "maxActionsPerMinute", "budgetTokens"],
  "category": "education",
  "isActive": true,
  "createdAt": "2025-11-01T00:00:00Z"
}

Example Requests

JavaScript/TypeScript:

javascript
// Get tutor preset and create agent from it
const preset = await fetch(
  'https://api.boardapi.io/api/v1/agent-presets/tutor',
  {
    headers: {
      'X-API-Key': 'your-api-key'
    }
  }
).then(r => r.json());

// Create agent using preset instructions
const agent = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: preset.name,
      persona: preset.persona,
      instructions: preset.defaultInstructions,
      maxActionsPerMinute: 10
    })
  }
).then(r => r.json());

console.log(`Created ${agent.name} from preset`);

cURL:

bash
curl -H "X-API-Key: your-api-key" \
  'https://api.boardapi.io/api/v1/agent-presets/tutor'

Possible Errors

Status CodeErrorDescription
404Not FoundPreset not found
401UnauthorizedInvalid API key

Response Status Codes

CodeMeaningDescription
200OKRequest succeeded
201CreatedAgent created successfully
204No ContentAgent deleted successfully
400Bad RequestInvalid agent data or parameters
401UnauthorizedMissing or invalid API key
404Not FoundAgent, board, or preset not found
500Internal Server ErrorServer error occurred

Common Use Cases

Create a Tutor Agent

javascript
// Create AI tutor that helps with vocabulary
const tutor = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Vocabulary Helper',
      persona: 'tutor',
      instructions: {
        description: 'Helps students learn new vocabulary',
        goals: [
          'Provide contextual hints',
          'Explain word usage',
          'Encourage practice'
        ],
        rules: [
          'Never translate directly',
          'Give examples in sentences',
          'Be patient and encouraging'
        ],
        triggers: [
          {
            event: 'object:created',
            condition: "object.type === 'sticky-note' && object.data.needsHelp",
            action: 'generate_hint',
            params: {
              hintType: 'contextual'
            }
          }
        ]
      },
      scope: {
        frames: ['vocabulary-frame-uuid'],
        objectTypes: ['sticky-note']
      },
      maxActionsPerMinute: 15,
      budgetTokens: 100000
    })
  }
).then(r => r.json());

console.log(`Created tutor: ${tutor.id}`);

Create a Timer Agent

javascript
// Create timer that sends periodic reminders
const timer = await fetch(
  'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents',
  {
    method: 'POST',
    headers: {
      'X-API-Key': 'your-api-key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Activity Timer',
      persona: 'timer',
      instructions: {
        description: 'Countdown timer for timed activities',
        goals: ['Track time', 'Send reminders'],
        rules: ['Be concise', 'Show time remaining'],
        triggers: [],
        schedule: [
          {
            at: 'every:5min',
            action: 'send_notification',
            params: {
              message: '5 minutes elapsed'
            }
          },
          {
            at: 'every:1min',
            action: 'update_object',
            params: {
              objectId: 'timer-display',
              updateType: 'decrement'
            }
          }
        ]
      },
      visibility: 'visible',
      maxActionsPerMinute: 5
    })
  }
).then(r => r.json());

console.log(`Timer started: ${timer.id}`);

Monitor Agent Performance

javascript
// Periodically check agent stats
setInterval(async () => {
  const stats = await fetch(
    'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/stats',
    {
      headers: {
        'X-API-Key': 'your-api-key'
      }
    }
  ).then(r => r.json());

  console.log(`Agent stats:`);
  console.log(`- Actions: ${stats.actionsCount}`);
  console.log(`- Tokens: ${stats.tokensSpent}/${stats.budgetRemaining + stats.tokensSpent}`);
  console.log(`- Success: ${(stats.successRate * 100).toFixed(1)}%`);

  // Pause agent if budget nearly exhausted
  if (stats.budgetPercentUsed > 90) {
    await fetch(
      'https://api.boardapi.io/api/v1/boards/board-uuid-456/agents/agent-uuid-123/pause',
      {
        method: 'POST',
        headers: {
          'X-API-Key': 'your-api-key'
        }
      }
    );
    console.log('Agent paused: budget nearly exhausted');
  }
}, 60000); // Check every minute

Next Steps