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/v1Authentication
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_TOKENQuery Parameters
| Parameter | Type | Description |
|---|---|---|
filter | string | Filter expression |
limit | integer | Maximum records to return (default: 50) |
offset | integer | Number of records to skip |
sort | string | Sort field and direction |
fields | string | Comma-separated list of fields to return |
Filter Syntax
field:operator:valueOperators:
eq- Equalsne- Not equalsgt- Greater thanlt- Less thangte- Greater than or equallte- Less than or equalin- In arraycontains- 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_TOKENResponse
{
"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
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 429 | Too Many Requests |
| 500 | Internal 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: 1705363260Pagination
Large result sets are paginated:
GET /mobjects/{mobjectId}/mdata?limit=50&offset=0Response 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
- Use API Keys Securely: Store in environment variables
- Handle Rate Limits: Implement exponential backoff
- Validate Input: Check data before sending
- Use Pagination: For large datasets
- Handle Errors: Implement proper error handling
- Use Webhooks: For real-time updates
- Cache Responses: When appropriate
- Monitor Usage: Track API consumption
Testing
Use the API sandbox for testing:
https://sandbox.monetize360.com/v1Test credentials are provided in your developer portal.
[Image placeholder: API testing environment]
Support
- API Status: https://status.monetize360.com
- Documentation: https://docs.monetize360.com
- Support: support@monetize360.com
- Community: https://community.monetize360.com