DocsOpen Moon AI
Browse the docs

Organization and settings

Read the overview and the “To do” list, then update the organization’s identity and settings, how long chats are kept and the member directory.

On this page

All routes live under https://chat.realmoon.ai/api/v1/orgs/{org_id}. Scopes: org:read to read, org:write to write, except for the directory (see below).

OverviewLink to the Overview section

GET /overview · org:read

JSON
{
  "org": { "id": "8c1f2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b", "name": "Lycée Victor-Hugo", "slug": "lycee-victor-hugo", "description": null, "logo_url": null, "org_kind": "education", "managed": true, "created_at": 1751328000 },
  "members": { "active": 380, "suspended": 4 },
  "invitations_pending": 25,
  "groups": 42,
  "usage_scope": "workspace",
  "activity": {
    "active_30d": 295, "requests_30d": 18422, "active_7d": 241, "requests_7d": 5100,
    "month_pct_avg": 37.4,
    "top": [{ "user_id": "41ab2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "name": "Léa Dupont", "month_pct": 98.2 }]
  },
  "alerts": []
}
FieldDescription
members, invitations_pending, groupsCounters; null when the key lacks the scope that reads them (members:*, groups:*).
usage_scopeworkspace: members’ usage is counted by the organization. personal: each member uses their own allowance, and activity is null.
activityActive members and number of requests over 30 and 7 days, the average share of the monthly limit used (as a percentage), and the 5 members closest to their limit. Requires usage:read.
alertsThe “To do” list, as returned by GET /alerts.

“To do” listLink to the “To do” list section

GET /alerts · org:read

Returns {"items": [...], "total": n}. Each item has code, severity (danger, warning or info), title, detail, href (a page of the admin console), count and params. An alert is only returned if the key holds one of the permissions it relates to.

codeMeaningparams
invitations_pendingPending invitations.count
domain_unverifiedDomains not verified yet.count
sso_not_configuredManaged organization without single sign-on.verified_domains
contract_endingThe contract ends within 60 days, with no renewal.date, days
invoice_overdueOverdue invoices.count
license_pool_fullA license pool is full.pool_id, plan_name, seats, used
license_pool_nearly_fullA pool is 95% full or more.the same, plus free
license_members_unlicensedSome active members have no license.count
license_fallback_usedSome members are in the fallback pool.count
members_without_groupMembers of a managed organization who belong to no group.count
retention_will_deleteChats that the retention period is about to delete.count, days
org_models_base_unavailableOrganization models whose base model is no longer offered.count
org_models_not_sharedOrganization models shared with no one.count

For automated processing, rely on code and params: title and detail are written for the console.

Identity and settingsLink to the Identity and settings section

ReadLink to the Read section

GET /general · org:read

JSON
{
  "id": "8c1f2a4e-5b6d-4e7f-9a0b-1c2d3e4f5a6b",
  "name": "Lycée Victor-Hugo",
  "slug": "lycee-victor-hugo",
  "description": "Établissement public",
  "logo_url": null,
  "created_at": 1751328000,
  "owner": { "id": "a11f3c5e-7b9d-4f1a-8c2e-4d6f8a0b2c4e", "name": "Claire Moreau", "email": "claire.moreau@ecole.fr" },
  "is_personal": false,
  "org_kind": "education",
  "org_kinds": ["team", "education", "company", "public_sector", "other"],
  "managed": true,
  "outside_access": true,
  "retention_days": 365,
  "retention_applied": true,
  "policy_version": 88,
  "members_active": 380,
  "retained_accounts": 0,
  "has_active_contract": true,
  "memory_policy": "allowed",
  "can": { "memory": false, "edit": true, "policies": true, "transfer": false, "delete": false, "platform": false }
}
FieldDescription
managedThe managed organization features are on: rules apply.
outside_accesstrue: members can also use Moon AI outside the organization.
retention_daysHow long chats are kept, from 30 to 3,650 days; null: nothing is deleted.
retained_accountsMembers held in the organization (a managed organization with outside access closed).
has_active_contractThe organization has an active contract; null if it could not be read.
canWhat the key can change here. transfer and delete are always false with a key.

UpdateLink to the Update section

PATCH /general · org:write

FieldTypeRequiredDescription
namestringno1 to 128 characters.
slugstringno2 to 50 characters: lowercase letters, digits and hyphens, with no hyphen at the start or end.
descriptionstringno2,048 characters at most; empty or null clears it.
logo_urlstringnoAn http or https address; empty or null clears it.
org_kindstringnoteam, education, company, public_sector or other. It changes the names of the built-in roles.
managedbooleannoTurns on the managed organization features (an active contract is required).
outside_accessbooleannofalse closes access outside the organization (an active contract is required).
retention_daysintegerno30 to 3,650; null removes the retention period.

Only the fields you send are processed. managed, outside_access and retention_days also require the rules:read or rules:write scope. The response has the same shape as the read.

cURL
curl -X PATCH https://chat.realmoon.ai/api/v1/orgs/$ORG_ID/general \
  -H "Authorization: Bearer $MOONAI_ADMIN_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Lycée Victor-Hugo", "retention_days": 365}'
Python
import os
import requests

r = requests.patch(
    f"https://chat.realmoon.ai/api/v1/orgs/{os.environ['ORG_ID']}/general",
    headers={"Authorization": f"Bearer {os.environ['MOONAI_ADMIN_KEY']}"},
    json={"name": "Lycée Victor-Hugo", "retention_days": 365},
    timeout=30,
)
r.raise_for_status()
print(r.json()["retention_days"])
JavaScript
const r = await fetch(`https://chat.realmoon.ai/api/v1/orgs/${process.env.ORG_ID}/general`, {
  method: 'PATCH',
  headers: { Authorization: `Bearer ${process.env.MOONAI_ADMIN_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Lycée Victor-Hugo', retention_days: 365 }),
});
if (!r.ok) throw new Error(await r.text());
console.log((await r.json()).retention_days);
StatuscodeCause
400invalid_requestNothing to change, an invalid field (fields), null for org_kind, managed or outside_access, or rules that would become invalid after the change (errors).
403managed_needs_contractTurning on managed or closing outside_access without an active contract.
409slug_takenThe slug is already used by another organization.

In a managed organization with a retention period, chats inactive for longer than that period are deleted every night.

Retention previewLink to the Retention preview section

GET /general/retention-preview?days=365 · org:read

Returns {"days": 365, "count": 1204, "applied": true}: the number of chats in the workspace that have not been changed for days days. days is required, from 30 to 3,650.

Settings onlyLink to the Settings only section

GET /settings (org:read) and PATCH /settings (org:write) read and update org_kind, managed, outside_access and retention_days, with the same rules as /general, without the organization’s identity.

Member directoryLink to the Member directory section

The directory controls what a member can see of the other members.

GET /directory · members:read

JSON
{ "value": null, "default": "groups", "effective": "groups", "options": ["all", "groups", "admins"] }
ValueWhat a member sees
allEvery member.
groupsThe people in their groups and in the groups they manage, plus the admins.
adminsThe admins only.

value is null when the organization follows the default: groups for a managed or education organization, all otherwise.

PUT /directory · org:write

FieldTypeRequiredDescription
valuestringnoall, groups or admins; null or missing goes back to the default.

See alsoLink to the See also section

Moon AI

Moon AI in action

0:00

Explore

Screenshots of chat.realmoon.ai taken on October 29, 2026, with fictional data.

Moon AI

Your preferences

Visits counted without cookies.

Our server counts visits without cookies or trackers. Your theme and your answer about ad measurement are remembered on this device.

Ad measurement

With your consent, our ad networks’ trackers (Google) measure our ads, from the visit to the sign-up and then to the first subscription and its amount, and may show you our ads. Your answer is valid for 13 months; you can change it here at any time.

No answer saved on this device.

After you decline, no tag is loaded anymore and the site deletes the cookies they had set on realmoon.ai. Those on the ad networks’ own domains are managed with them or in your browser.

The Moon AI app has its own privacy settings.