HomeDocsSessions, Logs & Usage

Sessions, Logs & Usage

What your agents are doing right now, what they did, and what it cost.

Fabriq DeveloperREST APIConsoleafctl

Three views, answering three different questions. All three are exposed over the REST API and in the console; sessions are also reachable from afctl. None of them have SDK methods — they are operator surfaces, not request-path calls.

API calls in this doc need an Authorization: Bearer token for a console member, plus X-Organization-Id (and, for the audit endpoints, X-Tenant-Id). Each is gated on an organization scope, named per section below.

Sessions — who is live

A session is one live token, keyed by its jti. One is recorded every time a token is minted — for an external user via for_user, or for a console member signing in. It expires on its own when the token does, so the list is always "what could act right now", not history.

curl "https://dashboard.agenticfabriq.com/api/v1/sessions?population=external&limit=50" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Organization-Id: $ORG_ID"

Each item carries:

FieldMeaning
jtiThe token id. Also the handle you revoke by.
subjectext:{external_user_id} for one of your users, or the member id.
populationexternal | member
auth_levelHow strongly the subject was proven: app_asserted, app_signed, user_present, sso_session.
app_idWhich agent the token was issued to.
iat / expIssued-at and expiry, Unix seconds.
last_seenWhen this token was last used.
call_countHow many calls it has made.
kindmcp | broker — broker sessions are coding-agent brokers.
revokedWhether it has been killed.

Filters: population, app_id, auth_level, subject, include_broker, plus limit (up to 200) and offset. Requires sessions.view.

Revoking

curl -X DELETE https://dashboard.agenticfabriq.com/api/v1/sessions/$JTI \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Organization-Id: $ORG_ID"

# or
afctl sessions list --population external
afctl sessions revoke <jti>

Revocation cuts the token off at its next call, without disabling the account behind it. The check is fail-closed: if the revocation store cannot be reached, the call is refused rather than allowed. Requires sessions.revoke. In the console this is the Sessions page, which shows subject, proof, agent, calls, last seen and expiry with a revoke button on each row.


Logs — what happened

Every governed call emits an audit event before the response returns. Events are queried through the audit API, which is what the console's Logs page reads.

curl "https://dashboard.agenticfabriq.com/api/v1/audit/events?event_type=TOOL_INVOCATION&page_size=50" \
  -H "Authorization: Bearer $TOKEN" \
  -H "X-Organization-Id: $ORG_ID" \
  -H "X-Tenant-Id: $TENANT_ID"

An event carries:

{
  "event_id": "...",
  "timestamp": "2026-08-16T15:04:05Z",
  "event_type": "TOOL_INVOCATION",
  "action": "MCP_CALL",
  "status": "success",
  "service": "mcp",
  "user_id": "ext:sarah_42",
  "user_email": null,
  "tenant_id": "...",
  "resource_type": "tool",
  "resource_name": "google_gmail_list_messages",
  "http_method": "GET",
  "http_path": "/api/v1/tools/google/gmail/messages",
  "http_status_code": 200,
  "duration_ms": 412,
  "error_message": null,
  "app_id": "org-xxx_my-app",
  "external_user_id": "sarah_42",
  "is_external_user": true,
  "session_jti": "...",
  "metadata": { }
}

session_jti is the cross-link between this view and Sessions: given a suspicious call you can find the token that made it, and revoke it.

EndpointWhat it gives you
GET /api/v1/audit/eventsThe event list. Filters: event_type, action, status, user_id, user_email, service, source, app_id, search, start_time, end_time, team_id; paged with page and page_size (max 500). Scope: audit.view.
GET /api/v1/audit/statsTotals: total, successful, failed, active_users. Scope: audit.view.
GET /api/v1/audit/exportA streaming NDJSON download of the matching events, up to max_rows. Needs both audit.view and audit.export, so a view-only auditor cannot bulk-pull.
GET /api/v1/audit/my-eventsThe caller's own events, no org scope required. Extra hours filter; omit it for all-time.

Useful event_type values: TOOL_INVOCATION, CONNECTION, AUTH, PERMISSION, APPLICATION. In the console, the Logs page splits these into a Tool calls tab and a System events tab over the same data.


Usage — what it cost

Usage is counted per day, per organization, per provider, per user. It is what the console's Usage page draws, and what plan limits are enforced against.

EndpointWhat it gives you
GET /api/v1/organizations/{org_id}/usage/summaryPer-user totals with a per-provider breakdown, over the last `days` (default 30, max 90).
GET /api/v1/organizations/{org_id}/usage/timeseriesA daily series: date, total, and per-provider counts.
GET /api/v1/organizations/{org_id}/usage/orgOrganization totals plus a daily series.
GET /api/v1/organizations/{org_id}/usage/meThe caller’s own usage, same shape.
GET /api/v1/organizations/{org_id}/usage/user/{user_id}One user’s usage. A user may read their own without the scope.
GET /api/v1/organizations/{org_id}/creditsBalance for the current billing period — see below.
GET /api/v1/organizations/{org_id}/credits/breakdownWho spent it: per-user totals for the period.

These require the usage.view scope. Members who are not owners see only the users they manage.

The credits balance

GET /api/v1/organizations/{org_id}/credits returns the period's api_calls, credits_available, credits_remaining, base_limit, overage, percent_used, billing_cycle_start, active_users_count and addon_credit_limit. Plan limits are API calls per billing period, and calls are blocked once the limit is reached:

PlanAPI calls per period
Starter (free)20,000
Launch200,000
Growth2,000,000
CustomContract-negotiated

Add-on calls are sold in blocks of 10,000 on Launch and Growth, and land in addon_credit_limit on top of the plan allowance. The owner is warned at 85% of the total. Triggers require a paid plan — on Starter the Triggers surface is replaced by an upgrade prompt. See Pricing for the current figures.


Where each view lives in the console

Console pageShows
SessionsLive tokens, the proof behind each, and a revoke button.
LogsTool calls and system events, filterable by status, time and agent.
UsageCalls over time, per user and per provider, against your plan limit.
UsersEveryone your product has connected, and what they connected.
TriggersSubscriptions, recent provider events, and the delivery log.

Need help?

Our team is here to help you get started.