Skip to content

Projects ​

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

List the caller's projects in one organization ​

GET/v1/projects

Returns the projects the caller can reach WITHIN the given organization — those in an organization they admin, plus those they are a member of — each annotated with their effective role. Archived projects are excluded unless archived=true. org_id is required: this endpoint used to answer across every organization at once and leave the client to discard the rest, which is a filter a client can forget. An organization the caller cannot reach returns an empty list rather than 404, so the response never reveals which organization ids exist. q filters case-insensitively over name and description before the page is cut, so total reflects the filtered set.

Authentication: bearer token.

Parameters

NameInTypeDescription
org_id (required)querystringOrganization to list within (required)
archivedquerybooleanInclude archived projects (default false)
qquerystringCase-insensitive filter over name and description
pagequeryintegerPage to return, 1-based (default 1)
page_sizequeryintegerRows per page (default 50, max 200)
sortquerystringOrder: created_at, name, id, each also accepted with a leading - for descending
limitqueryintegerDEPRECATED, use page_size. Max projects per page (max 200)
offsetqueryintegerDEPRECATED, use page. Rows to skip (default 0)

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
422org_id missing or not a valid iderror envelope

Create a project ​

POST/v1/projects

Creates a project in an organization the caller admins. org_id is only required when the caller admins more than one organization. The upstream base URL is not set here — a fresh project has none until it is configured afterward, per stage, via PATCH /projects/{id} or the upstream endpoints.

Authentication: bearer token.

Request body (application/json)

Schema: api.createProjectRequest.

FieldTypeDescription
descriptionstring
namestring
org_idstring

Responses

StatusDescriptionBody
201Createddata
409Conflicterror envelope
422Unprocessable Entityerror envelope

Get a project ​

GET/v1/projects/{id}

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Update a project ​

PATCH/v1/projects/{id}

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.updateProjectRequest.

FieldTypeDescription
default_localestring
descriptionstring
namestring
upstream_base_urlstring

Responses

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

Delete a project ​

DELETE/v1/projects/{id}

Permanently deletes the project and everything belonging to it (spec, docs, chats, clients, memberships). Refused (409) once the project has been published — its MCP address may already be in customers' AI clients; archive it instead. Only the organization admin can delete.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
204No Content
404Not Founderror envelope
409Already published — archive it insteaderror envelope

A channel's report ​

GET/v1/projects/{id}/analytics/channels

The environment's handoffs — created, accepted, resolved, returned, the rates and the time to accept, by reason and by agent — and the widget's traffic, over [from, to) in Asia/Tashkent days, with the previous window of equal length and a series by day or week (weeks from Monday). door narrows to one channel. Rates are fractions 0 to 1, and null means unavailable, not zero; totals come from totals, never from summing series. At most 366 days.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
from (required)querystringFirst day, YYYY-MM-DD
to (required)querystringDay after the last, YYYY-MM-DD
bucket (required)querystringSeries step One of: day, week.
doorquerystringOnly this channel One of: embed, portal, telegram, voice.

Responses

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

The operations' report ​

GET/v1/projects/{id}/analytics/operations

One page of the environment's goal operations over [from, to) in Asia/Tashkent days. The call counts are the tool gateway's and not handed to the CRM yet: they are null, unavailable. door and sort are checked and kept for when they are; page from 1, page_size at most 100 (20 by default).

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
from (required)querystringFirst day, YYYY-MM-DD
to (required)querystringDay after the last, YYYY-MM-DD
doorquerystringOnly this channel One of: embed, portal, telegram, voice.
sortquerystringOrder One of: calls, clients, failures, success_rate.
pagequeryintegerPage, from 1
page_sizequeryintegerPage size, at most 100

Responses

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

The widget's funnel ​

GET/v1/projects/{id}/analytics/widget-funnel

The widget's impressions, opens and first messages over [from, to) in Asia/Tashkent days, in all and by embedding site; origin narrows to one site. identified and goals are the other modules' counts and null, unavailable, as is coverage. At most 366 days.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
from (required)querystringFirst day, YYYY-MM-DD
to (required)querystringDay after the last, YYYY-MM-DD
originquerystringOnly this embedding site

Responses

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

List a project's API keys ​

GET/v1/projects/{id}/api-keys

Returns the project's API keys, newest first, without their secrets. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
403Forbiddenerror envelope
404Not Founderror envelope

Mint an API key for a project ​

POST/v1/projects/{id}/api-keys

Creates a key that lets an organization's own code call this project's tools with no human sign-in — list operations and invoke tools, bounded by the project's write policy, and nothing else. A widget key (kind widget) is the one to put in a web page: it only starts the chat widget for a person that page signed in, and every other route refuses it. The secret is returned once in this response and never again; store it now. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.createAPIKeyRequest.

FieldTypeDescription
expires_atstring
kindstring
namestring

