Accounts, roles and keys

Your personal organization, roles, API keys and their scopes.

Everything you log lives in your own account, which Gutlog calls an organization: your diary, personal foods, symptoms, programs, API keys, the plan and its usage. You get a personal one, with you as its only member and owner, when you first sign in. Sharing a diary with a dietitian through an organization comes later; the roles below are the model it will use.

Roles

Roles go viewer < member < admin < owner:

Canviewermemberadminowner
Read the diary, foods, symptoms and insights✓✓✓✓
Log and edit meals and symptoms, create their own API keys✓✓✓
Invite and remove members, change roles below admin, manage every team✓✓
Every API key, organization settings, billing, the audit log✓✓
Make or remove admins and owners, transfer ownership, delete the organization✓

An organization always keeps at least one owner. Nobody can give a role above their own, and admins only change roles below admin. A call above your role answers 403 forbidden with required_role. Each op's minimum role is in the API reference.

Inviting people

Owners and admins invite from Settings → Members with an email address and a role. The invitation link works once and expires after 7 days; the invitee joins by signing in with the invited address. Inviting, removing members and changing roles are done by a person in the dashboard, never by an API key; agents can read the list with list_members.

API keys and scopes

  • An API key belongs to the organization and acts with the role of the person who created it (an owner's key acts as admin). It keeps working if that person leaves; admins see and revoke every key, members their own. The full key is shown once.
  • Narrow a key with scopes. Without scopes it may call everything its role allows. With scopes, each op needs one of:
    • <group>:read for the read ops of a group, such as meals:read or foods:read;
    • <group>:write for its writes (and its reads), <group>:* for both;
    • *:read for every read op;
    • billing:purchase to change the plan on the saved card. Nothing else implies it: a key that may buy must say so.
  • A scoped key cannot create a key with wider scopes than its own. list_api_keys returns every scope a key can have.
  • npx @meterapp/gutlog login and OAuth connectors ask which organization to use when you belong to several. With a session or OAuth token, x-gutlog-org: <slug> picks one per request.

Audit log

Membership, role, team, invitation, API key, billing, settings and sharing changes are recorded with who made them (a person, an API key or an OAuth client). Owners and admins read it in Settings → Audit or with list_audit_log. Day-to-day actions (logging, edits) are in the activity log (list_activity).