Appearance
Logs API
API endpoints for accessing request logs and execution traces.
User Logs
Get your recent request history.
http
GET /logs/userQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
limit | number | Max records (default: 10) |
statusCode | number | Filter by status code |
actionId | string | Filter by action |
Example:
bash
curl "https://api.universalapi.co/logs/user?limit=5" \
-H "X-Uni-UserId: $USER_ID" \
-H "X-Uni-SecretUniversalKey: $SECRET_KEY"Response:
json
{
"success": true,
"data": {
"logs": [
{
"requestId": "abc-123",
"userId": "user-id",
"actionId": "act-458dfb350d314769",
"timestamp": 1736734800000,
"timestampISO": "2025-01-13T12:00:00.000000",
"path": "/action/act-458dfb350d314769",
"statusCode": 200,
"status": "COMPLETED",
"xRayTraceId": "1-xxx-yyy",
"traceUrl": "https://api.universalapi.co/logs/trace/1-xxx-yyy",
"metrics": {
"executionTime": 245,
"memoryMb": 128,
"creditsUsed": 1
},
"output": {
"statusCode": 200,
"body": {"message": "Hello!"}
}
}
],
"total": 5
}
}Action-Specific Logs
Get logs for a specific action.
http
GET /logs/user/action/{actionId}Example:
bash
curl "https://api.universalapi.co/logs/user/action/act-458dfb350d314769" \
-H "X-Uni-UserId: $USER_ID" \
-H "X-Uni-SecretUniversalKey: $SECRET_KEY"Request Log
Get details for a specific request.
http
GET /logs/request/{requestId}Example:
bash
curl "https://api.universalapi.co/logs/request/abc-123" \
-H "X-Uni-UserId: $USER_ID" \
-H "X-Uni-SecretUniversalKey: $SECRET_KEY"Response:
json
{
"success": true,
"data": {
"requestId": "abc-123",
"traceId": "1-xxx-yyy",
"hasCloudWatchLogs": true,
"logs": [
{
"timestamp": 1736734800000,
"message": "START RequestId: abc-123",
"logGroup": "/aws/lambda/universalapi-stack-...",
"level": "unknown"
},
{
"timestamp": 1736734800100,
"message": "[INFO] Action executed successfully in 245ms",
"level": "info"
}
]
}
}Trace Log
Get comprehensive trace information including timeline and all related requests.
http
GET /logs/trace/{traceId}Example:
bash
curl "https://api.universalapi.co/logs/trace/1-xxx-yyy" \
-H "X-Uni-UserId: $USER_ID" \
-H "X-Uni-SecretUniversalKey: $SECRET_KEY"Response:
json
{
"success": true,
"data": {
"traceId": "1-xxx-yyy",
"hasXRayData": true,
"trace": {
"id": "1-xxx-yyy",
"status": "complete",
"requestCount": 2,
"duration": 2831,
"timeline": {
"nodes": [
{
"id": "abc-123",
"userId": "user-id",
"actionId": "act-xxx",
"path": "/action/act-xxx",
"timestamp": 1736734800000,
"status": "COMPLETED",
"statusCode": 200,
"executionTime": 245,
"parentId": "ROOT",
"children": []
}
],
"count": 1
},
"logs": [
{
"timestamp": 1736734800000,
"message": "[INFO] Function execution started",
"level": "info"
}
],
"keyEvents": [
{
"type": "report",
"timestamp": 1736734802831,
"function": "universalapi-stack-ActionHandler",
"duration": 2786.53,
"billedDuration": 2787,
"memorySize": 128,
"memoryUsed": 79
}
]
},
"dbRequests": [
{
"requestId": "abc-123",
"actionId": "act-xxx",
"status": "COMPLETED",
"output": {"statusCode": 200, "body": {"message": "Hello!"}}
}
]
},
"debug": {
"xrayConsoleUrl": "https://us-east-1.console.aws.amazon.com/xray/home?..."
}
}Workflow Logs
Get all requests in a workflow (requests sharing the same root).
http
GET /logs/workflowQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
rootRequestId | string | Root request ID |
Example:
bash
curl "https://api.universalapi.co/logs/workflow?rootRequestId=root-123" \
-H "X-Uni-UserId: $USER_ID" \
-H "X-Uni-SecretUniversalKey: $SECRET_KEY"Log Levels
| Level | Description |
|---|---|
info | Informational messages |
warn | Warnings |
error | Errors |
unknown | System messages (START, END, REPORT) |
Request Status Values
| Status | Description |
|---|---|
PROCESSING | Request is being processed |
COMPLETED | Request completed successfully |
FAILED | Request failed with error |
Debugging Tips
- Use trace URLs - Every response includes
debug.traceUrl - Check execution time - Found in
meta.executionTime - Review logs - The trace endpoint shows CloudWatch logs
- Check memory -
memoryUsedvsmemorySizehelps identify issues - Follow the timeline - Multi-step requests show parent/child relationships