Responses

StatusDescriptionBody
201Createddata
401Unauthorizederror envelope
403Forbiddenerror envelope
404Not Founderror envelope
422Unprocessable Entityerror envelope

Revoke an API key ​

DELETE/v1/projects/{id}/api-keys/{keyID}

Stops a key working, immediately and permanently. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
keyID (required)pathintegerAPI key ID

Responses

StatusDescriptionBody
204No Content
401Unauthorizederror envelope
403Forbiddenerror envelope
404Not Founderror envelope

Archive a project ​

POST/v1/projects/{id}/archive

Archives the project without deleting any of its data: its MCP server stops serving on every endpoint and it drops out of the default project listing. Reversible via unarchive. Only the organization admin can archive.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
403Forbiddenerror envelope
404Not Founderror envelope
409Conflicterror envelope

List a project's audit events ​

GET/v1/projects/{id}/audit

Newest-first security-relevant events for the project: management actions (token regeneration, redaction changes, membership changes, spec uploads, upstream configuration, archive/delete) and, when kind is unset or "tool", per-tool-call events (project.tool.call — who executed which operation, its outcome, its upstream status, and for a failure a classified reason drawn from a fixed vocabulary: dns_failure, egress_refused, timeout, no_credential and so on, never the upstream's own words). Filter with kind=admin (management only) or kind=tool (tool calls only), actor_email, action and/or actions. WHICH ENVIRONMENT: ?stage=live, ?stage=staging or ?stage=all; with no stage query the X-Frege-Stage header is used, and with neither you get both. The query parameter deliberately WINS over the header here, because the header is the client's ambient environment while the query is an explicit choice about this list. Paginated by page/page_size like every other listing in this API, newest first by default. Organization admin or a manager of production reads every event; a manager of staging only, without production access, may read staging's events alone — stage must then resolve to staging, so asking for live or for all is refused.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject 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 (org admin / production manager only). 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

List a project's outstanding invitations ​

GET/v1/projects/{id}/invitations

Only live invitations — accepted ones are members and appear under /members instead, and revoked or expired ones are not offers. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
pagequeryintegerPage to return, 1-based (default 1)
page_sizequeryintegerRows per page (default 50, max 200)
sortquerystringOrder: created_at, email, role, id, each also accepted with a leading - for descending
limitqueryintegerDEPRECATED, use page_size. Max invitations per page (max 200)
offsetqueryintegerDEPRECATED, use page. Rows to skip (default 0)

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope

Invite someone to a project ​

POST/v1/projects/{id}/invitations

Sends an invitation email with an accept link. NOTHING is granted until the recipient accepts — no membership row, and no user account for an address that has not registered. Re-inviting an address that already has an invitation outstanding replaces it: the role and expiry are refreshed and the previous link stops working. Refused (409) for an address that is already the organization admin or already a member of this environment. Organization admin or project manager only; only the org admin may invite a manager.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.createInvitationRequest.

FieldTypeDescription
emailstring
rolestringOne of: manager, developer, viewer.

Responses

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

Withdraw an outstanding invitation ​

DELETE/v1/projects/{id}/invitations/{invitationID}

The link stops working immediately. An invitation that was already accepted cannot be revoked — remove the member instead — and that returns 409 rather than pretending the access was undone. Organization admin or project manager only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
invitationID (required)pathintegerInvitation ID

Responses

StatusDescriptionBody
204No Content
403Forbiddenerror envelope
404Not Founderror envelope
409Conflicterror envelope

List a project's members ​

GET/v1/projects/{id}/members

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
pagequeryintegerPage to return, 1-based (default 1)
page_sizequeryintegerRows per page (default 50, max 200)
sortquerystringOrder: created_at, name, email, role, id, each also accepted with a leading - for descending
limitqueryintegerDEPRECATED, use page_size. Max members per page (max 200)
offsetqueryintegerDEPRECATED, use page. Rows to skip (default 0)

Responses

StatusDescriptionBody
200OKdata
404Not Founderror envelope

Change a member's project role ​

PATCH/v1/projects/{id}/members/{userID}

The org admin can set any role; project managers can only move members between developer and viewer.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
userID (required)pathintegerUser ID

Request body (application/json)

Schema: api.updateMemberRequest.

FieldTypeDescription
rolestringOne of: manager, developer, viewer.

Responses

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

Remove a member from a project ​

DELETE/v1/projects/{id}/members/{userID}

The org admin can remove anyone; project managers can only remove developers and viewers.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
userID (required)pathintegerUser ID

Responses

StatusDescriptionBody
204No Content
403Forbiddenerror envelope
404Not Founderror envelope

Grant a member "Run as a client" access ​

PUT/v1/projects/{id}/members/{userID}/run-as-client

Lets userID run this project's tools as one of its connected customers via POST /projects/{id}/tools/{toolName}/invoke's client_id — spending that customer's real, stored credential against their real account. This REPLACES the project-role check that action used to enforce: a manager no longer gets it for free, and a developer can hold it without being promoted. Scoped to the whole project, not one environment. An optional body narrows WHICH tools: {"tool_names": ["create_invoice"]} permits only those (matched against the names tools/list and /spec/operations already use); omitting the body, or sending tool_names: null, grants NOTHING — a member never gets every tool by default, so the organization admin must name the tools explicitly to permit any; sending tool_names: [] is the same empty grant made explicit. To grant every tool, send the reserved sentinel {"tool_names": ["$all"]} — the explicit, unambiguous way to request an unrestricted grant. Organization admin only. Idempotent, and re-PUTting with a different tool_names REPLACES the previous scope outright — there is no separate endpoint to narrow or widen an existing grant.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
userID (required)pathintegerUser ID — must already be a member of this project, in either environment

Request body (application/json)

Schema: api.grantRunAsClientRequest.

FieldTypeDescription
tool_namesstring[]

Responses

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

Revoke a member's "Run as a client" access ​

DELETE/v1/projects/{id}/members/{userID}/run-as-client

Removes the grant POST .../members/{userID}/run-as-client gave: userID can no longer impersonate this project's customers, regardless of their project role. 404 if they never held it. Organization admin only.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID
userID (required)pathintegerUser ID

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope

What changes on the environment, as it changes ​

GET/v1/projects/{id}/notices

Server-sent events, one stream per environment (ADR-0061): each says that something changed, never what it is now, so the page reads it again through its own route. The first event is ready, and ready again means notices may have been missed: read what is shown again. The kinds, each with the id of what changed: agent.eval_run.changed (a run), agent.eval_comparison.changed (a comparison), agent.playground_session.changed (a playground session), llm.usage.priced, hooks.run.changed (a hook), knowledge.source.changed (a document source), upstream.customer.forgotten (a purged customer, whose purge it ends), voice.call.changed (a call), identity.domain.changed (a project whose domain was checked), billing.card.bound (a card the payment gateway confirmed), mcp.wallet.moved (a customer whose wallet moved: a call reserved or settled). A stream also hears its organization's notices. A comment line keeps a quiet stream open every 15 seconds; the stream ends after 5 minutes, and a reconnect checks access again.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200SSE stream
401Unauthorized
403Forbidden
404Not Found
422Unprocessable Entity

A project's setup guide ​

GET/v1/projects/{id}/setup

Which of the setup guide's six steps the project has done (ADR-0063): spec (a spec uploaded), sign_in (upstream sign-in configured), agent (an agent created), playground (a playground session opened), channel (one of the channels in channels set up: a bot, the chat on the member's site, the MCP server published) and promote (a spec promoted to Production). A step counts once its action was ever recorded in the project's audit trail, in either environment, so it never turns back. The same in both environments: X-Frege-Stage is not read. Anyone who may see the project.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
404Not Founderror envelope

