Appearance
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
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
List assignable project roles
GET/v1/member-roles
Authentication: bearer token.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
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
| Name | In | Type | Description |
|---|---|---|---|
q | query | string | Case-insensitive filter over the name |
page | query | integer | Page to return, 1-based (default 1) |
page_size | query | integer | Rows per page (default 50, max 200) |
sort | query | string | Order: name, created_at, each also accepted with a leading - for descending (default name) |
limit | query | integer | Rows per page (max 200); with offset, instead of page and page_size |
offset | query | integer | Rows to skip (default 0) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 401 | Unauthorized | error envelope |
| 422 | Unprocessable Entity | error 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.
| Field | Type | Description |
|---|---|---|
name | string |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error envelope |
Get an organization
GET/v1/orgs/{orgID}
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Update an organization
PATCH/v1/orgs/{orgID}
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: api.updateOrgRequest.
| Field | Type | Description |
|---|---|---|
name | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: api.deleteOrgRequest.
| Field | Type | Description |
|---|---|---|
code | string | |
name | string |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Name does not match, or the code is wrong, expired or exhausted | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
kind | query | string | Filter by class: 'tool' (tool calls only) or 'admin' (management only); omit for all One of: tool, admin. |
X-Frege-Stage | header | string | Ambient environment, used when no stage query parameter is given One of: live, staging. |
stage | query | string | Which environment: 'live', 'staging', or 'all' for both. Overrides the X-Frege-Stage header. One of: live, staging, all. |
actor_email | query | string | Case-insensitive filter over the acting user's email |
action | query | string | Case-insensitive SUBSTRING filter over the action name, e.g. 'redaction' or 'project.spec.upload' |
actions | query | string[] | 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. |
page | query | integer | Page to return, 1-based (default 1) |
page_size | query | integer | Rows per page (default 50, max 200) |
sort | query | string | Order: created_at, also accepted with a leading - for descending (default -created_at) |
limit | query | integer | DEPRECATED, use page_size. Max events per page (max 200) |
offset | query | integer | DEPRECATED, use page. Rows to skip (default 0) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 429 | A code was requested less than a minute ago | error envelope |
| 503 | Mail is not configured, so the code cannot be delivered | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: settings.limitPolicyRequest.
| Field | Type | Description |
|---|---|---|
action | string | One of: refuse, record. |
burst | integer | |
enabled | boolean | |
key | string[] | |
match | settings.limitMatch | |
per_seconds | integer | |
rate | integer | |
surface | string | One of: agent.turn, tool.call, llm.tokens, message.out. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
policyID (required) | path | integer | Policy ID |
Request body (application/json)
Schema: settings.limitPolicyRequest.
| Field | Type | Description |
|---|---|---|
action | string | One of: refuse, record. |
burst | integer | |
enabled | boolean | |
key | string[] | |
match | settings.limitMatch | |
per_seconds | integer | |
rate | integer | |
surface | string | One of: agent.turn, tool.call, llm.tokens, message.out. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
policyID (required) | path | integer | Policy ID |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: llm.modelChoiceRequest.
| Field | Type | Description |
|---|---|---|
model_id | string | ModelID 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. |
role | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 401 | Unauthorized | error envelope |
| 404 | Not Found | error envelope |
List every project in the organization
GET/v1/orgs/{orgID}/projects
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: access.roleRequest.
| Field | Type | Description |
|---|---|---|
description | string | |
name | string |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
A custom role, its assignees and its permissions
GET/v1/orgs/{orgID}/roles/{roleID}
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 503 | Service Unavailable | error envelope |
Rename a custom role
PUT/v1/orgs/{orgID}/roles/{roleID}
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
Request body (application/json)
Schema: access.roleRequest.
| Field | Type | Description |
|---|---|---|
description | string | |
name | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error envelope |
| 503 | Service Unavailable | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
Request body (application/json)
Schema: access.assignmentRequest.
| Field | Type | Description |
|---|---|---|
assignee | access.assignee | |
validity | access.validity |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
Take a custom role away
DELETE/v1/orgs/{orgID}/roles/{roleID}/assignees
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
kind (required) | query | string | user or group |
assignee_id (required) | query | integer | The person's or the group's id |
project_id | query | string | A group's project |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
Request body (application/json)
Schema: access.rolePermissionRequest.
| Field | Type | Description |
|---|---|---|
kind | string | One of: organization, project, stage. |
object_id | string | ObjectID is the project's or the stage's id; empty for the organization. |
permission | string | |
validity | access.validity |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error envelope |
Unbind a custom role from a permission
DELETE/v1/orgs/{orgID}/roles/{roleID}/permissions
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
roleID (required) | path | integer | Role ID |
kind (required) | query | string | organization, project or stage |
object_id | query | string | The project's or the stage's id |
permission (required) | query | string | The permission |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 503 | Service Unavailable | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: support.grantRequest.
| Field | Type | Description |
|---|---|---|
hours | integer | Hours the access lasts, 1 to 720; 72 when left out. |
note | string |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error 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
| Name | In | Type | Description |
|---|---|---|---|
orgID (required) | path | string | Organization ID |
Request body (application/json)
Schema: api.transferOrgRequest.
| Field | Type | Description |
|---|---|---|
email | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 401 | Unauthorized | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
List assignable project roles
GET/v1/roles
Authentication: bearer token.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |