Monetize360
Workflows

API Reference

Complete API reference for Monetize360 platform

API Reference

Monetize360 provides a comprehensive REST API for programmatic access to all platform features.

Base URL

https://api.monetize360.com/v1

Authentication

All API requests require authentication using Bearer tokens:

curl -H "Authorization: Bearer YOUR_API_TOKEN" \
  https://api.monetize360.com/v1/workflows

[Image placeholder: API authentication flow]

API Endpoints

Workflows

Execute and manage workflows:

POST /workflows/{workflowId}/execute
GET /workflows/{workflowId}
GET /workflows/{workflowId}/executions
GET /workflows/{workflowId}/executions/{executionId}

Objects (Data Models)

Manage data models:

GET /mobjects
POST /mobjects
GET /mobjects/{mobjectId}
PUT /mobjects/{mobjectId}
DELETE /mobjects/{mobjectId}

MData (Records)

CRUD operations on records:

POST /mobjects/{mobjectId}/mdata
GET /mobjects/{mobjectId}/mdata/{mdataId}
PUT /mobjects/{mobjectId}/mdata/{mdataId}
DELETE /mobjects/{mobjectId}/mdata/{mdataId}
GET /mobjects/{mobjectId}/mdata

[Image placeholder: API endpoint structure]

Execute Workflow

Start a workflow execution:

POST /workflows/{workflowId}/execute
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "data": {
    "customerId": "cust-123",
    "amount": 250.00,
    "action": "process"
  },
  "async": false
}

Response

{
  "executionId": "exec-789-xyz",
  "status": "completed",
  "startedAt": "2024-01-15T10:30:00Z",
  "completedAt": "2024-01-15T10:30:15Z",
  "output": {
    "orderId": "ord-456",
    "status": "success",
    "result": {...}
  }
}

[Image placeholder: Workflow execution flow]

Query MData

Query records with filters:

GET /mobjects/{mobjectId}/mdata?filter=status:eq:active&limit=50&offset=0
Authorization: Bearer YOUR_API_TOKEN

Query Parameters

ParameterTypeDescription
filterstringFilter expression
limitintegerMaximum records to return (default: 50)
offsetintegerNumber of records to skip
sortstringSort field and direction
fieldsstringComma-separated list of fields to return

Filter Syntax

field:operator:value

Operators:

  • eq - Equals
  • ne - Not equals
  • gt - Greater than
  • lt - Less than
  • gte - Greater than or equal
  • lte - Less than or equal
  • in - In array
  • contains - Contains substring

[Image placeholder: Query filtering examples]

Create MData

Insert a new record:

POST /mobjects/{mobjectId}/mdata
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "data": {
    "name": "John Doe",
    "email": "john@example.com",
    "status": "active",
    "tier": "premium"
  }
}

Response

{
  "id": "7f8a2ea8-6d9a-5f3b-b9f7-9f7b6d9a2eb1",
  "mobjectId": "3f9a1ea8-5d9a-4f2b-a8f6-8f6b5d9a1ea9",
  "data": {
    "name": "John Doe",
    "email": "john@example.com",
    "status": "active",
    "tier": "premium"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Update MData

Update an existing record:

PUT /mobjects/{mobjectId}/mdata/{mdataId}
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "data": {
    "status": "inactive",
    "deactivatedAt": "2024-01-15T10:30:00Z"
  }
}

Delete MData

Delete a record:

DELETE /mobjects/{mobjectId}/mdata/{mdataId}
Authorization: Bearer YOUR_API_TOKEN

Response

{
  "success": true,
  "message": "Record deleted successfully"
}

[Image placeholder: CRUD operations diagram]

Bulk Operations

Bulk Insert

Insert multiple records at once:

POST /mobjects/{mobjectId}/mdata/bulk
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "data": [
    {"name": "Customer 1", "email": "c1@example.com"},
    {"name": "Customer 2", "email": "c2@example.com"},
    {"name": "Customer 3", "email": "c3@example.com"}
  ]
}

Response

{
  "success": true,
  "totalProcessed": 3,
  "created": 3,
  "failed": 0,
  "data": [...]
}

Error Handling

All errors follow a consistent format:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid email address format",
    "details": {
      "field": "email",
      "value": "invalid-email"
    },
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Too Many Requests
500Internal Server Error

[Image placeholder: Error response examples]

Rate Limiting

API requests are rate limited:

  • Standard: 100 requests per minute
  • Premium: 1000 requests per minute
  • Enterprise: Custom limits

Rate limit headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1705363260

Pagination

Large result sets are paginated:

GET /mobjects/{mobjectId}/mdata?limit=50&offset=0

Response includes pagination metadata:

{
  "data": [...],
  "pagination": {
    "total": 500,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  }
}

[Image placeholder: Pagination flow]

Webhooks

Configure webhooks to receive real-time notifications:

POST /webhooks
Content-Type: application/json
Authorization: Bearer YOUR_API_TOKEN

{
  "url": "https://your-app.com/webhook",
  "events": ["workflow.completed", "mdata.created"],
  "secret": "your-webhook-secret"
}

Webhook Payload

{
  "event": "workflow.completed",
  "timestamp": "2024-01-15T10:30:00Z",
  "data": {
    "workflowId": "workflow-uuid",
    "executionId": "execution-uuid",
    "status": "completed",
    "output": {...}
  }
}

[Image placeholder: Webhook architecture]

SDK Support

Official SDKs available:

  • JavaScript/TypeScript: npm install @monetize360/sdk
  • Python: pip install monetize360
  • Java: Maven/Gradle packages
  • Go: go get github.com/monetize360/sdk-go

JavaScript Example

import { Monetize360Client } from '@monetize360/sdk';

const client = new Monetize360Client({
  apiKey: 'YOUR_API_TOKEN',
  baseUrl: 'https://api.monetize360.com/v1'
});

// Execute workflow
const result = await client.workflows.execute('workflow-id', {
  data: { customerId: 'cust-123' }
});

// Query MData
const records = await client.mdata.query('mobject-id', {
  filter: 'status:eq:active',
  limit: 50
});

Python Example

from monetize360 import Client

client = Client(api_key='YOUR_API_TOKEN')

# Execute workflow
result = client.workflows.execute(
    workflow_id='workflow-id',
    data={'customerId': 'cust-123'}
)

# Query MData
records = client.mdata.query(
    mobject_id='mobject-id',
    filter='status:eq:active',
    limit=50
)

[Image placeholder: SDK examples]

Best Practices

  1. Use API Keys Securely: Store in environment variables
  2. Handle Rate Limits: Implement exponential backoff
  3. Validate Input: Check data before sending
  4. Use Pagination: For large datasets
  5. Handle Errors: Implement proper error handling
  6. Use Webhooks: For real-time updates
  7. Cache Responses: When appropriate
  8. Monitor Usage: Track API consumption

Testing

Use the API sandbox for testing:

https://sandbox.monetize360.com/v1

Test credentials are provided in your developer portal.

[Image placeholder: API testing environment]

Support