Skip to main content

Logs API

Endpoints for workflow execution logs.

Base URL

http://localhost:3001/logs
Authentication Required

All log endpoints require authentication.

Endpoints

Get All Logs

Returns execution logs for the authenticated user.

GET /logs

Query Parameters:

ParameterTypeDefaultDescription
limitnumber50Max logs to return
skipnumber0Number of logs to skip

Example:

GET /logs?limit=10&skip=0

Success Response (200):

{
"logs": [
{
"_id": "507f1f77bcf86cd799439013",
"userId": "507f1f77bcf86cd799439011",
"workflowId": {
"_id": "507f1f77bcf86cd799439012",
"name": "Meeting Follow-up",
"actions": ["generate_mom", "send_email"]
},
"status": "completed",
"actionsExecuted": ["generate_mom", "send_email"],
"error": null,
"executedAt": "2024-12-26T15:30:05.000Z",
"createdAt": "2024-12-26T15:30:00.000Z",
"updatedAt": "2024-12-26T15:30:05.000Z"
},
{
"_id": "507f1f77bcf86cd799439014",
"workflowId": {
"_id": "507f1f77bcf86cd799439015",
"name": "Weekly Report",
"actions": ["generate_mom", "teams_post"]
},
"status": "failed",
"actionsExecuted": ["generate_mom"],
"error": "Missing required permissions: ChannelMessage.Send",
"executedAt": "2024-12-26T14:00:05.000Z"
}
],
"total": 25,
"limit": 10,
"skip": 0
}

Response Fields:

FieldTypeDescription
logsarrayArray of log objects
totalnumberTotal number of logs
limitnumberRequested limit
skipnumberNumber skipped

Get Single Log

Returns a specific execution log.

GET /logs/:id

URL Parameters:

ParameterTypeDescription
idstringLog ID

Success Response (200):

{
"_id": "507f1f77bcf86cd799439013",
"userId": "507f1f77bcf86cd799439011",
"workflowId": {
"_id": "507f1f77bcf86cd799439012",
"name": "Meeting Follow-up",
"actions": ["generate_mom", "send_email"]
},
"status": "completed",
"actionsExecuted": ["generate_mom", "send_email"],
"error": null,
"executedAt": "2024-12-26T15:30:05.000Z",
"createdAt": "2024-12-26T15:30:00.000Z",
"updatedAt": "2024-12-26T15:30:05.000Z"
}

Error Response (404):

{
"error": "Log not found"
}

Log Object Schema

interface ExecutionLog {
_id: string
userId: string
workflowId: string | {
_id: string
name: string
actions: string[]
}
status: 'running' | 'completed' | 'failed'
actionsExecuted: string[]
error?: string
executedAt?: Date
createdAt: Date
updatedAt: Date
}

Status Values

StatusDescriptionVisual
runningExecution in progress🔄 Yellow
completedAll actions succeeded✅ Green
failedOne or more actions failed❌ Red

Pagination Example

First page:

GET /logs?limit=10&skip=0

Second page:

GET /logs?limit=10&skip=10

Third page:

GET /logs?limit=10&skip=20

Usage Examples

JavaScript/TypeScript

// Get recent logs
const response = await axios.get('/logs', {
params: { limit: 10, skip: 0 },
withCredentials: true
})

const { logs, total } = response.data
console.log(`Showing ${logs.length} of ${total} logs`)

// Get specific log
const log = await axios.get(`/logs/${logId}`, {
withCredentials: true
})
console.log(log.data.status)

cURL

# Get logs
curl -X GET "http://localhost:3001/logs?limit=10" \
-H "Cookie: connect.sid=your-session-cookie"

# Get single log
curl -X GET "http://localhost:3001/logs/507f1f77bcf86cd799439013" \
-H "Cookie: connect.sid=your-session-cookie"

Error Codes

CodeDescription
401Not authenticated
404Log not found
500Server error