REST API

The Minded REST API provides programmatic access to query your agent's analytics events data and manage your agents. This allows you to build custom dashboards, reports, and integrations.

Overview

  • Base URL: https://api.minded.com/api/v1

  • Authentication: API key (Bearer token)

  • Rate Limit: 3 requests per minute per IP

  • Format: JSON

Endpoints

  1. POST /api/v1/events/agent - Query agent analytics events

  2. GET /api/v1/agents/list - List your organization's agents

Authentication

Getting Your API Key

Contact Minded team to receive an API key.

Using Your API Key

Include your API key in the Authorization header:

API Endpoints

1. List Agents

GET /api/v1/agents

Get a list of all agents in your organization.

Response:

2. Query Agent Events

POST /api/v1/events/agent

Query analytics events for your agents.

Request Format:

Parameters

Parameter
Type
Required
Description

agentId

string

Yes

Your agent's UUID

filters.environment

string

No

One of: development, staging, production (default: production)

filters.sessionId

string

No

Filter by specific session

filters.eventName

string

No

Filter by event type

filters.startDate

string

No

Start date (ISO 8601 format)

filters.endDate

string

No

End date (ISO 8601 format)

limit

number

No

Records per page (1-1000, default: 100)

offset

number

No

Number of records to skip (default: 0)

Response Format

Event Types

The API returns various event types that track your agent's execution.

Built-in Events

The MindedJS SDK automatically tracks these events:

Event Type
Description
Payload Fields

invocation_start

Agent invocation started

triggerBody, triggerName

invocation_error

Error occurred during invocation

errorMessage, errorStack

node_execution

Flow node executed

nodeName, nodeType, nodeDisplayName, parameters (varies)

Custom Events

You can track custom events using the trackAnalyticsEvent() function in your agent code:

Key Points:

  • Custom events can have any eventName you choose

  • Payload can be any JSON-serializable object

  • Events are sent to the platform when deployed

  • When running locally, events are only logged (not sent to backend)

  • Analytics tracking never throws errors - failures are logged but don't affect execution

📚 For detailed usage examples and best practices, see the SDK Events - ANALYTICS_EVENT documentation.

Examples

List Your Agents

Basic Query

Fetch the last 50 events for your agent in production:

Query by Date Range

Fetch events from a specific time period:

Query by Session

Get all events for a specific session:

Query by Event Type

Filter by specific event types:

Rate Limiting

The API is limited to 3 requests per minute per IP address.

Error Codes

Code
Description

400

Bad request - missing required fields or invalid filters

401

Unauthorized - invalid or missing API key, or agent doesn't belong to your organization

429

Too many requests - rate limit exceeded

500

Internal server error - contact support

Last updated