RATIO MACHINA STARTER logo

MERCURY

PersonaMonitorRuns REST API

The PersonaMonitorRuns REST API manages the execution instances of persona monitoring jobs. Track individual run results, performance metrics, and historical monitoring data.

Base URL & Authentication

Base URL: https://your-api-name.mercury.ratiomachina.com
Authentication: x-mercury-api-key: YOUR_API_KEY

List Monitor Runs

GET /persona-monitor-runs

Query Parameters

  • limit - Number of results (default: 50, max: 100)
  • offset - Skip results for pagination
  • jobId - Filter by monitor job ID
  • personaId - Filter by persona ID
  • status - Filter by run status (running, completed, failed, cancelled)
  • startDate - Filter runs after date
  • endDate - Filter runs before date

Response Example

{
  "runs": [
    {
      "id": "uuid-run-123",
      "jobId": "uuid-job-456",
      "personaId": "uuid-persona-789",
      "personaName": "Sales Assistant Alex",
      "status": "completed",
      "startedAt": "2024-01-15T10:00:00Z",
      "completedAt": "2024-01-15T10:30:00Z",
      "duration": 1800000,
      "results": {
        "totalConversations": 45,
        "successfulResponses": 43,
        "failedResponses": 2,
        "averageResponseTime": 1200,
        "satisfactionScore": 4.2
      },
      "metrics": {
        "cpuUsage": 0.25,
        "memoryUsage": 0.15,
        "apiCalls": 89,
        "tokensUsed": 12450
      },
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 142,
    "limit": 50,
    "offset": 0,
    "hasNext": true,
    "hasPrev": false
  }
}

Create Monitor Run

POST /persona-monitor-runs

Request Body

{
  "jobId": "uuid-job-456",
  "personaId": "uuid-persona-789",
  "configuration": {
    "conversationLimit": 100,
    "timeLimit": 3600,
    "monitoringScope": "active_conversations",
    "metricTypes": ["response_time", "satisfaction", "resolution_rate"],
    "alertThresholds": {
      "maxResponseTime": 30000,
      "minSatisfactionScore": 3.0,
      "maxFailureRate": 0.05
    }
  },
  "scheduledAt": "2024-01-15T14:00:00Z"
}

Response Example

{
  "run": {
    "id": "uuid-run-890",
    "jobId": "uuid-job-456",
    "personaId": "uuid-persona-789",
    "personaName": "Sales Assistant Alex",
    "status": "scheduled",
    "scheduledAt": "2024-01-15T14:00:00Z",
    "configuration": {
      "conversationLimit": 100,
      "timeLimit": 3600,
      "monitoringScope": "active_conversations"
    },
    "createdAt": "2024-01-15T13:45:00Z",
    "updatedAt": "2024-01-15T13:45:00Z"
  }
}

Get Monitor Run

GET /persona-monitor-runs/{id}

Path Parameters

  • id - Monitor run UUID

Response Example

{
  "run": {
    "id": "uuid-run-890",
    "jobId": "uuid-job-456",
    "personaId": "uuid-persona-789",
    "personaName": "Sales Assistant Alex",
    "status": "running",
    "startedAt": "2024-01-15T14:00:00Z",
    "progress": {
      "conversationsProcessed": 23,
      "totalConversations": 100,
      "percentComplete": 23,
      "estimatedCompletion": "2024-01-15T14:45:00Z"
    },
    "partialResults": {
      "averageResponseTime": 1150,
      "satisfactionScore": 4.1,
      "successRate": 0.96
    },
    "createdAt": "2024-01-15T13:45:00Z",
    "updatedAt": "2024-01-15T14:15:00Z"
  }
}

PersonaMonitorRuns API Best Practices

Run Management

  • Monitor run status and progress regularly
  • Set appropriate time and conversation limits
  • Configure alert thresholds for proactive monitoring
  • Use pagination for large result sets

Performance & Analytics

  • Track metrics like response time and satisfaction
  • Archive completed runs for historical analysis
  • Set up automated alerting for failures
  • Monitor resource usage and optimize accordingly
Transcend the hype with MERCURY by Ratio Machina