Organizations

Share a wallet, spend policies, and private packages across your team with mog organizations.

Organizations let teams share a wallet, spend policies, and private packages under a single account. Members purchase on behalf of the org wallet, and admins control spending with org-level policies.

Create an organization

Via CLI

mog org create acme-team "Acme Team"
ArgumentDescription
<slug>Org identifier — lowercase letters, numbers, hyphens, 2–39 chars
<name>Display name

The creator becomes the org owner.

Via API

POST https://api.mog.md/v1/orgs
Authorization: Bearer <token>
Content-Type: application/json
 
{ "slug": "acme-team", "name": "Acme Team" }

Switch org context

Once an org is active, mog buy and mog install --auto-buy use the org wallet instead of your personal wallet.

# Activate an org
mog org switch acme-team
 
# Check current context
mog org whoami
 
# Clear org context (revert to personal wallet)
mog org switch none

Invite members

Requires admin or owner role.

mog org invite alice@acme.io --role member
mog org invite bob@acme.io --role admin

Invitations are sent by email and expire after 7 days.

Via API

POST https://api.mog.md/v1/orgs/acme-team/members
Authorization: Bearer <token>
Content-Type: application/json
 
{ "email": "alice@acme.io", "role": "member" }

Accept an invitation

When a user receives an invitation email, they click the link to accept. Programmatically:

POST https://api.mog.md/v1/orgs/accept-invite
Authorization: Bearer <token>
Content-Type: application/json
 
{ "token": "invite-token-from-email" }

Roles

RolePermissions
ownerFull control — manage members, policies, billing, packages, delete the org
adminManage members (invite, remove, change roles), manage policies, manage packages
memberPurchase using the org wallet, view org packages and policies

Change a member's role

Requires admin or owner role.

PATCH https://api.mog.md/v1/orgs/acme-team/members/:userId
Authorization: Bearer <token>
Content-Type: application/json
 
{ "role": "admin" }

Remove a member

DELETE https://api.mog.md/v1/orgs/acme-team/members/:userId
Authorization: Bearer <token>

Org wallet

Each organization has its own wallet, separate from personal wallets. When the org context is active, all purchases are deducted from the org wallet.

# View org wallet balance
mog org wallet

Top up the org wallet

Top up via the Dashboard → Organizations or the API:

POST https://api.mog.md/v1/orgs/acme-team/wallet/top-up
Authorization: Bearer <token>
Content-Type: application/json
 
{ "amountCents": 10000 }

Auto top-up

Configure the org wallet to automatically refill when the balance drops below a threshold:

PATCH https://api.mog.md/v1/orgs/acme-team/wallet/auto-top-up
Authorization: Bearer <token>
Content-Type: application/json
 
{
  "enabled": true,
  "thresholdCents": 2000,
  "topUpAmountCents": 10000
}

Transaction history

GET https://api.mog.md/v1/orgs/acme-team/wallet/transactions
Authorization: Bearer <token>

Org spend policies

Org-level spend policies override the individual token holder's personal policy when purchasing on behalf of the org. This lets admins define a single corporate policy without requiring each member to configure their own.

Create an org policy

Requires admin or owner role.

POST https://api.mog.md/v1/orgs/acme-team/policies
Authorization: Bearer <token>
Content-Type: application/json
 
{
  "name": "Engineering team",
  "maxPerPurchaseCents": 1000,
  "dailyLimitCents": 5000,
  "monthlyLimitCents": 20000,
  "requireApprovalAboveCents": 500,
  "vendorAllowlist": ["trusted-org", "verified-vendor"],
  "blockedTypes": [],
  "active": true
}

See Spend policies for full field reference and the approval workflow.

Private packages

Organizations can publish packages with restricted visibility:

VisibilityWho can access
publicAnyone
org_onlyOnly org members
privateOnly the publisher

Change visibility for an org package:

PATCH https://api.mog.md/v1/orgs/acme-team/packages/:listingId
Authorization: Bearer <token>
Content-Type: application/json
 
{ "visibility": "org_only" }

This is useful for internal skills and proprietary MCP servers that should only be available to your team.

Common workflows

Onboard a new team member

  1. Invite them: mog org invite new@member.io --role member
  2. They accept the invitation from their email
  3. They switch to the org: mog org switch acme-team
  4. They install packages — purchases use the org wallet automatically

Set up an agent with org access

  1. Generate an API token from the dashboard with purchase + download scopes
  2. Attach the org's spend policy to the token
  3. Set MOG_TOKEN in the agent's environment
  4. The agent's purchases are billed to the org wallet and governed by the org policy

Audit spending

View the org's transaction history to see who purchased what:

GET https://api.mog.md/v1/orgs/acme-team/wallet/transactions

Each transaction records the user, package, amount, and timestamp.