API Reference

Exceptions

Every error class the SDK can raise.

All SDK errors are importable from memsy.exceptions. The SDK also re-exports them from the top-level memsy package.

from memsy.exceptions import (
    MemsyError,
    MemsyConnectionError,
    MemsyAPIError,
    AuthenticationError,
    AuthorizationError,
    FeatureNotAvailable,
    OrgIdNotAllowedError,
    SeatRequiredError,
    OrgLimitReachedError,
    KeyLimitReachedError,
    BillingNotEnabledError,
    SeatLimitReachedError,
    RateLimitExceeded,
    UsageLimitExceeded,
)

Hierarchy

MemsyError
├── MemsyConnectionError        # network error / timeout
└── MemsyAPIError               # non-2xx HTTP response
    ├── AuthenticationError     # 401 — invalid or missing API key
    ├── AuthorizationError      # 403 — key lacks required scope
    ├── FeatureNotAvailable     # 403 — feature not on your tier
    ├── OrgIdNotAllowedError    # 400 — free-tier: org_id not allowed in body
    ├── SeatRequiredError       # 403 — endpoint requires an assigned seat
    ├── OrgLimitReachedError    # 403 — tier limit on orgs reached
    ├── KeyLimitReachedError    # 403 — tier limit on API keys reached
    ├── BillingNotEnabledError  # 403 — billing not enabled for this org
    ├── SeatLimitReachedError   # 409 — purchased seat limit reached
    ├── RateLimitExceeded       # 429 — rate limit hit (after retries)
    └── UsageLimitExceeded      # 429 — plan quota exceeded

MemsyError

Base class. Catch this to handle any SDK error.

MemsyConnectionError

Raised when the SDK cannot reach the Memsy endpoint: connection refused, DNS failure, timeout. No additional attributes.

MemsyAPIError

Raised on any non-2xx response not captured by a specific subclass.

AttributeTypeDescription
status_codeintHTTP status.
detailstrServer-provided detail message.
error_codestr | NoneStable machine-readable error code.
responsehttpx.ResponseRaw response.

AuthenticationError (401)

Invalid or missing API key. Same attributes as MemsyAPIError.

AuthorizationError (403)

API key is valid but lacks the required scope.

Extra attributeTypeDescription
required_scopestr | NoneScope that was missing.

FeatureNotAvailable (403)

The endpoint is gated behind a higher plan tier.

Extra attributeTypeDescription
featurestr | NoneFeature identifier.
current_tierstr | NonePlan tier the key is on.
upgrade_urlstr | NoneDeep link to the upgrade flow.

OrgIdNotAllowedError (400)

Raised when a free-tier client sends an org_id field in the request body. Organization is derived from the API key on free-tier plans; passing one explicitly is rejected.

No extra attributes beyond MemsyAPIError.

SeatRequiredError (403)

The console or control-plane endpoint requires the caller to have an assigned seat. Check your org's seat assignments in the dashboard.

No extra attributes beyond MemsyAPIError.

OrgLimitReachedError (403)

Your tier's limit on org customization records has been reached. Raised by client.orgs.create() when the tier cap is exceeded.

Extra attributeTypeDescription
limitint | NoneOrg limit for your tier.
currentint | NoneCurrent org count.

KeyLimitReachedError (403)

Your tier's limit on API keys has been reached.

Extra attributeTypeDescription
limitint | NoneKey limit for your tier.
currentint | NoneCurrent active key count.

BillingNotEnabledError (403)

A billing endpoint was called but billing has not been enabled for this org. The response includes a path to express interest in the Pro plan.

Extra attributeTypeDescription
interest_pathstr | NoneAPI path to express interest (/interest/express).

SeatLimitReachedError (409)

A seat-management operation would exceed the number of purchased seats.

Extra attributeTypeDescription
purchased_seatsint | NoneTotal purchased seats.
assigned_seatsint | NoneCurrently assigned seats.
pending_invitesint | NonePending invite count.

RateLimitExceeded (429)

The SDK exhausted its automatic retries.

Extra attributeTypeDescription
retry_afterfloat | NoneSeconds to wait, parsed from Retry-After.

UsageLimitExceeded (429)

A plan-level quota was exceeded.

Extra attributeTypeDescription
dimensionstr | NoneWhich quota was exhausted (e.g. "events_ingested").
currentint | NoneCurrent usage.
limitint | NoneLimit that was exceeded.
upgrade_urlstr | NoneDeep link.

See also