new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Better Auth · Plugins · all subjects

api-key/organization

4 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Organization-owned API keys configuration

Set references: "organization" in your API key configuration to make keys owned by organizations instead of users. This is useful for team-based applications where API keys are shared across organization members. Organization-owned keys cannot mock user sessions when enableSessionForAPIKeys is enabled.

Creating organization-owned API keys

When creating an organization-owned API key with auth.api.createApiKey(), pass the organizationId in the body. The user context comes from session headers; for a pure server call without headers, pass a userId in the body instead. The user must be a member of the organization with permission to create API keys.

API key permissions for organization-owned keys

Organization-owned API keys use the organization plugin's role-based access control system. Four permissions control API key management: apiKey:["create"] to create new keys, apiKey:["read"] to view and list keys, apiKey:["update"] to modify keys, and apiKey:["delete"] to delete keys. Organization owners have full access by default; other roles must be explicitly configured.

Error codes for organization API key access control

When access is denied for organization API key operations, two error codes can be returned: USER_NOT_MEMBER_OF_ORGANIZATION when the user is not a member of the organization, and INSUFFICIENT_API_KEY_PERMISSIONS when the user doesn't have the required apiKey permission for the action.

Give your agent this brain