Skip to content

Organizations and roles ​

33 operations. Paths are relative to https://api.frege.io.

List every audit action name this deployment can write ​

GET/v1/audit/actions

The fixed vocabulary behind the action filter on GET /projects/{id}/audit and GET /orgs/{orgID}/audit — every dotted action string an audit event's action field can hold. Deployment-wide, not scoped to any organization or project: the set is a property of this Frege install, not tenant data, so any signed-in user may read it. Order is not meaningful and may change between releases.

Authentication: bearer token.

Responses

StatusDescriptionBody
200OKdata

List assignable project roles ​

GET/v1/member-roles

Authentication: bearer token.

Responses

StatusDescriptionBody
200OKdata

List the organizations you can see ​

GET/v1/orgs

The same list GET /me carries, on its own and paged: every organization the caller can see, with is_admin on the one they own and is_selected on the one to open. An organization is visible because you administer it or hold a role on at least one of its projects. q filters case-insensitively by name before the page is cut, so total reflects the filtered set. is_selected is decided over the whole list, so the selected organization keeps its mark on whichever page it falls.

Authentication: bearer token.

Parameters

NameInTypeDescription
qquerystringCase-insensitive filter over the name
pagequeryintegerPage to return, 1-based (default 1)
page_sizequeryintegerRows per page (default 50, max 200)
sortquerystringOrder: name, created_at, each also accepted with a leading - for descending (default name)
limitqueryintegerRows per page (max 200); with offset, instead of page and page_size
offsetqueryintegerRows to skip (default 0)

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
422Unprocessable Entityerror envelope

Create an organization ​

POST/v1/orgs

Creates an organization with the caller as its single admin, together with a starter project — the same shape sign-up seeds, so a workspace is usable the moment it exists. Both are created in one transaction: a failure leaves neither, never an organization with nothing in it. A name is a LABEL and nothing more: two organizations may share one, because nothing is addressed by it. The response carries default_project so the caller can navigate straight in; reads of an existing organization omit it, since once projects can be added and archived "the default project" stops being meaningful.

Authentication: bearer token.

Request body (application/json)

Schema: api.createOrgRequest.

FieldTypeDescription
namestring

Responses

StatusDescriptionBody
201Createddata
409Conflicterror envelope
422Unprocessable Entityerror envelope

Get an organization ​

GET/v1/orgs/{orgID}

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Update an organization ​

PATCH/v1/orgs/{orgID}

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: api.updateOrgRequest.

FieldTypeDescription
namestring

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope

Delete an organization ​

DELETE/v1/orgs/{orgID}

Permanently removes the organization and everything under it: projects, specs, documents, chats, members and connected customers. Requires all three of — the caller is the organization admin, name matches the organization's name exactly, and code is the six-digit code emailed by POST /orgs/{orgID}/deletion/code. The audit trail survives.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: api.deleteOrgRequest.

FieldTypeDescription
codestring
namestring

Responses

StatusDescriptionBody
204No Content
403Forbiddenerror envelope
404Not Founderror envelope
422Name does not match, or the code is wrong, expired or exhaustederror envelope

List an organization's audit events ​

GET/v1/orgs/{orgID}/audit

Newest-first security-relevant events across every project in the organization, plus org-level events (admin transfer). Filter with kind, stage, actor_email, action and/or actions. Paginated by page/page_size like every other listing in this API. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
kindquerystringFilter by class: 'tool' (tool calls only) or 'admin' (management only); omit for all One of: tool, admin.
X-Frege-StageheaderstringAmbient environment, used when no stage query parameter is given One of: live, staging.
stagequerystringWhich environment: 'live', 'staging', or 'all' for both. Overrides the X-Frege-Stage header. One of: live, staging, all.
actor_emailquerystringCase-insensitive filter over the acting user's email
actionquerystringCase-insensitive SUBSTRING filter over the action name, e.g. 'redaction' or 'project.spec.upload'
actionsquerystring[]EXACT-match multi-select over the action name, from the fixed vocabulary at GET /v1/audit/actions. Repeat the parameter (actions=a&actions=b) or comma-separate one (actions=a,b); an unrecognised name 422s. Combined with action, not a replacement for it.
pagequeryintegerPage to return, 1-based (default 1)
page_sizequeryintegerRows per page (default 50, max 200)
sortquerystringOrder: created_at, also accepted with a leading - for descending (default -created_at)
limitqueryintegerDEPRECATED, use page_size. Max events per page (max 200)
offsetqueryintegerDEPRECATED, use page. Rows to skip (default 0)

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope

What deleting this organization would destroy ​

