Functions
Get function execution logs
Get execution logs with pagination. Includes stats (totalExecutions, successful, failed, successRate, avgExecutionTime, lastRun).
GET
/api/functions/projects/{projectId}/functions/{functionId}/logsSDK setup
Create a client and set credentials (JWT and/or API key) before calling the API. Match the authentication type shown above.
import { Configuration, FunctionsApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const functions = new FunctionsApi(configuration);import { Configuration, FunctionsApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c3JfbW9yZ2FuX2RlIiwiZW1haWwiOiJtb3JnYW4uY2hlbkBub3J0aHdpbmQuZGV2IiwiZXhwIjoxODI1MTI5NjAwfQ.doc_preview_sig',
});
const functions = new FunctionsApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await functions.getFunctionLogs("proj_GwgUJW2BmZJh", "nQFn5CXpNfVb7KBz");const { data: result } = await functions.getFunctionLogs("proj_GwgUJW2BmZJh", "nQFn5CXpNfVb7KBz");Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
Use the auth endpoints to obtain a JWT.
No Request Yet
Send a request to see the full inspector
Authentication
Requires JWT
Note
Include your JWT in the
Authorization: Bearer YOUR_TOKEN header (user-facing apps, RBAC). View authentication guide →Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId | string | Yes | — |
functionId | string | Yes | — |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | No | — |
offset | integer | No | — |
Responses
200Function logs and stats
json
{
"success": true,
"data": {
"executions": [
{
"executedAt": "2024-01-15T10:30:00.000Z",
"executionTime": 125,
"success": true,
"result": {
"processed": 1
},
"triggerType": "document",
"triggerEvent": "create",
"invokedBy": "trigger"
},
{
"executedAt": "2024-01-15T10:29:00.000Z",
"executionTime": 0,
"success": false,
"error": "Timeout",
"invokedBy": "manual"
}
],
"stats": {
"totalExecutions": 42,
"successful": 40,
"failed": 2,
"successRate": 95.24,
"avgExecutionTime": 125,
"lastRun": "2024-01-15T10:30:00.000Z"
}
}
}{
"success": true,
"data": {
"executions": [
{
"executedAt": "2024-01-15T10:30:00.000Z",
"executionTime": 125,
"success": true,
"result": {
"processed": 1
},
"triggerType": "document",
"triggerEvent": "create",
"invokedBy": "trigger"
},
{
"executedAt": "2024-01-15T10:29:00.000Z",
"executionTime": 0,
"success": false,
"error": "Timeout",
"invokedBy": "manual"
}
],
"stats": {
"totalExecutions": 42,
"successful": 40,
"failed": 2,
"successRate": 95.24,
"avgExecutionTime": 125,
"lastRun": "2024-01-15T10:30:00.000Z"
}
}
}