Complete API reference for managing campaigns, contacts, groups, and monitoring your teams through Microsoft Teams integration.
Base URL: https://api.monitorsky.cloud
Version: 2.0 | Last Updated: August 31, 2025
All API requests require proper authentication using JWT tokens. The API supports both standard login and Microsoft Teams SSO.
Authorization: Bearer YOUR_JWT_TOKEN
Authenticate with email/password to receive JWT token.
Endpoint: /monitorsky3-login
{
"email": "user@example.com",
"password": "your-password"
}
Authenticate using Microsoft Teams SSO token.
Endpoint: /teams-sso-login
{
"teamsToken": "teams-sso-token",
"timestamp": "2025-08-31T13:32:53.992Z"
}
action parameters to specify the operation.
All API actions use this single endpoint.
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| action | string | Yes | The API action to perform |
| timestamp | string | Yes | Current timestamp in ISO format |
| ... | varies | No | Additional parameters specific to each action |
Manage your marketing campaigns, create new campaigns, and send messages to your contact groups.
Retrieve all campaigns for the authenticated user.
{
"action": "getCampaigns",
"timestamp": "2025-08-31T13:32:53.992Z"
}
{
"data": [
{
"id": "campaign-id",
"name": "Campaign Name",
"subject": "Email Subject",
"status": "Draft",
"recipients": 100,
"sent": 85,
"opened": 42,
"clicked": 12,
"openRate": 49.4,
"clickRate": 14.1,
"createdAt": "2025-08-30T10:00:00.000Z"
}
]
}
Create a new campaign with specified details.
{
"action": "createCampaign",
"campaign": {
"name": "New Campaign",
"subject": "Email Subject",
"message": "Campaign message content",
"recipients": 100,
"groups": ["group-id-1", "group-id-2"],
"schedule": null,
"template": null
},
"timestamp": "2025-08-31T13:32:53.992Z"
}
Send an existing campaign to its target recipients.
{
"action": "sendCampaign",
"id": "8960367b-1e03-4824-979f-c6b529189345",
"timestamp": "2025-08-31T13:32:53.992Z"
}
{
"data": [
{
"success": true,
"message": "Campaign sent",
"sent": 1,
"opened": 0,
"clicked": 0,
"startDate": "2025-08-31T13:32:53.992Z"
}
]
}
Update an existing campaign's details.
{
"action": "updateCampaign",
"campaignId": "campaign-id",
"updates": {
"name": "Updated Campaign Name",
"subject": "Updated Subject"
},
"timestamp": "2025-08-31T13:32:53.992Z"
}
Delete a campaign permanently.
{
"action": "deleteCampaign",
"campaignId": "campaign-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Manage your contact database, import contacts, and handle contact information.
Retrieve all contacts for the authenticated user.
{
"action": "getContacts",
"timestamp": "2025-08-31T13:32:53.992Z"
}
{
"data": [
{
"id": "contact-id",
"name": "John Doe",
"email": "john@example.com",
"phone": "+1234567890",
"company": "Example Corp",
"jobTitle": "Manager",
"groups": ["group-id-1"],
"createdAt": "2025-08-30T10:00:00.000Z"
}
]
}
Refresh contacts from connected Microsoft Graph/Teams.
{
"action": "refreshContacts",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Add a new contact to your database.
{
"action": "createContact",
"contact": {
"name": "Jane Smith",
"email": "jane@example.com",
"phone": "+1987654321",
"company": "New Corp",
"jobTitle": "Director"
},
"timestamp": "2025-08-31T13:32:53.992Z"
}
Update an existing contact's information.
{
"action": "updateContact",
"contactId": "contact-id",
"updates": {
"name": "Updated Name",
"jobTitle": "Senior Manager"
},
"timestamp": "2025-08-31T13:32:53.992Z"
}
Remove a contact from your database.
{
"action": "deleteContact",
"contactId": "contact-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Organize your contacts into groups for targeted campaign delivery.
Retrieve all contact groups.
{
"action": "getGroups",
"timestamp": "2025-08-31T13:32:53.992Z"
}
{
"data": [
{
"id": "group-id",
"name": "Marketing Team",
"description": "Marketing department contacts",
"color": "blue",
"member_count": 25,
"is_active": true,
"created_at": "2025-08-30T10:00:00.000Z"
}
]
}
Get all contacts in a specific group.
{
"action": "getGroupMembers",
"groupId": "group-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Create a new contact group.
{
"action": "createGroup",
"group": {
"name": "Sales Team",
"description": "Sales department contacts",
"color": "green"
},
"timestamp": "2025-08-31T13:32:53.992Z"
}
Add a contact to a specific group.
{
"action": "addContactToGroup",
"contactId": "contact-id",
"groupID": "group-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Remove a contact from a specific group.
{
"action": "removeContactFromGroup",
"contactId": "contact-id",
"groupID": "group-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Add all existing contacts to a specific group.
{
"action": "addAllContactsToGroup",
"groupId": "group-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Get comprehensive statistics and analytics about your campaigns, contacts, and system performance.
Retrieve comprehensive dashboard statistics.
{
"action": "getDashboardStats",
"startDate": "2025-08-01T00:00:00.000Z",
"endDate": "2025-08-31T23:59:59.999Z",
"period": "month",
"includeBreakdowns": true,
"timestamp": "2025-08-31T13:32:53.992Z"
}
{
"data": [
{
"totalMessagesSent": 1250,
"totalMessagesDelivered": 1198,
"totalMessagesOpened": 589,
"totalMessagesClicked": 156,
"overallDeliveryRate": 95.8,
"overallOpenRate": 49.2,
"overallClickRate": 13.0,
"totalCampaigns": 12,
"activeCampaigns": 3,
"totalContacts": 450,
"totalGroups": 8
}
]
}
Get detailed performance metrics for campaigns.
{
"action": "getCampaignPerformance",
"startDate": "2025-08-01T00:00:00.000Z",
"endDate": "2025-08-31T23:59:59.999Z",
"campaignIds": ["campaign-id-1", "campaign-id-2"],
"timestamp": "2025-08-31T13:32:53.992Z"
}
Get contact growth and engagement analytics.
{
"action": "getContactAnalytics",
"startDate": "2025-08-01T00:00:00.000Z",
"endDate": "2025-08-31T23:59:59.999Z",
"includeGroups": true,
"timestamp": "2025-08-31T13:32:53.992Z"
}
Check system health and status.
{
"action": "getSystemStatus",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Handle unsubscribe requests and manage opt-out preferences.
Validate a JWT token from an unsubscribe link.
{
"action": "validateUnsubscribeToken",
"token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Process an unsubscribe request.
{
"action": "processUnsubscribe",
"token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
"unsubscribeType": "all",
"contactId": "contact-id",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Generate an unsubscribe token for a contact.
{
"action": "generateUnsubscribeToken",
"contactId": "contact-id",
"email": "contact@example.com",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Manage Microsoft Graph integration for Teams and Office 365 connectivity.
Initiate Microsoft Graph OAuth connection.
{
"action": "connectMSGraph",
"microsoftUsername": "user@company.com",
"email": "user@company.com",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Check the status of Microsoft Graph connection.
{
"action": "checkMSGraphStatus",
"microsoftUsername": "user@company.com",
"timestamp": "2025-08-31T13:32:53.992Z"
}
Check if Microsoft Graph is currently connected.
{
"action": "checkGraphIsConnected",
"timestamp": "2025-08-31T13:32:53.992Z"
}
{
"data": [
{
"connected": true,
"ping": 42,
"region": "weu"
}
]
}
# Send a campaign
curl -X POST https://api.monitorsky.cloud/webhook/m-api-v2 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"action": "sendCampaign",
"id": "your-campaign-id",
"timestamp": "'$(date -Iseconds)'"
}'
# Get all campaigns
curl -X POST https://api.monitorsky.cloud/webhook/m-api-v2 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"action": "getCampaigns",
"timestamp": "'$(date -Iseconds)'"
}'
# Get dashboard statistics
curl -X POST https://api.monitorsky.cloud/webhook/m-api-v2 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{
"action": "getDashboardStats",
"period": "month",
"timestamp": "'$(date -Iseconds)'"
}'
const monitorSkyAPI = async (action, payload = {}) => {
const response = await fetch('https://api.monitorsky.cloud/webhook/m-api-v2', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_JWT_TOKEN}`
},
body: JSON.stringify({
action,
timestamp: new Date().toISOString(),
...payload
})
});
return await response.json();
};
// Usage examples
const campaigns = await monitorSkyAPI('getCampaigns');
console.log(campaigns.data);
const campaignResult = await monitorSkyAPI('sendCampaign', {
id: 'campaign-id-here'
});
console.log(campaignResult.data);
const stats = await monitorSkyAPI('getDashboardStats', {
period: 'month',
includeBreakdowns: true
});
import requests
import json
from datetime import datetime
def monitorsky_api(action, payload=None):
if payload is None:
payload = {}
data = {
'action': action,
'timestamp': datetime.now().isoformat() + 'Z',
**payload
}
response = requests.post(
'https://api.monitorsky.cloud/webhook/m-api-v2',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {YOUR_JWT_TOKEN}'
},
json=data
)
return response.json()
# Usage
campaigns = monitorsky_api('getCampaigns')
print(campaigns['data'])
send_result = monitorsky_api('sendCampaign', {'id': 'campaign-id'})
print(send_result['data'])
All successful responses follow this format:
{
"data": [
{
// Response data object(s)
}
]
}
| HTTP Status | Description | Common Causes |
|---|---|---|
| 200 | Success | Request processed successfully |
| 400 | Bad Request | Invalid request format, missing required parameters |
| 401 | Unauthorized | Invalid or missing JWT token |
| 404 | Not Found | Resource not found, invalid endpoint |
| 500 | Internal Server Error | Server-side error in n8n workflow |
timestamp parameter in all requestsAuthorization header with JWT token