API Documentation

Complete reference for Monlyns's public API. Create AI agents, execute webhooks with multimodal file processing, and manage feedback without authentication.

🚀 Multimodal File Processing

Upload and process documents (DOC/DOCX/PDF), spreadsheets (XLS/XLSX/CSV), and images (JPG/PNG/GIF/WebP) directly through webhook endpoints. Files are automatically converted to text or analyzed for AI processing.

Base URL:https://monlyns.com
Format:JSON

Create AI Action

POST/api/public/ai-action

Create a new AI action with optional auto-enhancement capabilities.

Parameters

titlerequiredstring

Title of the AI action

descriptionrequiredstring

Description of what the AI action does

promptrequiredstring

AI prompt that defines the behavior

inputsrequiredarray

Array of input definitions with name, type, and description

outputsrequiredarray

Array of output definitions with name, type, and description

autoEnhanceoptionalboolean

Enable auto-enhancement (default: false)

enhancementIntervaloptionalnumber

Number of executions between enhancements (default: 10, min: 1)

Response Examples

Success Response
{
  "success": true,
  "aiAction": {
    "_id": "60f7b3b3b3b3b3b3b3b3b3b3",
    "title": "Smart Email Classifier",
    "description": "Classify emails by priority and urgency",
    "webhookUrl": "https://monlyns.com/webhook/60f7b3b3b3b3b3b3b3b3b3b3",
    "isActive": true,
    "autoTraining": {
      "enabled": true,
      "interval": 25
    }
  }
}
Error Response
{
  "success": false,
  "message": "Validation error: Title is required"
}

cURL Example

curl -X POST https://monlyns.com/api/public/ai-action \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Smart Email Classifier",
    "description": "Classify emails by priority and urgency",
    "prompt": "Analyze the email content and classify it based on priority (high, medium, low) and urgency (urgent, normal, low). Consider factors like sender importance, keywords, and content tone.",
    "inputs": [
      {
        "name": "email_content",
        "type": "string",
        "description": "The email content to analyze"
      },
      {
        "name": "sender_email",
        "type": "string",
        "description": "Email address of the sender"
      }
    ],
    "outputs": [
      {
        "name": "priority",
        "type": "string",
        "description": "Priority level: high, medium, or low"
      },
      {
        "name": "urgency",
        "type": "string",
        "description": "Urgency level: urgent, normal, or low"
      }
    ],
    "autoEnhance": true,
    "enhancementInterval": 25
  }'

Execute Webhook

POST/webhook/:webhookId

Execute an AI action via its webhook URL.

Parameters

webhookIdrequiredstring

The webhook ID from the AI action creation response

Dynamic inputsrequiredobject

Input data based on the AI action's input definitions

Response Examples

Success Response
{
  "success": true,
  "executionId": "60f7b3b3b3b3b3b3b3b3b3b4",
  "result": {
    "priority": "high",
    "urgency": "urgent"
  },
  "processingTime": 1250
}
Error Response
{
  "success": false,
  "message": "AI Action not found or inactive"
}

cURL Example

curl -X POST https://monlyns.com/webhook/60f7b3b3b3b3b3b3b3b3b3b3 \
  -H "Content-Type: application/json" \
  -d '{
    "email_content": "Hi team, we have an urgent client issue that needs immediate attention. The production server is down and affecting all users.",
    "sender_email": "ceo@company.com"
  }'

Execute Webhook with Files

POST/webhook/:webhookId

Execute an AI action with file uploads. Supports documents (DOC/DOCX/PDF), spreadsheets (XLS/XLSX/CSV), and images.

Parameters

webhookIdrequiredstring

The webhook ID from the AI action creation response

File inputsoptionalfile

Upload files using multipart/form-data. Supported formats: DOC, DOCX, PDF, XLS, XLSX, CSV, JPG, PNG, GIF, WebP

Text inputsoptionalstring

Additional text inputs as form fields

Response Examples

Success Response
{
  "success": true,
  "executionId": "60f7b3b3b3b3b3b3b3b3b3b5",
  "result": {
    "document_summary": "The PDF contains quarterly financial data showing 15% revenue growth...",
    "spreadsheet_insights": "Excel file shows sales data across 5 regions with North America leading...",
    "image_analysis": "Image contains a bar chart showing monthly trends..."
  },
  "processingTime": 2850,
  "filesProcessed": [
    {
      "fieldname": "document",
      "filename": "document.pdf",
      "size": 245760,
      "type": "application/pdf",
      "processed": true
    },
    {
      "fieldname": "spreadsheet",
      "filename": "data.xlsx",
      "size": 89432,
      "type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
      "processed": true
    }
  ]
}
Error Response
{
  "success": false,
  "message": "File size exceeds 10MB limit"
}

cURL Example

