API Reference
Connector Insights
Aggregate counts across every connection, and the organization-wide audit trail of connector activity.
Operations on this page
| Operation | Method and path | Python | Node.js |
|---|---|---|---|
| Connector statistics | GET /api/v2/integrations/stats | connections.stats | connections.stats |
| Connector audit log | GET /api/v2/integrations/audit-logs | connections.audit_logs | connections.auditLogs |
Authentication and scope
| Requirement | Contract |
|---|---|
| Credential | An API key sent as X-API-Key. Connector operations are not end-user scoped. |
| Read scope | integrations:read for every GET. |
| Write scope | integrations:write for every POST, PUT, PATCH and DELETE. |
| Tenant | Derived from the authenticated key. There is no tenant parameter to pass or to get wrong. |
X-End-User-ID | Not used. A connection belongs to the organization, not to one end user. |
1. Read the counts
Aggregates across every connection in the organization: how many connections exist, how many objects they hold, how many memories came out, and when each last synced.
import osfrom memorysync import MemorySyncClientclient = MemorySyncClient(api_key=os.environ["MEMORYSYNC_API_KEY"],base_url="https://api.memorysync.io",)stats = client.connections.stats()print(stats["total_connections"], stats["connected"], stats["syncing"], stats["errors"])print(stats["total_objects"], "objects; last sync", stats["last_sync_at"])print(stats["enabled_providers"], "of", stats["total_providers"], "providers enabled")
GET/api/v2/integrations/stats
200 OK
| Field | Meaning |
|---|---|
total_providers, enabled_providers | The provider catalog and how much of it is turned on. |
total_connections, connected, syncing, errors | Connection counts by state. errors is the one to alert on. |
total_objects | Objects held across every connection. |
last_sync_at | The most recent sync anywhere in the organization. Nullable. |
2. Read the audit trail
Connector activity across the organization: connections created and removed, credentials replaced, purges run, configuration changed. This is the record an access review asks for.
import osfrom memorysync import MemorySyncClientclient = MemorySyncClient(api_key=os.environ["MEMORYSYNC_API_KEY"],base_url="https://api.memorysync.io",)# A bare JSON array, not an object with an entries key.for entry in client.connections.audit_logs(limit=100):print(entry["created_at"], entry["event_type"], entry["user_email"], entry["details"])
GET/api/v2/integrations/audit-logs
200 OK
| Parameter | Type | Contract |
|---|---|---|
connection_id | integer | Optional; narrow to one connection. |
event_type | string | Optional; narrow to one event type. The parameter is event_type, not action. |
limit | integer | Optional. Defaults to 50, capped at 200. |
offset | integer | Optional page offset. |
| Field | Meaning |
|---|---|
id | The entry id. |
event_type, event_category | What happened, and its grouping. |
provider_id | Which provider it concerned. Nullable. |
details | An object whose shape depends on the event type. |
user_email | Who did it, where a user was responsible. Nullable for system activity. |
created_at | When. |
Reading these safely
- Do not use
statsas a billing source. Use the billing API for usage against a plan. - On a
5xx, show the previous value rather than zero. Zero and unavailable look identical in a chart and mean opposite things. - The audit log is append-only and scoped to the organization. It is not a per-object trail — for that use object audit.
Errors and next action
| Status | Meaning | Next action |
|---|---|---|
401 | Missing, malformed or inactive API key. | Check server configuration without printing the key. |
403 | The key lacks integrations:read or integrations:write. | Grant the scope on the key, or use a key that has it. |
404 | The connection, object or job is not visible to this tenant. | Confirm the identifier belongs to this organization. |
409 | The connection is in a state that forbids the operation. | Read the connection status first and act on it. |
429 | Rate limited, either by MemorySync or by the upstream provider. | Back off; do not tighten a polling loop in response. |
5xx | Service failure. | Treat a write outcome as uncertain and reconcile by reading the connection back. |