The Conversation Design REST API provides traditional CRUD operations for managing personas, contacts, conversations, messages, and skills. These endpoints follow RESTful conventions and support standard HTTP methods.
Base URL: https://your-api-name.mercury.ratiomachina.com Authentication: x-mercury-api-key: YOUR_API_KEY
limit - Number of results (default: 50)offset - Skip results for paginationrole - Filter by persona rolearchived - Include archived personas{
"personas": [
{
"id": "uuid-here",
"externalId": "sales-alex-v1",
"name": "Sales Assistant Alex",
"data": {
"role": "sales",
"tone": "professional_friendly"
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"total": 125,
"limit": 50,
"offset": 0
}
}{
"name": "Customer Support Bot",
"externalId": "support-bot-v1",
"data": {
"role": "customer_support",
"tone": "empathetic_helpful",
"business_description": "Technical support",
"channel": "email",
"identity": {
"name": "Sarah",
"role": "Support Specialist"
}
}
}{
"persona": {
"id": "uuid-here",
"externalId": "support-bot-v1",
"name": "Customer Support Bot",
"data": {
"role": "customer_support",
"tone": "empathetic_helpful",
"business_description": "Technical support",
"channel": "email",
"identity": {
"name": "Sarah",
"role": "Support Specialist"
}
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}external_id - Persona's external identifier{
"persona": {
"id": "uuid-here",
"externalId": "sales-alex-v1",
"name": "Sales Assistant Alex",
"data": {
"role": "sales",
"tone": "professional_friendly",
"offers": [...],
"objections": [...]
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}Updates persona configuration. Only provided fields will be updated (partial updates supported).
{
"name": "Updated Sales Assistant",
"data": {
"tone": "professional_consultative",
"offers": [
{
"title": "Free Demo",
"description": "30-min product demo"
}
]
}
}{
"persona": {
"id": "uuid-here",
"externalId": "sales-alex-v1",
"name": "Updated Sales Assistant",
"data": {
"role": "sales",
"tone": "professional_consultative",
"offers": [...]
},
"updatedAt": "2024-01-15T11:30:00Z"
}
}⚠️ Warning: Deleting a persona will permanently remove it and all associated conversations and messages. This action cannot be undone.
external_id - Persona's external identifier{
"message": "Persona deleted successfully",
"deletedPersona": {
"id": "uuid-here",
"externalId": "sales-alex-v1"
}
}limit - Number of results (default: 50)offset - Skip results for paginationsearch - Search by name or emailarchived - Include archived contacts{
"contacts": [
{
"id": "uuid-here",
"externalId": "customer_12345",
"name": "John Smith",
"data": {
"email": "john@example.com",
"phone": "+1234567890",
"lead_source": "website_form"
},
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"total": 1250,
"limit": 50,
"offset": 0
}
}{
"name": "Jane Doe",
"externalId": "crm_contact_567",
"data": {
"email": "jane@company.com",
"phone": "+1987654321",
"company": "Acme Corp",
"lead_source": "trade_show",
"preferences": {
"channel": "email",
"frequency": "weekly"
}
}
}{
"contact": {
"id": "uuid-here",
"externalId": "crm_contact_567",
"name": "Jane Doe",
"data": {
"email": "jane@company.com",
"phone": "+1987654321",
"company": "Acme Corp",
"lead_source": "trade_show",
"preferences": {
"channel": "email",
"frequency": "weekly"
}
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}limit - Number of results (default: 50)offset - Skip results for paginationpersona_id - Filter by personacontact_id - Filter by contactchannel - Filter by communication channelarchived - Include archived conversations{
"conversations": [
{
"id": "uuid-here",
"externalId": "conv_website_john_smith",
"personaId": "persona-uuid",
"contactId": "contact-uuid",
"channel": "sms",
"messageCount": 12,
"lastMessageAt": "2024-01-15T14:22:00Z",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"total": 3420,
"limit": 50,
"offset": 0
}
}external_id - Conversation's external identifierlimit - Number of messages (default: 100)before - Messages before timestampafter - Messages after timestamp{
"messages": [
{
"id": "uuid-here",
"conversationId": "conv-uuid",
"content": "Hello, I'm interested in your product.",
"sender": "contact",
"data": {
"attachments": [],
"metadata": {}
},
"createdAt": "2024-01-15T10:30:00Z"
},
{
"id": "uuid-here-2",
"conversationId": "conv-uuid",
"content": "Thank you for your interest! I'd be happy to help you learn more about our solutions.",
"sender": "persona",
"data": {
"generated": true,
"confidence": 0.95
},
"createdAt": "2024-01-15T10:30:15Z"
}
],
"conversation": {
"id": "conv-uuid",
"externalId": "conv_website_john_smith"
}
}{
"content": "Can you tell me more about pricing?",
"sender": "contact",
"data": {
"channel": "sms",
"urgency": "normal"
}
}{
"message": {
"id": "uuid-here",
"conversationId": "conv-uuid",
"content": "Can you tell me more about pricing?",
"sender": "contact",
"data": {
"channel": "sms",
"urgency": "normal"
},
"createdAt": "2024-01-15T10:35:00Z"
}
}limit - Number of results (default: 50)offset - Skip results for paginationrole - Filter by skill rolearchived - Include archived skills{
"skills": [
{
"id": "uuid-here",
"externalId": "sentiment_analyzer_v1",
"name": "Sentiment Analyzer",
"data": {
"role": "sentiment_analysis",
"description": "Analyzes customer sentiment",
"inputSchema": {...},
"outputSchema": {...}
},
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"total": 25,
"limit": 50,
"offset": 0
}
}{
"name": "Knowledge Base Lookup",
"externalId": "kb_lookup_v1",
"data": {
"role": "knowledge",
"description": "Searches internal knowledge base",
"apiEndpoint": "https://api.example.com/kb/search",
"inputSchema": {
"type": "object",
"properties": {
"query": {"type": "string"}
}
},
"outputSchema": {
"type": "object",
"properties": {
"results": {"type": "array"}
}
}
}
}{
"skill": {
"id": "uuid-here",
"externalId": "kb_lookup_v1",
"name": "Knowledge Base Lookup",
"data": {
"role": "knowledge",
"description": "Searches internal knowledge base",
"apiEndpoint": "https://api.example.com/kb/search",
"inputSchema": {...},
"outputSchema": {...}
},
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T10:30:00Z"
}
}Retrieves execution history for a specific skill, including inputs, outputs, and performance metrics.
limit - Number of executions (default: 50)status - Filter by execution statusfrom - Executions after dateto - Executions before date{
"executions": [
{
"id": "exec-uuid",
"skillId": "skill-uuid",
"conversationId": "conv-uuid",
"input": {
"query": "pricing information"
},
"output": {
"results": [...]
},
"status": "success",
"executionTime": 245,
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"total": 156,
"limit": 50,
"offset": 0
}
}⚠️ Warning: Batch delete operations permanently remove multiple resources. These actions cannot be undone. Always verify your selection criteria before executing.
{
"criteria": {
"role": "sales",
"createdBefore": "2024-01-01T00:00:00Z"
},
"dryRun": true
}ids - Array of specific persona IDsexternalIds - Array of external IDsrole - Filter by persona rolecreatedBefore - Delete personas created before datecreatedAfter - Delete personas created after datedryRun - Return what would be deleted without deleting{
"message": "Batch delete completed",
"deletedCount": 15,
"deletedPersonas": [
{
"id": "uuid-1",
"externalId": "old-sales-bot-1",
"name": "Old Sales Bot 1"
},
{
"id": "uuid-2",
"externalId": "old-sales-bot-2",
"name": "Old Sales Bot 2"
}
],
"dryRun": false
}📦 Archive: Archive operations move resources to an archived state where they are hidden from normal operations but can be restored if needed.
{
"criteria": {
"role": "customer_support",
"lastUsedBefore": "2023-12-01T00:00:00Z"
},
"archiveReason": "Seasonal campaign ended"
}{
"message": "Batch archive completed",
"archivedCount": 8,
"archivedPersonas": [
{
"id": "uuid-1",
"externalId": "winter-support-bot",
"name": "Winter Support Bot",
"archivedAt": "2024-01-15T10:30:00Z",
"archiveReason": "Seasonal campaign ended"
}
]
}All successful responses follow a consistent structure with the resource name as the root key:
{
"persona": {
"id": "uuid-here",
"externalId": "sales-alex-v1",
"name": "Sales Assistant Alex",
...
}
}{
"personas": [...],
"pagination": {
"total": 125,
"limit": 50,
"offset": 0,
"hasNext": true
}
}{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"details": {
"field": "name",
"message": "Name is required"
}
}{
"error": "Resource not found",
"code": "NOT_FOUND",
"details": {
"resource": "persona",
"identifier": "non-existent-id"
}
}Now that you understand the REST API endpoints, explore the RPC API for more complex operations like conversation creation with automatic resource upserts.