Usage and logs

Activations

Every request to your deployed function and every scheduled execution is recorded as an activation. Activations are scoped to the active workspace — you only see activations for functions in your current workspace. Activations include status, duration, error details, request metadata, and response status.

List activations (GET /activations)

curl "https://api.fold.run/activations?function_id=fn_abc123&limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"

Query parameters:

Parameter Type Default Description
function_id string Filter by function ID
status string Filter: success, error, or timeout
limit number 50 Max results (max 100)

Response:

{
  "activations": [
    {
      "id": "act_abc123",
      "function_id": "fn_abc123",
      "tenant_id": "my-tenant",
      "status": "success",
      "duration_ms": 12,
      "error_message": null,
      "triggered_at": "2026-03-14T10:30:00Z",
      "response_status": 200
    }
  ]
}

Use activations to verify deploys, debug errors, or feed into your own monitoring.

Replay activations

Re-execute a past activation with the same request data. Useful for retrying failed requests or verifying a fix.

# Replay a single activation
curl -X POST "https://api.fold.run/activations/act_abc123/replay" \
  -H "Authorization: Bearer YOUR_TOKEN"

Replay up to 50 activations at once:

curl -X POST "https://api.fold.run/activations/bulk-replay" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "activation_ids": ["act_abc123", "act_def456", "act_ghi789"]
  }'

Returns per-activation results with success/failure status for each.

Via the SDK:

// Replay a single activation
await fold.replayActivation('act_abc123');

// Bulk replay
const results = await fold.bulkReplay(['act_abc123', 'act_def456']);

Activation detail (GET /activations/:id)

curl "https://api.fold.run/activations/act_abc123" \
  -H "Authorization: Bearer YOUR_TOKEN"

Returns the full activation record including request/response metadata, logs, subrequests, and error details.

Live streaming (GET /activations/stream)

Stream activations in real time via Server-Sent Events:

curl -N "https://api.fold.run/activations/stream" \
  -H "Authorization: Bearer YOUR_TOKEN"

Each SSE event is a JSON activation record. The stream automatically closes after ~28 seconds — reconnect to continue.

In the dashboard, the Activations page auto-refreshes every few seconds for a live view.

Usage metrics (GET /usage/:days?)

Daily aggregated usage for an organization over a configurable window.

curl "https://api.fold.run/usage/7" \
  -H "Authorization: Bearer YOUR_TOKEN"
Path param Type Default Max Description
days number 7 90 Number of days of history (optional)

Response:

{
  "tenant_id": "my-tenant",
  "days": 7,
  "totals": {
    "activations": 4280,
    "errors": 12,
    "total_cpu_ms": 51200,
    "total_requests": 4280,
    "ai_requests": 45,
    "ai_input_tokens": 120000,
    "ai_output_tokens": 85000
  },
  "daily": [
    {
      "date": "2026-03-14",
      "activations": 620,
      "errors": 2,
      "total_cpu_ms": 7400,
      "total_requests": 620,
      "storage_bytes": 1048576,
      "ai_requests": 8,
      "ai_input_tokens": 18000,
      "ai_output_tokens": 12000
    }
  ]
}

Requires admin, deployer, viewer, or billing-admin role.

Usage counts toward your monthly caps. For details on caps, overage pricing, and current-period usage, see Billing.

For a per-workspace usage breakdown, see Workspace Usage in the dashboard or use fold workspace usage from the CLI.

Logs (GET /logs)

Structured logs from function executions with filtering, full-text search, and CSV export.

curl "https://api.fold.run/logs?level=error&limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"

Query parameters

Parameter Type Default Description
function_id string Filter by function ID
level string Filter by level: log, warn, error, info, debug
since number Unix timestamp (ms) — return logs after this time
limit number 50 Max results (max 200)
q string Full-text search query (max 200 chars)
format string json Response format: json or csv

Response (JSON)

{
  "tenant_id": "my-tenant",
  "logs": [
    {
      "id": "log_abc123",
      "function_id": "fn_abc123",
      "level": "error",
      "message": "TypeError: Cannot read property 'id' of undefined",
      "exception": "TypeError: Cannot read property 'id' of undefined\n    at handler (index.js:12:5)",
      "outcome": "exception",
      "timestamp": 1710412200000
    }
  ]
}

Per-function logs (GET /logs/:function_id)

Same query parameters and response shape, scoped to a single function:

curl "https://api.fold.run/logs/fn_abc123?level=warn&since=1710400000000" \
  -H "Authorization: Bearer YOUR_TOKEN"

CSV export

Set format=csv to download logs as a CSV file:

curl "https://api.fold.run/logs?format=csv&level=error" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -o errors.csv

The response includes Content-Disposition: attachment with a timestamped filename.

Via the CLI

# View recent logs
fold logs

# Filter by status
fold logs --status error

# Tail logs in real time
fold logs -F

# Search logs
fold logs --search "timeout"

Scheduled executions

Functions triggered on a cron schedule are recorded as activations with the same status, duration, and error fields. Monitor them the same way as HTTP-triggered activations.

See Schedules for configuring cron triggers.

Subrequest tracking

Outbound HTTP requests made by your functions (subrequests) are tracked and visible via the /subrequests API endpoint or the Subrequests page in the dashboard. This helps you monitor external dependencies and debug connectivity issues.

Error groups

The platform automatically groups similar errors by fingerprint (error message + stack trace pattern). This helps you spot recurring issues without sifting through individual activations.

List error groups

curl "https://api.fold.run/error-groups?status=open&limit=20" \
  -H "Authorization: Bearer YOUR_TOKEN"
Parameter Type Default Description
status string Filter: open or resolved
function_id string Filter by function
limit number 50 Max results
offset number 0 Pagination offset

Resolve an error group

Mark an error group as resolved (or reopen it):

curl -X PATCH "https://api.fold.run/error-groups/eg_abc123" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "status": "resolved" }'

Via the SDK

// List open error groups
const { error_groups } = await fold.listErrorGroups({ status: 'open' });

// Resolve an error group
await fold.resolveErrorGroup('eg_abc123');

Dashboard

View error groups in the dashboard at Error Groups in the sidebar. Each group shows the error message, occurrence count, affected functions, and first/last seen timestamps.

Activity feed

The activity feed is an organization-scoped audit log of all user actions — deploys, secret changes, member invitations, setting updates, and more.

List activity

curl "https://api.fold.run/activity?limit=50" \
  -H "Authorization: Bearer YOUR_TOKEN"
Parameter Type Default Description
limit number 50 Max results (max 100)
page number 1 Page number
action string Filter by action type (e.g. deploy, secret.create)

Response includes actor names, action types, resource IDs, timestamps, and details.

Dashboard

View the activity feed at Activity in the sidebar. The feed is searchable and filterable by action type.

Analytics

Aggregated analytics data (request volume, error rates, latency percentiles) is available via the /analytics API endpoint and the Analytics page in the dashboard.

Where to see data

Data API CLI Dashboard
Activations GET /activations fold logs Functions > Activations
Usage metrics GET /usage Usage
Logs GET /logs fold logs Logs
Analytics GET /analytics Analytics
Subrequests GET /subrequests Subrequests