curl -X POST https://monlyns.com/webhook/60f7b3b3b3b3b3b3b3b3b3b3 \
  -F "document=@/path/to/document.pdf" \
  -F "spreadsheet=@/path/to/data.xlsx" \
  -F "image=@/path/to/image.jpg" \
  -F "additional_context=Please analyze the uploaded files and extract key insights"

Submit Feedback

POST/api/public/feedback/:executionId

Submit feedback for an execution to improve AI performance.

Parameters

executionIdrequiredstring

The execution ID from the webhook response

ratingrequirednumber

Rating from 1-5 (1=poor, 5=excellent)

feedbackoptionalstring

Optional feedback text

expectedOutputoptionalobject

Expected output for training purposes

Response Examples

Success Response
{
  "success": true,
  "message": "Feedback submitted successfully"
}
Error Response
{
  "success": false,
  "message": "Execution not found"
}

cURL Example

curl -X POST https://monlyns.com/api/public/feedback/60f7b3b3b3b3b3b3b3b3b3b4 \
  -H "Content-Type: application/json" \
  -d '{
    "rating": 5,
    "feedback": "Perfect classification! The AI correctly identified this as high priority and urgent.",
    "expectedOutput": {
      "priority": "high",
      "urgency": "urgent"
    }
  }'

Get Execution Details

GET/api/public/execution/:executionId

Retrieve details of a specific execution.

Parameters

executionIdrequiredstring

The execution ID to retrieve

Response Examples

Success Response
{
  "success": true,
  "execution": {
    "_id": "60f7b3b3b3b3b3b3b3b3b3b4",
    "aiActionId": "60f7b3b3b3b3b3b3b3b3b3b3",
    "input": {
      "email_content": "Hi team, urgent issue...",
      "sender_email": "ceo@company.com"
    },
    "output": {
      "priority": "high",
      "urgency": "urgent"
    },
    "success": true,
    "processingTime": 1250,
    "createdAt": "2023-07-20T10:30:00.000Z"
  }
}
Error Response
{
  "success": false,
  "message": "Execution not found"
}

cURL Example

curl -X GET https://monlyns.com/api/public/execution/60f7b3b3b3b3b3b3b3b3b3b4

Get Webhook Info

GET/webhook/:webhookId/info

Get information about a webhook including its inputs, outputs, and usage.

Parameters

webhookIdrequiredstring

The webhook ID to get information about

Response Examples

Success Response
{
  "success": true,
  "webhook": {
    "title": "Smart Email Classifier",
    "description": "Classify emails by priority and urgency",
    "inputs": [
      {
        "name": "email_content",
        "type": "string",
        "description": "The email content to analyze"
      }
    ],
    "outputs": [
      {
        "name": "priority",
        "type": "string",
        "description": "Priority level"
      }
    ],
    "isActive": true,
    "executionCount": 42,
    "lastExecutedAt": "2023-07-20T10:30:00.000Z",
    "usageExample": {
      "email_content": "Sample email content"
    }
  }
}
Error Response
{
  "success": false,
  "message": "Webhook not found"
}

cURL Example

curl -X GET https://monlyns.com/webhook/60f7b3b3b3b3b3b3b3b3b3b3/info

Health Check

GET/health

Check the API health status.

Parameters

No parameters required

Response Examples

Success Response
{
  "status": "healthy",
  "timestamp": "2023-07-20T10:30:00.000Z",
  "uptime": 86400
}
Error Response
{
  "status": "error",
  "message": "Database connection failed"
}

cURL Example

curl -X GET https://monlyns.com/health

Multimodal File Processing

Upload and process various file types directly through webhook endpoints. Files are automatically converted and analyzed for AI processing.

Documents

  • • PDF: Text extraction from all pages
  • • DOC/DOCX: Full document content conversion
  • • Processing: Converted to plain text for AI analysis

Spreadsheets

  • • XLS/XLSX: All worksheets processed
  • • CSV: Direct data parsing
  • • Processing: Converted to structured text with sheet labels

Images

  • • JPG/PNG/GIF/WebP: Visual content analysis
  • • Processing: Converted to base64 Data URI for AI vision models
  • • Limit: 10MB per file

Technical Implementation

Upload Requirements

  • • Content-Type: multipart/form-data
  • • File Size Limit: 10MB per file
  • • Multiple Files: Supported in single request
  • • Field Names: Match your AI action input definitions

Processing Benefits

  • • Token Efficiency: Optimized text extraction
  • • Multi-format Support: Handle diverse file types
  • • Automatic Conversion: No preprocessing required
  • • Error Handling: Graceful failure with detailed messages

JavaScript Example

const formData = new FormData();
formData.append('document', fileInput.files[0]);
formData.append('context', 'Analyze this document for key insights');

fetch('https://monlyns.com/webhook/your-webhook-id', {
  method: 'POST',
  body: formData
})
.then(response => response.json())
.then(data => {
  console.log('AI Analysis:', data.result);
  console.log('Files Processed:', data.filesProcessed);
});

Ready to Start Building?

Create your first AI action and start integrating intelligent processing into your applications.