Skip to content

Error Tracking

Capture errors and exceptions, group them into issues, search and resolve — Sentry-style error monitoring.

Overview

Base path: https://api.infrai.cc/v1/errors
Auth header: Authorization: Bearer $INFRAI_API_KEY
bash
# Call any /v1/errors capability over raw HTTP — no SDK to install.
# curl:
curl https://api.infrai.cc/v1/errors/... \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json"

Methods

errors.capture

POST /v1/errors/capture

Capture an application error with optional tags.

Parameters

NameTypeRequiredDescription
messagestring
Required
Human-readable error message.
codestringOptionalOptional application error code.
stackstringOptionalOptional stack trace.
tagsRecord<string, string>OptionalKey/value tags for grouping.

Returns

{ ok, error_id }

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/capture \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"exception": {"type": "ValueError", "message": "bad input", "stacktrace": "..."}, "level": "error"}'

errors.message

POST /v1/errors/message

上报一条结构化错误或日志消息

Parameters

NameTypeRequiredDescription
textstring
Required
消息正文
level'debug' | 'info' | 'warning' | 'error' | 'fatal'Optional级别:debug/info/warning/error/fatal
tagsRecord<string, string>Optional键值标签,便于过滤与分组
user_idstringOptional关联的用户 ID
releasestringOptional发布版本标识
environment'production' | 'staging' | 'development'Optional环境:production/staging/development
idempotency_keystringOptional幂等键,用于避免重复写入

Returns

CaptureResult

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/message \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "..."}'

errors.list

GET /v1/errors/list

分页列出捕获到的错误事件

Parameters

NameTypeRequiredDescription
filterRecord<string, unknown>Optional过滤条件(观测过滤 DSL)
cursorstringOptional分页游标
limitnumberOptional每页返回数量

Returns

ErrorEventList

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/list \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.search

GET /v1/errors/search

按关键词搜索错误事件

Parameters

NameTypeRequiredDescription
qstring
Required
搜索关键词
filterRecord<string, unknown>Optional过滤条件(观测过滤 DSL)
cursorstringOptional分页游标
limitnumberOptional每页返回数量

Returns

ErrorEventList

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/search \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.get

GET /v1/errors/get/{event_id}

按事件 ID 获取错误事件详情

Parameters

NameTypeRequiredDescription
event_idstring
Required
错误事件 ID

Returns

ErrorEvent

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/get/EVENT_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.groups

GET /v1/errors/groups

分页列出错误分组

Parameters

NameTypeRequiredDescription
status'unresolved' | 'resolved' | 'ignored'Optional按状态过滤:unresolved/resolved/ignored
sort'count_desc' | 'last_seen_desc' | 'first_seen_desc'Optional排序方式:count_desc/last_seen_desc/first_seen_desc
cursorstringOptional分页游标
limitnumberOptional每页返回数量

Returns

ErrorGroupList

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/groups \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.group_detail

GET /v1/errors/group_detail/{error_group_id}

获取错误分组的聚合详情

Parameters

NameTypeRequiredDescription
error_group_idstring
Required
错误分组 ID

Returns

ErrorGroupDetail

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/group_detail/ERROR_GROUP_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.events

GET /v1/errors/events/{error_group_id}

列出某错误分组下的事件

Parameters

NameTypeRequiredDescription
error_group_idstring
Required
错误分组 ID
cursorstringOptional分页游标
limitnumberOptional每页返回数量

Returns

ErrorEventList

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/events/ERROR_GROUP_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.resolve

POST /v1/errors/resolve/{error_group_id}

将错误分组标记为已解决

Parameters

NameTypeRequiredDescription
error_group_idstring
Required
错误分组 ID

Returns

ErrorGroup

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/resolve/ERROR_GROUP_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"error_group_id": "..."}'

errors.unresolve

POST /v1/errors/unresolve/{error_group_id}

撤销错误分组的已解决状态

Parameters

NameTypeRequiredDescription
error_group_idstring
Required
错误分组 ID

Returns

ErrorGroup

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/unresolve/ERROR_GROUP_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"error_group_id": "..."}'

errors.ignore

POST /v1/errors/ignore/{error_group_id}

将错误分组标记为忽略

Parameters

NameTypeRequiredDescription
error_group_idstring
Required
错误分组 ID

Returns

ErrorGroup

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/ignore/ERROR_GROUP_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"error_group_id": "..."}'

errors.delete

DELETE /v1/errors/delete/{error_group_id}

删除错误分组

Parameters

NameTypeRequiredDescription
error_group_idstring
Required
错误分组 ID

Returns

DeleteResult

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X DELETE https://api.infrai.cc/v1/errors/delete/ERROR_GROUP_ID \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.bulk

POST /v1/errors/bulk

对多个错误分组批量执行操作

Parameters

NameTypeRequiredDescription
error_group_idsstring[]
Required
目标错误分组 ID 列表
action'resolve' | 'unresolve' | 'ignore' | 'delete'
Required
批量动作:resolve/unresolve/ignore/delete

Returns

ErrorBulkResult

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/bulk \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"error_group_ids": [], "action": "resolve"}'