The caller's sidebar in a project ​

GET/v1/projects/{id}/sidebar

What the dashboard's sidebar shows for the caller in this project (ADR-0063). guided is true for a project made since the setup guide: its sidebar grows as the guide's steps (GET /projects/{id}/setup) are done; a project made before shows every page. pinned is the pages the caller added to the sidebar, in order: dashboard page names, kept as given. The same in both environments. Signed-in people only: an API key has no sidebar (401).

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
404Not Founderror envelope

Pin pages to the caller's sidebar ​

PUT/v1/projects/{id}/sidebar

Replaces the pages the caller pinned in this project with pinned, in its order (ADR-0063). Each is a page name: a lowercase letter, then lowercase letters, digits or dashes, at most 40 characters; at most 40 pages; a repeat is dropped. An empty list unpins every page. Not audited: a pin is a view preference. Signed-in people only (401 for an API key).

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Request body (application/json)

Schema: api.pinPagesRequest.

FieldTypeDescription
pinnedstring[]

Responses

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

List a project's environments ​

GET/v1/projects/{id}/stages

Both environments — Production and Staging — with each one's MCP address, publish state, upstream host and serving spec version. The address is empty until the environment has a spec generating at least one tool and a configured upstream credential; once ready, it is returned whether or not it is published, because it is a name rather than a secret and a screen has to show what it will be.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
403Forbiddenerror envelope
404Not Founderror envelope

Unarchive a project ​

POST/v1/projects/{id}/unarchive

Restores an archived project: its MCP server serves again and it reappears in listings. Only the organization admin can unarchive.

Authentication: bearer token.

Parameters

NameInTypeDescription
id (required)pathstringProject ID

Responses

StatusDescriptionBody
200OKdata
401Unauthorizederror envelope
403Forbiddenerror envelope
404Not Founderror envelope
409Conflicterror envelope