Appearance
Spec and tools
39 operations. Paths are relative to https://api.frege.io.
List this environment's tool views
GET/v1/projects/{id}/apps
Every view this environment holds, one per tool. A tool absent from the list has no view: it advertises none, and a host draws its result the way it draws any other MCP result. There is no built-in view and no environment-wide one — a view belongs to one tool, because a view that draws "a tool's response" cannot know what any particular response means.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
Get one tool's view
GET/v1/projects/{id}/apps/{toolName}
The HTML an MCP host renders for this tool's results, with the document itself. custom is false when this tool has no view, which is where every tool starts and is a complete state.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
toolName (required) | path | string | Tool name |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
Replace one tool's view
PUT/v1/projects/{id}/apps/{toolName}
Stores the HTML a host renders for this tool's results. Self-contained documents only — a host blocks every external script, stylesheet, font and image, and blocks outbound network calls; anything the document asks for from outside comes back in warnings, which do not stop the save. The tool need not exist yet: a view for a tool the spec does not publish is simply never attached, and the response says so with orphaned: true and a warning, which catches a mistyped tool name.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
toolName (required) | path | string | Tool name |
Request body (application/json)
Schema: api.setAppRequest.
| Field | Type | Description |
|---|---|---|
html | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 422 | Unprocessable Entity | error envelope |
Remove one tool's view
DELETE/v1/projects/{id}/apps/{toolName}
The tool stops advertising a view and a host draws its result the way it draws any other MCP result. Nothing replaces it: there is no built-in view and no environment-wide one.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
toolName (required) | path | string | Tool name |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
List the spec's operations and generated tools
GET/v1/projects/{id}/operations
Returns the operations in the ACTIVE spec version together with the tool each generates: the MCP tool_name, its description, and its JSON Schema input_schema — everything needed to render a tool browser and build a call. These are also the values client grants are built against. Paged by default at 50 per page; pass limit (up to 500) and offset to widen or move the window, in the spec's own stable order — the end is reached when a page comes back shorter than limit. Pair with POST /projects/{id}/tools/{toolName}/invoke to run one.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
page | query | integer | Page to return, 1-based (default 1) |
page_size | query | integer | Rows per page (default 50, max 500) |
sort | query | string | Order: spec (the document order), tool_name, path, method, each also accepted with a leading - for descending |
limit | query | integer | DEPRECATED, use page_size. Max operations per page (max 500) |
offset | query | integer | DEPRECATED, use page. Rows to skip (default 0) |
with_paths | query | boolean | Attach each operation's addressable response paths (value_paths) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Set how one operation is sent in this environment
PUT/v1/projects/{id}/operations/{operationID}/settings
Overrides, for this environment only, the spec's x-frege-max-body-bytes and x-frege-idempotent for one operation. A null field goes back to what the spec says; both null removes the override. The operation must be in the serving spec. Takes effect on the next call. Organization admin or a manager of the environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
operationID (required) | path | string | operationId in the spec |
Request body (application/json)
Schema: api.operationSettingRequest.
| Field | Type | Description |
|---|---|---|
idempotent | boolean | |
max_body_bytes | integer | null (or omitted) defers to the spec. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
How each operation is sent in this environment
GET/v1/projects/{id}/operations/settings
For every operation of the serving spec: the largest request body it may send (max_body_bytes) — photos sent by ref are shrunk to fit under it — and whether it is safe to send twice (idempotent), which decides whether a POST or PATCH that met a 503 or a network failure is retried. Each value says where it comes from: this environment's setting, the spec's x-frege-max-body-bytes / x-frege-idempotent, or the default (28 MB; GET, PUT and DELETE are always retried, POST and PATCH are not).
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
List the parameters that let the model choose whose data it reads
GET/v1/projects/{id}/scope-review
A path or query parameter that names an account is just an argument unless something fills it in, and the model chooses arguments. Each customer holding their own upstream credential does not close this: an upstream that only checks the token will answer for whatever id it was handed. Entries with blocking true name a person or an account and stop Production publishing until each is either bound by an injection in the environment's auth recipe (which pins it, so the model never sees it) or acknowledged as deliberately open. The rest are reported for review and never enforced.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
Say a parameter is deliberately open
PUT/v1/projects/{id}/scope-review/{operationID}/{param}
Records that a named person looked at this parameter and decided the model may choose it. This is a signature, not a setting: it stores who and when, and a second acknowledgement replaces the first. Prefer binding the parameter in the auth recipe where you can — a bound parameter never reaches the model at all, while an acknowledgement only says somebody accepted that it does.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
operationID (required) | path | string | Operation ID as the spec names it |
param (required) | path | string | Parameter name |
Request body (application/json)
Schema: api.acknowledgeParamRequest.
| Field | Type | Description |
|---|---|---|
in | string | |
note | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Take back an acknowledgement
DELETE/v1/projects/{id}/scope-review/{operationID}/{param}
The parameter goes back to unanswered, and Production stops publishing until it is bound or acknowledged again.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
operationID (required) | path | string | Operation ID as the spec names it |
param (required) | path | string | Parameter name |
in (required) | query | string | Where the parameter sits One of: path, query. |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
List the environment's skills
GET/v1/projects/{id}/skills
Agent Skills this environment serves over MCP (SEP-2640: skills/list, skills/get and skill:// resources, plus a load_skill tool for clients that read neither). Every skill with its file manifest — path, sha256 digest and size, exactly what skills/list publishes — without the file contents; GET one skill for those. Sorted by name; q keeps the skills whose name contains it. Paged by limit and offset (or page and page_size): 100 per page by default, at most 100 — total counts every skill that matches.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
q | query | string | Part of the skill's name, case-insensitive |
limit | query | integer | Max skills per page (default 100, max 100) |
offset | query | integer | Skills to skip (default 0) |
page | query | integer | Page to return, 1-based; instead of limit and offset |
page_size | query | integer | Rows per page (default 100, max 100); instead of limit and offset |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Create a skill
POST/v1/projects/{id}/skills
A skill is a SKILL.md — YAML frontmatter with at least name and description, then Markdown instructions — plus any text files it refers to, by relative path (references/guide.md). The skill's name comes from its frontmatter and must follow the Agent Skills rules: 1-64 lowercase letters, digits and hyphens, no hyphen first, last or twice in a row. Files are stored byte for byte; what clients receive and what their digests cover is exactly what was sent. Only UTF-8 text is accepted, and Frege never runs anything: at most 50 files, SKILL.md up to 64 KiB, 1 MiB in all. Frontmatter YAML that parsers disagree about (unquoted yes/no/on/off, dates, numbers with leading zeros, anchors) is refused with a request to quote it, because a client compares the published frontmatter against its own parse and drops the skill on any difference. warnings: allowed-tools, scripts/ and references to tools this environment lacks are accepted but reported. Tags scope which customers see the skill (skill_tag grants); a customer with any grant sees only the skills its skill_tag grants name. Skills are written in Staging only (X-Frege-Stage may be left out, or be staging; live is 422): Production serves exactly what Staging held at the last promotion.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.saveSkillRequest.
| Field | Type | Description |
|---|---|---|
files | api.skillFileRequest[] | |
tags | string[] |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 409 | a skill with that name already exists here | error envelope |
| 422 | Unprocessable Entity | error envelope |
Read one skill, file contents included
GET/v1/projects/{id}/skills/{name}
warnings lists the snake_case names the skill quotes in backticks that are not a tool (or a tool's parameter) of this environment — usually a tool the spec renamed or dropped since the skill was written. It is a heuristic and never blocks anything.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
name (required) | path | string | Skill name |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Replace a skill
PUT/v1/projects/{id}/skills/{name}
Same body as POST. Creates the skill when there is none by this name yet; otherwise replaces every file of it, so files left out are deleted. The SKILL.md's name must equal the one in the path — renaming changes the skill's URI, which is a different skill to every client, so delete and create instead. Any change to the files gives the skill new digests, and clients ask their users to approve it again. Skills are written in Staging only (X-Frege-Stage may be left out, or be staging; live is 422): Production serves exactly what Staging held at the last promotion.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
name (required) | path | string | Skill name |
Request body (application/json)
Schema: api.saveSkillRequest.
| Field | Type | Description |
|---|---|---|
files | api.skillFileRequest[] | |
tags | string[] |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Change which customers see a skill
PATCH/v1/projects/{id}/skills/{name}
Replaces the skill's tags. Tags are not part of the skill's files, so its digests — and every approval clients hold for it — stay as they are. Works in either environment (X-Frege-Stage; Production when left out), so a skill can be hidden or withdrawn from Production at once. The next promotion copies Staging over it again, undoing a change made only in Production; the promotion's warnings name each one first.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
name (required) | path | string | Skill name |
Request body (application/json)
Schema: api.skillTagsRequest.
| Field | Type | Description |
|---|---|---|
tags | string[] |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Delete a skill
DELETE/v1/projects/{id}/skills/{name}
The environment stops serving it at once. Works in either environment (X-Frege-Stage; Production when left out), so a skill can be hidden or withdrawn from Production at once. The next promotion copies Staging over it again, undoing a change made only in Production; the promotion's warnings name each one first.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
name (required) | path | string | Skill name |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 404 | Not Found | error envelope |
Download a skill as a zip archive
GET/v1/projects/{id}/skills/{name}/export
The skill's files inside a folder named after it — the layout any filesystem-skill host loads — with the stored bytes unchanged.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
name (required) | path | string | Skill name |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | |
| 404 | Not Found |
Draft a skill with the platform's model
POST/v1/projects/{id}/skills/draft
Asks the model the platform settings name for intent tools (intent_match_model) to write a skill that reaches goal with Staging's tools — all of them, or only those named in tools. A short skill comes back as SKILL.md alone; a long one as a SKILL.md that names up to 8 references/*.md files holding the detail. Nothing is saved and nothing is served: the answer has the same files shape as POST /skills takes, for a person to review, edit and then save with POST /skills. A draft can take up to three minutes. The draft is validated like any skill before it is returned; one refused answer is sent back to the model with the reason, and a second is 502. warnings carries what saving it would report, plus a note when a skill of the drafted name already exists. Staging only (X-Frege-Stage may be left out, or be staging). Paid for on Frege's own gateway key, so a project may draft at most 5 skills an hour (429 past that), and 409 means no model is set in the platform settings.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.draftSkillRequest.
| Field | Type | Description |
|---|---|---|
goal | string | |
tools | string[] |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 409 | no model is set for drafting | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 429 | Too Many Requests | error envelope |
| 502 | the model's draft was not a valid skill | error envelope |
Import a skill from a zip archive
POST/v1/projects/{id}/skills/import
The archive holds the skill's files either at its root or inside one top-level folder, as a zipped skill directory does; __MACOSX/ and .DS_Store are skipped. Send it as the raw body with Content-Type application/zip, or as multipart/form-data in a field named file. Up to 2 MiB compressed, and the same limits as POST once unpacked. replace=1 overwrites an existing skill of the same name instead of answering 409. Skills are written in Staging only (X-Frege-Stage may be left out, or be staging; live is 422): Production serves exactly what Staging held at the last promotion.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
replace | query | string | 1 replaces a skill of the same name One of: 0, 1. |
tags | query | string | Comma-separated tags |
Request body (application/x-www-form-urlencoded)
Type: file.
Request body (application/zip)
Type: string.
Request body (multipart/form-data)
Type: object.
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 413 | Request Entity Too Large | error envelope |
| 422 | Unprocessable Entity | error envelope |
Promote Staging's skills to Production
POST/v1/projects/{id}/skills/promote
Makes Production's skills an exact copy of Staging's, without promoting the spec: Production's set is replaced, not merged. Files are copied byte for byte, so a skill that did not change keeps its digests and the approvals clients hold for it; changed and removed list what clients will see differently. POST /spec/promote copies the skills too, together with the spec they were written against; warnings names what the copy undoes — tags set and skills deleted in Production alone — and where promoting the skills without the spec may not fit: Production serving a different spec than Staging, or a skill naming a tool Production lacks. Warnings never stop the promotion.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
Get the environment's spec
GET/v1/projects/{id}/spec
The spec the selected environment holds. 404 when it holds none, which is a real state and the one every new environment starts in — it serves no tools until something is uploaded. already_promoted says whether this document is byte-for-byte identical to the sibling environment's — false if the sibling holds no spec at all.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Upload the environment's OpenAPI spec
POST/v1/projects/{id}/spec
Stores the document for the environment named by the selector, where it is live immediately — there is no draft and no activate step. An environment holds at most ONE spec, so this is refused with 409 when the environment already has one: delete that first, deliberately. A document that does not parse is refused rather than stored, because there is no longer anywhere for an unusable file to sit quietly. So is one whose servers[0].url is not an absolute http(s) address — every call goes there. Use POST /projects/{id}/spec/validate to check a file before sending it. JSON and YAML are both accepted.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Type: object.
Request body (text/plain)
Type: object.
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Created | data |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error envelope |
Delete the environment's spec
DELETE/v1/projects/{id}/spec
Clears the spec from the environment named by the selector, its stored source, upstream auth flow and upstream base URL with it, leaving that environment serving no tools. This is how a spec is replaced: delete, then upload. Deleting Staging's is immediate. Deleting the spec PRODUCTION is serving takes every connected customer's tools away at once, so it needs confirm (the phrase from POST /spec/change-code) and the emailed code in the body.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.specChangeConfirmation.
| Field | Type | Description |
|---|---|---|
code | string | |
confirm | string |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | No Content | |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Read which operations a version marks as authentication operations
GET/v1/projects/{id}/spec/auth-ops
The read-back for PUT /projects/{id}/spec/auth-ops, in the same shape it accepts. Needed because that PUT replaces the selection wholesale: a picker that cannot see the current marks shows nothing selected and clears them on save. Returns the FULL list regardless of any paging over the operations themselves, so a mark on a page the user never scrolled to still survives a save. Sorted, so two identical requests can be diffed. A document that did not parse has no marks and answers with an empty list.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Set which operations are auth operations
PUT/v1/projects/{id}/spec/auth-ops
Marks exactly the named operations (by operationId) as x-frege-auth-op and clears the mark from every other operation, rewriting the stored document IN PLACE. An auth operation is excluded from the generated MCP tools and becomes callable by the upstream auth flow instead — this is how the frontend tells the backend "these endpoints are sign-in machinery, not tools" without hand-editing JSON. The rewrite touches only the marks, so nothing else in the document changes; it works on a spec uploaded as YAML too, and normalizes the stored form to JSON. If this is the live version, the change takes effect on the next MCP request. Unknown operationIds are rejected. Manager or developer on this environment.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.setAuthOpsRequest.
| Field | Type | Description |
|---|---|---|
code | string | |
confirm | string | |
operation_ids | string[] |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Full detail of every sign-in operation
GET/v1/projects/{id}/spec/auth-ops/detail
Everything a flow builder needs to draw a step editor: each parameter with its type, whether it is required and any allowed values; the request body's fields and full schema; every declared response with its schema; and the exact json paths a value can be captured from, written in the grammar the recipe engine itself resolves.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 409 | Conflict | error envelope |
Email a code for changing Production's spec
POST/v1/projects/{id}/spec/change-code
Sends a six-digit code to the signed-in operator, needed to delete or replace the spec Production is serving. Answers 422 when Production holds no spec — there is nothing to confirm, and those calls take no confirmation at all. Rate limited to one code a minute. The response carries the exact confirm phrase the follow-up call must send alongside the code.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 429 | Too Many Requests | error envelope |
Per-tool quality of the spec this environment is SERVING
GET/v1/projects/{id}/spec/lint
The same walk validateSpec runs, against the stored active spec rather than an upload. This is what a tool list can hang a badge on: which tools have nothing to reason with, which had an input silently dropped, and which hold an issue that will refuse promotion to Production. An environment with no spec answers 200 with empty lists, because "nothing uploaded yet" is a state to render, not an error.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
List the environment's spec operations, paginated and searchable
GET/v1/projects/{id}/spec/operations
Every operation in the environment's spec — including the ones excluded from the tool set — with the tool name each generates and whether it is currently marked as an auth operation. This is the picker behind PUT /projects/{id}/spec/auth-ops: unlike /projects/{id}/operations it addresses the environment's own spec rather than the selected one, it includes already-marked operations so a mark can be removed, and it takes a q filter so a large document does not have to be searched in the browser. Paged by default at 50 per page; pass limit (up to 500) and offset to widen or move the window, in the document's own stable order — the end is reached when a page comes back shorter than limit. A document that did not parse has no operations and answers with an empty list.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
page | query | integer | Page to return, 1-based (default 1) |
page_size | query | integer | Rows per page (default 50, max 500) |
sort | query | string | Order: spec (the document order), tool_name, path, method, each also accepted with a leading - for descending |
limit | query | integer | DEPRECATED, use page_size. Max operations per page (max 500) |
offset | query | integer | DEPRECATED, use page. Rows to skip (default 0) |
q | query | string | Case-insensitive substring over tool name, summary, description, path and tags |
method | query | string | Keep only this HTTP method, matched whole (GET, POST, PUT, PATCH, DELETE). Separate from q, which is a substring and would also match a path or a name containing those letters |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
Promote Staging's spec to Production
POST/v1/projects/{id}/spec/promote
COPIES Staging's spec into Production — a new record and a new stored file, byte for byte identical, owned by Production. The two environments stay independent afterwards, so clearing one never touches the other. The upstream auth flow configuration is copied with it, because that is part of what was tested; the stored upstream CREDENTIAL is not, because Staging's test credential must never reach live customers. Straightforward when Production is serving nothing. When it IS serving, the body must carry confirm (the phrase from POST /spec/change-code) and the emailed code.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.specChangeConfirmation.
| Field | Type | Description |
|---|---|---|
code | string | |
confirm | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
What promoting Staging would do to Production
GET/v1/projects/{id}/spec/promote/plan
Reads, changes nothing. One line per thing promotion touches, with what each environment holds now and whether it travels. copied: false is not always a gap — customers, their credentials and the published state must never move — so read the note. base_url is what Production's upstream address should be after this promotion, taken from the SPEC BEING PROMOTED and never inherited from Staging: the two point at different hosts on purpose, and carrying Staging's across is how a production environment ends up calling a sandbox. Empty means the document declares no servers[] and somebody has to type it. blocking is what would make the promotion itself refuse. ceremony says whether Production will ask for the typed phrase and the emailed code.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
Download a spec version's source
GET/v1/projects/{id}/spec/source
Returns the spec document. By default: the uploaded bytes byte for byte — the same key order, formatting and comments it arrived with — falling back to the normalized JSON for versions uploaded before the source was kept. Pass format=original to require the verbatim upload (404 if it was never kept, rather than silently substituting the normalized document; 503 if this server has no object storage configured at all, since then no version ever keeps one), or format=parsed to always get the normalized JSON regardless of whether a verbatim source exists.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
format | query | string | 'original' forces the verbatim upload (404 if not kept); 'parsed' forces the normalized JSON; omit for the default fallback One of: original, parsed. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The spec document | data |
| 404 | Not Found | error envelope |
| 503 | Service Unavailable | error envelope |
Validate an OpenAPI document without storing it
POST/v1/projects/{id}/spec/validate
Runs exactly the parse and conversion the upload would — 3.1 documents are down-converted to 3.0 the same way — and reports the verdict without creating a version. A failed parse is a normal 200 with parsed=false and the reason; the operator asked what would happen, and that is the answer. The editor's check-before-save button. tools_total and tools_with_issues always describe the whole document, so pass issues_only=true to receive only the tools that have something wrong and still render "2 of 106 need attention" — on a large spec that is the difference between a handful of entries and every operation.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
issues_only | query | boolean | Return only the tools that have at least one issue (default false, which returns every tool) |
Request body (application/json)
Type: object.
Request body (text/plain)
Type: string.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
Choose which tool surface this environment's MCP server publishes
PUT/v1/projects/{id}/tool-mode
"generated" (the default) serves one tool per operation in the active spec. "intent" serves the environment's compiled composites instead — a multi-step chain as one tool. Never both: a client reaches this environment's tools exactly one way. Switching modes takes effect on the next request, same as write-policy. A switch that would take tools away from a live agent is refused with 409, whose fields name each agent and the tools it would lose; pass force to switch anyway. Agents are never edited here — a forced switch leaves them with fewer tools (unknown_tools shows which), and one left with none fails its turns until somebody edits it. Organization admin only, for the same reason write-policy is: it changes what every caller of this environment can do, not one agent's own configuration.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.setToolModeRequest.
| Field | Type | Description |
|---|---|---|
force | boolean | |
mode | string |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 409 | Conflict | error envelope |
| 422 | Unprocessable Entity | error envelope |
Run one of the project's MCP tools
POST/v1/projects/{id}/tools/{toolName}/invoke
Executes a single generated tool exactly as the project's MCP server would — same operation, same injected upstream credential, same write policy — and returns the raw upstream response. On a SELF-SERVE project there is no project-level credential (every credential belongs to an individual end customer), so client_id is required and names whose stored credential to spend; omitting it returns a validation error saying so rather than a misleading "not connected". The client must belong to this project and have completed sign-in. Running as a customer is recorded in the audit trail with both parties: the actor columns say who asked, and on_behalf_of says whose account was reached. This is the deterministic counterpart to the chat agent's call_tool: no model in the loop, so it is the fastest way to confirm a spec produced the right tools and that upstream auth is wired up. Requires edit access; viewers can list tools and read their schemas but not run them. A 403 has two causes and the error code tells them apart: "forbidden" means the caller's role is too low, and "call_denied" means the environment's own policy — its write policy or a guardrail — refused this call. Either way it is Frege's own decision and not a fault to report to the tenant's API team, though only a refusal on the tool call means nothing was sent: a response-size rule fires after the upstream has answered, and drops the answer.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
toolName (required) | path | string | Tool name as returned by /projects/{id}/operations |
Request body (application/json)
Schema: mcphandlers.invokeToolRequest.
| Field | Type | Description |
|---|---|---|
arguments | object (map) | |
async | boolean | |
client_id | integer |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 401 | Unauthorized | error envelope |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |
| 502 | Bad Gateway | error envelope |
Search the spec's operations and generated tools
GET/v1/projects/{id}/tools/search
Case-insensitive substring search over the ACTIVE spec's tools — matches the generated tool name, the operation's summary and description, its path, and its tags. Same paging as GET /projects/{id}/operations (limit/offset, in the spec's stable order), applied to whatever matches q. An empty or missing q behaves exactly like that endpoint — the full list, paged. Pair with POST /projects/{id}/tools/{toolName}/invoke to run a match.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
q | query | string | Search text; matches tool name, summary, description, path, and tags |
page | query | integer | Page to return, 1-based (default 1) |
page_size | query | integer | Rows per page (default 50, max 500) |
sort | query | string | Order: spec (the document order), tool_name, path, method, each also accepted with a leading - for descending |
limit | query | integer | DEPRECATED, use page_size. Max matches per page (max 500) |
offset | query | integer | DEPRECATED, use page. Rows to skip (default 0) |
with_paths | query | boolean | Attach each match's addressable response paths (value_paths) |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 404 | Not Found | error envelope |
The brand applied to this environment's TOOL VIEWS
GET/v1/projects/{id}/view-theme
A tool view is the small page a customer's AI draws instead of plain text when it calls one of this environment's tools. Its brand is separate from the chat widget's since they are drawn in different places. A closed set of named values, injected as CSS custom properties on :root before each view's own document — deliberately NOT a stylesheet field, because a view renders inside an MCP host's frame over somebody's account data and free-text CSS is a place to put an @import.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
Set the TOOL VIEWS' brand
PUT/v1/projects/{id}/view-theme
Sending every field empty removes the brand, after which every view is served exactly as its author stored it. Manager only.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.setWidgetThemeRequest.
| Field | Type | Description |
|---|---|---|
accent | string | |
background | string | |
border | string | |
font_key | string | |
foreground | string | |
logo_data_uri | string | |
muted | string | |
radius_px | integer |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 422 | Unprocessable Entity | error envelope |
Set this ENVIRONMENT's write policy
PUT/v1/projects/{id}/write-policy
Sets whether THIS environment's generated tools may perform mutating operations; the other environment keeps its own. "allow" leaves every mutating operation in the published spec callable. "deny" refuses every non-GET operation on every door — the MCP token server, the per-customer OAuth server, the REST invoke endpoint and in-Frege chat — at the single execution choke point, before the upstream credential is resolved. "ask" pauses a mutating call for a person instead: an MCP client that declared it can put a form in front of one, or an agent turn (Playground, the embed widget, the Telegram bot), stops before executing and continues only once approved. Every other door cannot ask, so there "ask" behaves exactly like "deny" rather than degrading to "allow". Whether an operation counts as mutating is decided by its HTTP METHOD, never by its name or description, since those are authored by whoever uploaded the spec. A refusal is recorded in the audit trail as a policy denial rather than an upstream fault. Takes effect on the next call. Organization admin only.
Authentication: bearer token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id (required) | path | string | Project ID |
Request body (application/json)
Schema: api.setWritePolicyRequest.
| Field | Type | Description |
|---|---|---|
policy | string | One of: allow, deny, ask. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | OK | data |
| 403 | Forbidden | error envelope |
| 404 | Not Found | error envelope |
| 422 | Unprocessable Entity | error envelope |