errors.export

POST /v1/errors/export

导出错误数据

Parameters

NameTypeRequiredDescription
filterRecord<string, unknown>Optional过滤条件(观测过滤 DSL)
format'json' | 'csv'Optional导出格式:json 或 csv

Returns

ErrorExportResult

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/errors/export \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

errors.retention.get

GET /v1/errors/retention/get

查询错误数据保留期配置

Returns

{ days, auto_export_before_cleanup, export_destination }

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X GET https://api.infrai.cc/v1/errors/retention/get \
  -H "Authorization: Bearer $INFRAI_API_KEY"

errors.retention.set

PUT /v1/errors/retention/set

设置错误数据保留期

Parameters

NameTypeRequiredDescription
daysnumber
Required
保留天数
auto_export_before_cleanupbooleanOptional清理前是否自动导出
export_destinationstringOptional导出目标地址

Returns

{ days, auto_export_before_cleanup, export_destination }

Example

一次性前置(每个范例都假定已完成):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X PUT https://api.infrai.cc/v1/errors/retention/set \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"days": 0}'

All capabilities

Every routed capability in this module — the complete public REST contract. The methods above are the guided walkthrough; this index is the full reference.

CapabilityEndpointDescription
errors.bulkPOST /v1/errors/bulkBulk-apply resolve/ignore/delete and other actions across multiple error groups.
errors.capturePOST /v1/errors/captureCapture an error event, aggregated into a group by fingerprint.
errors.deleteDELETE /v1/errors/delete/{error_group_id}Delete a specified error group.
errors.eventsGET /v1/errors/events/{error_group_id}Page through all events within an error group.
errors.exportPOST /v1/errors/exportExport error data matching the filters (JSON or CSV).
errors.getGET /v1/errors/get/{event_id}Get the details of one error event by event ID.
errors.group_detailGET /v1/errors/group_detail/{error_group_id}Get the aggregated details of a specified error group.
errors.groupsGET /v1/errors/groupsPage through error groups, with status filtering and sorting.
errors.ignorePOST /v1/errors/ignore/{error_group_id}Mark an error group as ignored.
errors.listGET /v1/errors/listPage through captured error events, with filtering.
errors.messagePOST /v1/errors/messageCapture a structured error/log message (level, tags, user, release, environment).
errors.resolvePOST /v1/errors/resolve/{error_group_id}Mark an error group as resolved.
errors.retention.getGET /v1/errors/retention/getGet the retention-period configuration for error data.
errors.retention.setPUT /v1/errors/retention/setSet the retention period for error data, with auto-export before purge.
errors.searchGET /v1/errors/searchFull-text search error events by keyword.
errors.unresolvePOST /v1/errors/unresolve/{error_group_id}Revert an error group's resolved status.

End-to-end example

A production-style walkthrough of this module: configure once, then run the flow. It exercises most of the module's APIs.

A copy-paste-runnable single-file Python program (stdlib only, no SDK): set your INFRAI_API_KEY, run it, and walk this module's core flow with REAL billed calls — later steps reuse real fields returned by earlier ones. The 12-line helper is the entire integration.

python
#!/usr/bin/env python3
"""Infrai · errors — runnable real-app example (single file, zero deps).

Copy this file, set your key, run it: every step is a REAL call to
api.infrai.cc, billed at the real (tiny) per-call price, printing the
live JSON response. Get a key at https://infrai.cc/login (Google/
GitHub sign-in grants $2 free credit); add funds at
https://infrai.cc/billing. No SDK — the 12-line helper below is the
entire integration."""
import json
import os
from urllib import error, request

KEY = os.environ.get("INFRAI_API_KEY") or "ifr_..."  # <- your key
BASE = "https://api.infrai.cc"


# Same raw HTTPS POST/GET as every per-method example on this page —
# wrapped once for reuse. There is nothing else to it: no SDK.
def infrai(method, path, body=None):
    req = request.Request(
        BASE + path, method=method,
        data=json.dumps(body).encode() if body is not None else None,
        headers={"Authorization": f"Bearer {KEY}",
                 "Content-Type": "application/json"})
    try:
        with request.urlopen(req, timeout=60) as r:
            return json.loads(r.read())
    except error.HTTPError as e:
        return json.loads(e.read())


def show(label, resp):
    print(f"\n== {label} ==")
    print(json.dumps(resp, indent=2, ensure_ascii=False))
    return resp


# 1) errors.capture — POST /v1/errors/capture · Capture an error event, aggregated into a group by fingerprint.
r1 = show("errors.capture", infrai("POST", "/v1/errors/capture", {"exception":{"type":"ValueError","message":"bad input","stacktrace":"..."},"level":"error"}))

# 2) errors.message — POST /v1/errors/message · Capture a structured error/log message (level, tags, user, release, environment).
r2 = show("errors.message", infrai("POST", "/v1/errors/message", {"text":"..."}))

# 3) errors.list — GET /v1/errors/list · Page through captured error events, with filtering.
r3 = show("errors.list", infrai("GET", "/v1/errors/list"))