Documentation Index
Fetch the complete documentation index at: https://docs.nevermined.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Every Nevermined account can belong to one or more organizations — first-class workspaces with their own members, agents, plans, and billing. The Payments SDK exposes three building blocks for working with them from your code:- List your memberships — every organization you’re an active member of, with your role in each.
- Publish into a specific workspace — when you register an agent, plan, or API key, tell the SDK which workspace should own it.
- Read the activity feed — paginated events for everything happening in an organization (member changes, customers, subscriptions, webhook deliveries).
payments.organizations and a single optional organizationId argument on the publish methods you already use.
Workspace selection is transported by the
X-Current-Org-Id header. The backend resolves it in priority order: route path parameter → this header → the API key’s organization tag → your most-recent active membership → personal account. Pinning a workspace via the SDK is the same control your webapp’s workspace switcher uses.List the organizations you belong to
Use this to drive a workspace picker in your own tools, or to confirm where a publish will land before sending it.- TypeScript
- Python
Publish into a specific organization
Two ways to choose where a published agent, plan, or API key lands. Pick whichever fits the calling code.Per-call override (recommended for one-off publishes)
PassorganizationId (TypeScript) or organization_id= (Python) to the publish method. The SDK sends X-Current-Org-Id for that call only — your instance-level workspace is untouched.
- TypeScript
- Python
organizationId / organization_id option works on registerAgentAndPlan / register_agent_and_plan and on the plan-registration helpers (registerPlan, registerCreditsPlan, registerTimePlan and their register_*_plan Python equivalents).
Pin a workspace for the whole session
Set the organization once and every subsequent call from thisPayments instance — including all sub-APIs (agents, plans, requests, …) — uses it.
- TypeScript
- Python
- TypeScript
- Python
Read the organization activity feed
Paginated events for member changes, customer additions, subscription transitions, and webhook deliveries. Only members of the organization can read it; the backend enforces a Premium+ entitlement.- TypeScript
- Python
eventType filter accepts a single value or a list of values (sent as a comma-separated list); limit is the page size (backend cap: 200). The known event types you can filter on:
| Event type | Emitted when |
|---|---|
member.invited / member.joined | An admin invites a teammate; the invitee accepts |
member.role_changed | A member’s role flips between Admin and Member |
member.deactivated / member.reactivated / member.removed | Membership lifecycle transitions |
invitation.revoked / invitation.expired | Pending invitation lifecycle |
agent.created / plan.created / plan.purchased | Resource lifecycle inside the org |
customer.added / customer.blocked / customer.unblocked | External customer lifecycle |
subscription.upgraded / subscription.downgraded / subscription.canceled / subscription.lapsed | Tier subscription transitions on the org |
webhook.delivered / webhook.failed | Webhook delivery outcomes (status in metadata) |
eventType field is a plain string in both SDKs. Each event also carries a subject: { kind, id, …extras } payload describing the resource it’s about (e.g. invitations include role + email, members include role + userId, subscriptions include tier).
How workspace context is resolved
When the backend handles an authenticated request, it picks the active organization in this order — the first match wins:Route path
If the URL itself includes
:orgId (for example /organizations/{orgId}/activity), that organization is used directly.X-Current-Org-Id header
Set by the SDK from your pin or per-call override. The backend validates that you’re an active member of the requested org before honoring it.
API key tag
If your NVM API key was minted scoped to a specific organization, that scope is applied.
Fallback membership
Your most-recent active membership — preserves backwards compatibility for single-org callers that don’t set anything explicitly.
Related
Organizations on Nevermined
Concepts, tiers, and the webapp surface for organization owners.
Quickstart — TypeScript
Set up the SDK and publish your first agent.
Quickstart — Python
Set up the Python SDK and publish your first agent.
Payment Models
Fixed, usage-based, and outcome-based pricing patterns.