GET/v1/orgs/{orgID}/deletion

Counts the projects, published MCP addresses, members, connected customers, specs and documents that would be removed. Read this before asking anyone to confirm — published_projects is the number that matters, because those addresses are already sitting in other people's AI clients. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope

Email a confirmation code for deleting the organization ​

POST/v1/orgs/{orgID}/deletion/code

Sends a six-digit code to the organization admin's own address. This is the factor a stolen session cannot satisfy: typing the name proves intent, the code proves the person has the inbox. Rate limited to one code per minute, and a new code invalidates the previous one. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope
429A code was requested less than a minute agoerror envelope
503Mail is not configured, so the code cannot be deliverederror envelope

The limit policies of an organization ​

GET/v1/orgs/{orgID}/limits

What every stage of the organization is held to: Frege's caps (scope platform, editable false), then the organization's own. A subject is held to every policy that matches it, so the organization's rows can tighten Frege's caps and never loosen them. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Add a limit policy to an organization ​

POST/v1/orgs/{orgID}/limits

A token bucket of rate tokens every per_seconds (at most 3600), at most burst (0: rate), kept apart per the dimensions in key, on one surface, for the subjects match selects (when is a condition over the customer's fields, root customer). action record lets every call through and only tells what it would have refused (event settings.limit.refused): try a policy that way first. A refused agent turn answers 429 with Retry-After; a refused tool call answers the tool error rate_limited with retry_after_seconds. Organization admin only; at most 50 policies.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: settings.limitPolicyRequest.

FieldTypeDescription
actionstringOne of: refuse, record.
burstinteger
enabledboolean
keystring[]
matchsettings.limitMatch
per_secondsinteger
rateinteger
surfacestringOne of: agent.turn, tool.call, llm.tokens, message.out.

Responses

StatusDescriptionBody
201Createddata
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope

Change a limit policy of an organization ​

PUT/v1/orgs/{orgID}/limits/{policyID}

Replaces the policy with what is sent, as when it was added. Frege's caps and another organization's policies are not found. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
policyID (required)pathintegerPolicy ID

Request body (application/json)

Schema: settings.limitPolicyRequest.

FieldTypeDescription
actionstringOne of: refuse, record.
burstinteger
enabledboolean
keystring[]
matchsettings.limitMatch
per_secondsinteger
rateinteger
surfacestringOne of: agent.turn, tool.call, llm.tokens, message.out.

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
422Unprocessable Entityerror envelope

Remove a limit policy of an organization ​

DELETE/v1/orgs/{orgID}/limits/{policyID}

Organization admin only; Frege's caps and another organization's policies are not found.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
policyID (required)pathintegerPolicy ID

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope

The organization's models, role by role ​

GET/v1/orgs/{orgID}/models

The organization's admins only; anyone else is told 404. For each role (chat, judge, decision, transcription, embedding): chosen is the organization's own choice (null for none) and model_id what the role resolves to for it, with from saying whose choice that is: organization, or platform when it chose nothing and the deployment's role answers (ADR-0039). A project's own choice, and an agent's for chat, judge and decision, come before the organization's (GET /projects/{id}/models). model_id null: nothing plays the role, and its job is off.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Choose the organization's model for a role ​

PUT/v1/orgs/{orgID}/models

The organization's admins only; anyone else is told 404. role is chat, judge, decision, transcription or embedding; model_id a model that can play it (choosable in GET /models): a registry model of the kind the role needs, or a catalogue model that can play it, which joins the registry, not offered, the first time it is chosen (ADR-0060); or null to clear the choice, and the deployment's role answers again. Every process reads the choice at its next call; a new embedding model embeds the organization's documents again in a space of its own, except a project's that chose its own. Answers every role, as GET does.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: llm.modelChoiceRequest.

FieldTypeDescription
model_idstringModelID is a model's id (GET /models, choosable): a registry model, or a catalogue model, which joins the registry the first time it is chosen; null clears the choice.
rolestring

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
422Unprocessable Entityerror envelope

Organization overview ​

GET/v1/orgs/{orgID}/overview

Returns the organization and its resource counts. organization.is_admin is true when the caller owns the organization, as on GET /orgs. Clients and tools are split into live and staging, since a customer in one environment is not the same fact in the other; people, projects and docs stay combined.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

List the people in an organization ​

GET/v1/orgs/{orgID}/people

Everyone in the organization: the admin (is_admin=true, listed first, with no per-project roles because their access is organization-wide) plus everyone holding a role on at least one project, with their per-project roles. Deactivated users are excluded. The count matches the overview's people total.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
404Not Founderror envelope

List every project in the organization ​

GET/v1/orgs/{orgID}/projects

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

The organization's custom roles ​

GET/v1/orgs/{orgID}/roles

Its own roles for its people, beside the built-in ones (manager, developer, viewer, operator), which stay the defaults.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Add a custom role ​

POST/v1/orgs/{orgID}/roles

A name of its own (not a built-in role's); assign it (…/assignees) and bind it to the model's fine-grained permissions on the organization, a project or a stage (…/permissions). At most 100.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: access.roleRequest.

FieldTypeDescription
descriptionstring
namestring

Responses

StatusDescriptionBody
201Createddata
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope
503Service Unavailableerror envelope

A custom role, its assignees and its permissions ​

GET/v1/orgs/{orgID}/roles/{roleID}

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
503Service Unavailableerror envelope

Rename a custom role ​

PUT/v1/orgs/{orgID}/roles/{roleID}

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID

Request body (application/json)

Schema: access.roleRequest.

FieldTypeDescription
descriptionstring
namestring

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
409Conflicterror envelope
422Unprocessable Entityerror envelope

Delete a custom role ​

DELETE/v1/orgs/{orgID}/roles/{roleID}

With its assignments and bindings: its assignees stop holding what it gave them.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope
503Service Unavailableerror envelope

Assign a custom role ​

POST/v1/orgs/{orgID}/roles/{roleID}/assignees

To a person, or to the members of a group of people of one of the organization's projects; validity limits the assignment.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID

Request body (application/json)

Schema: access.assignmentRequest.

FieldTypeDescription
assigneeaccess.assignee
validityaccess.validity

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope
422Unprocessable Entityerror envelope
503Service Unavailableerror envelope

Take a custom role away ​

DELETE/v1/orgs/{orgID}/roles/{roleID}/assignees

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID
kind (required)querystringuser or group
assignee_id (required)queryintegerThe person's or the group's id
project_idquerystringA group's project

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope
422Unprocessable Entityerror envelope
503Service Unavailableerror envelope

Bind a custom role to a permission ​

POST/v1/orgs/{orgID}/roles/{roleID}/permissions

One of the model's fine-grained permissions (can_*) on the organization (can_read_audit, can_manage_roles), a project or a stage of it. Only one who holds the permission may give it. validity limits the binding.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID

Request body (application/json)

Schema: access.rolePermissionRequest.

FieldTypeDescription
kindstringOne of: organization, project, stage.
object_idstringObjectID is the project's or the stage's id; empty for the organization.
permissionstring
validityaccess.validity

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope
503Service Unavailableerror envelope

Unbind a custom role from a permission ​

DELETE/v1/orgs/{orgID}/roles/{roleID}/permissions

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID
roleID (required)pathintegerRole ID
kind (required)querystringorganization, project or stage
object_idquerystringThe project's or the stage's id
permission (required)querystringThe permission

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope
422Unprocessable Entityerror envelope
503Service Unavailableerror envelope

Frege support's access to this organization's content ​

GET/v1/orgs/{orgID}/support-access

Organization admins only. Frege's team always sees counts, statuses and money; to read the organization's content — its customers' identities and their conversations — it needs access granted here, for a while. active is the grant in force, if any; history is the last 20, with who granted each. Every look Frege support takes appears in the organization's audit.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Let Frege support read this organization's content ​

POST/v1/orgs/{orgID}/support-access

Organization admins only. Grants Frege's support, for hours (default 72, at most 720), access to the organization's customers' identities and conversations. A grant in force is replaced by this one. note says what support is to look at. The grant is recorded in the organization's audit.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: support.grantRequest.

FieldTypeDescription
hoursintegerHours the access lasts, 1 to 720; 72 when left out.
notestring

Responses

StatusDescriptionBody
201Createddata
404Not Founderror envelope
422Unprocessable Entityerror envelope

Take Frege support's access back ​

DELETE/v1/orgs/{orgID}/support-access

Organization admins only. Ends the grant in force now; 404 when there is none. Recorded in the organization's audit.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope

Transfer organization ownership ​

POST/v1/orgs/{orgID}/transfer

Hands the single admin role to another existing Frege user (by email). The former admin keeps any project roles they hold. Only the current admin can transfer.

Authentication: bearer token.

Parameters

NameInTypeDescription
orgID (required)pathstringOrganization ID

Request body (application/json)

Schema: api.transferOrgRequest.

FieldTypeDescription
emailstring

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope

List assignable project roles ​

GET/v1/roles

Authentication: bearer token.

Responses

StatusDescriptionBody
200OKdata