Productmind API

Applications

An application is one of your code repositories, with what Productmind needs to run it: commands, services, ports and environment variables. Create applications, import them from your repositories or start one from a template, update their configuration, and read their linked features, documentation and repository files. Run the documentation, feature discovery and agentic readiness scans on one application or across all of them, and stop a scan while it runs. Estimate what scanning your repositories will cost before you start, and resume a scan that paused when your pay-as-you-go balance ran out. See Applications.


List applications in a workspace

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications

Returns the workspace's applications - reusable runnable units (a git repo + branch, install/dev commands, preview ports, env vars) that attach to sandboxes. Secret env values are masked. As an MCP tool it is offered to Owners and Admins, on their own AI assistant.

List applications in a workspace › path Parameters

workspaceId
​string · required

Workspace UUID

List applications in a workspace › query Parameters

page
​number

Page number (1-indexed, default 1)

limit
​number

Items per page (default 50)

sortBy
​string · enum

Field to sort by

Enum values:
name
createdAt
sortOrder
​string · enum

Sort direction (default desc)

Enum values:
asc
desc
search
​string

Full-text search across searchable fields

List applications in a workspace › Responses

200

List of applications

​ApplicationDTO[] · required
​object
​object

Create an application

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications

Create a reusable application (repo + branch, install/dev commands, preview ports, env vars). Secret env values are encrypted at rest. requireDependencyInstall: true needs an install command (400 otherwise). Needs application:create (Owner, Admin and Power User by default). A session's credential is refused with 403: the application's base branch becomes what later sessions' pull requests merge into. A production or development branch override takes a person's own login: an MCP client's token, an API key and a support principal are refused it with 403.

Create an application › path Parameters

workspaceId
​string · required

Workspace UUID

Create an application › Request Body

name
​string · minLength: 1 · maxLength: 200 · required
description
​string
​
​
​
​
requireDependencyInstall
​boolean
readOnly
​boolean
​
​PreviewPort[] · maxItems: 20
​WorkspaceEnvVar[] · maxItems: 100
llmAssistedPreviewSetup
​boolean
​
​
​
​

Create an application › Responses

Created application

​ApplicationDTO · required

List the Application templates available to fork

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/templates

Returns Productmind's curated Application templates: name, description, a short plain-text summary of that description, and stack classification only. The template's repository, workspace, documents and feature specifications are never exposed; the repository is resolved server-side at fork time. Returns an empty array when no templates workspace is configured.

List the Application templates available to fork › path Parameters

workspaceId
​string · required

Workspace UUID

List the Application templates available to fork › Responses

200

Available templates

​ApplicationTemplateDTO[] · required

Create an Application from a template

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/from-template

Copies the template's repository into Productmind's own GitHub organization as a new private repository, creates an Application linked to it, and copies the template's Knowledge Base documents and feature specifications. A very large template's documents and specifications are copied in part; templateCopy in the response says how many of each were copied and how many were left out. A failed copy creates no Application. Not idempotent: a repeated call creates a second repository, except that a call for a template this workspace already copied in the last ten minutes is refused with 409, because it is most often a retry of a request whose answer was lost.

Create an Application from a template › path Parameters

workspaceId
​string · required

Workspace UUID

Create an Application from a template › Request Body

templateId
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required
name
​string · minLength: 1 · maxLength: 200

Create an Application from a template › Responses

The new Application, with what its copy brought across

​ApplicationFromTemplateDTO · required

Save a live preview's repaired run commands on the application

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/repaired-commands

When an application's configured install or run command failed in a live preview with AI-assisted preview setup on, an AI turn repairs it and the preview runs the repaired commands. They are recorded on the preview only. This saves them as the application's own install and run commands. A field is written only while the application still holds the command the repair replaced (or already holds the repaired one); a command edited since answers 409 and nothing is written. Idempotent. Answers the preview, stamped with when and by whom the commands were saved.

Save a live preview's repaired run commands on the application › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Save a live preview's repaired run commands on the application › Request Body

previewId
​string · uuid · pattern: ^([0-9a-fA-F]{8}-[0-… · required

The live preview whose repaired commands to save

Save a live preview's repaired run commands on the application › Responses

The preview, with the repair marked saved

​SessionPreviewDTO · required

Add your GitHub account as a collaborator on a Productmind-hosted repository

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/collaborators

Invites the CALLER's connected GitHub account as an admin collaborator on this Application's repository. Only valid for a template-forked repository in Productmind's own organization. The account comes from the caller's connected GitHub user integration and is never taken from the request. Off by default: unless Productmind has turned it on for the organization, it answers 403 and invites no one.

Add your GitHub account as a collaborator on a Productmind-hosted repository › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Add your GitHub account as a collaborator on a Productmind-hosted repository › Responses

200

The invitation

​object · required

Get an application by ID

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}

Returns one application: its repository and branches, install and run commands, services and preview ports, environment variables (secret values masked) and risk rules (null while it is on the default rules). As an MCP tool it is offered to Owners and Admins, on their own AI assistant.

Get an application by ID › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Get an application by ID › Responses

200

Application details

​ApplicationDTO · required

Update an application

PUT
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}

Update name, repo, commands, ports, env vars, or the risk profile pull request reviews rate its changed files with. A secret env entry sent with an empty value preserves the stored secret; riskRules: null puts the application back on the default risk rules. requireDependencyInstall: true makes a plan, a build or a scan stop before the AI starts when the install fails; it needs an install command (400 otherwise), and clearing the install command turns it off. readOnly: true makes coding sessions read the application's repository for context and never push to it or open pull requests on it; turning it off takes a person's own login. Needs application:update (Owner, Admin and Power User by default). Changing the repository, its base branch or a production or development override, or clearing the repository, takes a person's own login: a session's credential, an MCP client's token, an API key and a support principal get 403. The whole repository sent back with the same values, and every other field, are not held to it. The Development or Production branch of an environment that deploys to a cloud account cannot change until the cloud account is detached (409).

Update an application › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Update an application › Request Body

name
​string · minLength: 1 · maxLength: 200
​
​
​

The whole risk profile, replacing the stored one; null resets it to the defaults

​
​
​
requireDependencyInstall
​boolean
readOnly
​boolean
​
​PreviewPort[] · maxItems: 20
​WorkspaceEnvVar[] · maxItems: 100
llmAssistedPreviewSetup
​boolean
​
​
​
​
​

Update an application › Responses

Updated application

​ApplicationDTO · required

Delete an application

DELETE
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}

Detaches it from any sandboxes (join FK ON DELETE CASCADE). Needs application:delete (Owner, Admin and Power User by default). Deleting an application that has a repository takes a person's own login: a session's credential, an MCP client's token, an API key and a support principal get 403. An application with an environment that deploys to a cloud account is not deleted (409) until an Owner or Admin detaches the cloud account.

Delete an application › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Delete an application › Responses

Deleted

No data returned

Get the latest agentic engineering readiness report

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/readiness

Returns the most recent readiness scan report for the application (rating, findings, detected tools, status), or null when the application has never been scanned.

Get the latest agentic engineering readiness report › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Get the latest agentic engineering readiness report › Responses

200

The latest readiness report, or null

​required

Start an agentic engineering readiness scan

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/readiness-check

Kicks off a background Productmind agent session that scans the application's attached repository for agentic-engineering readiness (CLAUDE.md / AGENTS.md presence + freshness, skills, folder scaffolding, AI-tool optimization) and returns a structured verdict. Rejects when the app has no repository or a scan is already in flight. On a pay-as-you-go plan it starts only when your balance covers what its run reserves; otherwise it answers 402 (or 429) before anything is created.

Start an agentic engineering readiness scan › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Start an agentic engineering readiness scan › Responses

Scan queued — the report row (status=queued)

​ApplicationReadinessReportDTO · required

Force-stop an in-flight readiness scan

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/readiness-check/cancel

Cancels the application's in-flight readiness scan — settles the report row to failed and best-effort cancels the backing scan session. Idempotent: returns the latest report (or null) when nothing is in flight.

Force-stop an in-flight readiness scan › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Force-stop an in-flight readiness scan › Responses

200

The settled readiness report, or null

​required

Stop every in-flight readiness scan in the workspace

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/readiness-check/cancel

The Stop for the workspace-wide readiness fan-out: settles every in-flight readiness report to failed and best-effort cancels each backing scan session. Best-effort per application and capped at 100 per call — click again to settle the rest. Returns the reports that were settled.

Stop every in-flight readiness scan in the workspace › path Parameters

workspaceId
​string · required

Workspace UUID

Stop every in-flight readiness scan in the workspace › Responses

200

The readiness reports that were settled

​ApplicationReadinessReportDTO[] · required

Start agentic engineering readiness checks across all applications

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/readiness-check

Fans out an agentic engineering readiness scan to every application in the workspace that has a repository and no in-flight scan. Returns the reports that were queued. Funding is checked once, before the first scan starts: when your pay-as-you-go balance does not cover one scan, or the first scan is refused, it answers 402 (or 429) and starts nothing.

Start agentic engineering readiness checks across all applications › path Parameters

workspaceId
​string · required

Workspace UUID

Start agentic engineering readiness checks across all applications › Responses

The readiness reports that were queued

​ApplicationReadinessReportDTO[] · required

Get the latest repository discovery run

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/discovery

Returns the most recent discovery run for the application (status, summary, created/updated feature counts) for the features objective, or null when the application has never been scanned.

Get the latest repository discovery run › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Get the latest repository discovery run › Responses

200

The latest discovery run, or null

​required

Start a repository feature-discovery scan

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/discovery-check

Kicks off a hidden background Productmind agent session that scans the application's repository to discover new Features and update existing Feature specifications to match observed behavior (following the workspace's Feature specification template). Discovered/updated Features are auto-linked to this application. Objective-typed - defaults to features. Rejects when the app has no repository or a run is already in flight. Once the workspace has a feature catalog it answers 409 and creates nothing: re-scan the catalog with Feature discovery instead, which proposes its changes for your review. On a pay-as-you-go plan it starts only when your balance covers what its run reserves; otherwise it answers 402 (or 429) before anything is created.

Start a repository feature-discovery scan › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Start a repository feature-discovery scan › Request Body optional

objective
​string · enum
Enum values:
features

Start a repository feature-discovery scan › Responses

Discovery queued — the run row (status=queued)

​ApplicationDiscoveryRunDTO · required

Force-stop an in-flight discovery run

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/discovery-check/cancel

Cancels the application's in-flight discovery run — settles the run row to failed and best-effort cancels the backing scan session. Idempotent: returns the latest run (or null) when nothing is in flight.

Force-stop an in-flight discovery run › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Force-stop an in-flight discovery run › Responses

200

The settled discovery run, or null

​required

Stop all in-flight per-feature deep dives

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/deep-dives/cancel

Force-stops every in-flight (queued or running) per-feature deep dive belonging to this application's linked features - the phase-2 counterpart of cancelling the discovery map pass. Each proposal is settled to failed/'Cancelled' and its backing scan session is best-effort cancelled. Proposals already awaiting review are left alone (that agent finished; its work is parked on a diff). So is a deep dive someone else started, unless the caller manages the workspace (an organization Owner or Admin, the workspace's owner or one of its admins). Idempotent: returns an empty array when nothing is in flight.

Stop all in-flight per-feature deep dives › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Stop all in-flight per-feature deep dives › Responses

200

The deep-dive proposals that were cancelled

​FeatureDescriptionProposalDTO[] · required

Start discovery across all applications

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/discovery-check

Fans out a repository feature-discovery scan to every application in the workspace that has a repository and no in-flight run. Returns the runs that were queued. Once the workspace has a feature catalog it answers 409 and starts nothing: re-scan the catalog with Feature discovery instead, which proposes its changes for your review. Funding is checked once, before the first scan starts: when your pay-as-you-go balance does not cover one scan, or the first scan is refused, it answers 402 (or 429) and starts nothing.

Start discovery across all applications › path Parameters

workspaceId
​string · required

Workspace UUID

Start discovery across all applications › Request Body optional

objective
​string · enum
Enum values:
features

Start discovery across all applications › Responses

The discovery runs that were queued

​ApplicationDiscoveryRunDTO[] · required

Get the latest documentation scan run

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/documentation

Returns the most recent documentation run for the application (status, summary, created/proposed/unchanged document ids), or null when the application has never been scanned.

Get the latest documentation scan run › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Get the latest documentation scan run › Responses

200

The latest documentation run, or null

​required

Start a documentation scan

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/documentation-check

Kicks off a hidden background Productmind agent session that reads the application's repository and generates/maintains its hierarchical Knowledge Base documentation tree (Architecture Overview, Setup Guide, How to Run, Coding Standards, Technical Gotchas, per-module children). New documents are created directly; updates to existing documents are proposal-gated (diff-and-approve). Rejects when the app has no repository or a run is already in flight. On a pay-as-you-go plan it starts only when your balance covers what its run reserves; otherwise it answers 402 (or 429) before anything is created.

Start a documentation scan › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Start a documentation scan › Responses

Documentation scan queued — the run row (status=queued)

​ApplicationDocumentationRunDTO · required

Force-stop an in-flight documentation run

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/documentation-check/cancel

Cancels the application's in-flight documentation run — settles the run row to failed and best-effort cancels the backing scan session. Idempotent: returns the latest run (or null) when nothing is in flight.

Force-stop an in-flight documentation run › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Force-stop an in-flight documentation run › Responses

200

The settled documentation run, or null

​required

Stop every in-flight documentation scan in the workspace

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/documentation-check/cancel

The Stop for the workspace-wide documentation fan-out: settles every in-flight documentation run to failed and best-effort cancels each backing scan session. Best-effort per application and capped at 100 per call — click again to settle the rest. Returns the runs that were settled.

Stop every in-flight documentation scan in the workspace › path Parameters

workspaceId
​string · required

Workspace UUID

Stop every in-flight documentation scan in the workspace › Responses

200

The documentation runs that were settled

​ApplicationDocumentationRunDTO[] · required

Start documentation scans across all applications

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/documentation-check

Fans out a documentation scan to every application in the workspace that has a repository and no in-flight run. Returns the runs that were queued. Funding is checked once, before the first scan starts: when your pay-as-you-go balance does not cover one scan, or the first scan is refused, it answers 402 (or 429) and starts nothing.

Start documentation scans across all applications › path Parameters

workspaceId
​string · required

Workspace UUID

Start documentation scans across all applications › Responses

The documentation runs that were queued

​ApplicationDocumentationRunDTO[] · required

List repositories not yet attached to an application

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/detectable-repositories

Returns the git repositories available to the workspace (via workforce) that aren't attached to any application yet — the source for the 'Detect applications from code repositories' picker. Paginated, searchable (search matches the full name and provider) and sortable by last code activity or name; the default order is freshest activity first. Requires a user token.

List repositories not yet attached to an application › path Parameters

workspaceId
​string · required

Workspace UUID

List repositories not yet attached to an application › query Parameters

page
​number

Page number (1-indexed, default 1)

limit
​number

Items per page (default 50)

sortBy
​string · enum

Field to sort by

Enum values:
activity
repoName
sortOrder
​string · enum

Sort direction (default desc)

Enum values:
asc
desc
search
​string

Full-text search across searchable fields

List repositories not yet attached to an application › Responses

200

Unattached repositories

​DetectableRepositoryDTO[] · required
​object
​object

Detect applications from code repositories

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/detect

Starts a hidden background Productmind agent scan for each picked repository: one read-only session per repo that detects the repo's launch behavior (install/dev commands, preview ports, env keys) and auto-creates a fully-configured application per detected app. On a pay-as-you-go plan the scan starts only when your balance covers the median of its cost estimate; otherwise it answers 402 (or 429) before anything starts. Needs application:create (Owner, Admin and Power User by default).

Detect applications from code repositories › path Parameters

workspaceId
​string · required

Workspace UUID

Detect applications from code repositories › Request Body

​object[] · minItems: 1 · maxItems: 50 · required

Detect applications from code repositories › Responses

The detection runs that were queued

​ApplicationDetectionRunDTO[] · required

Estimate the cost of scanning repositories

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/scan-estimate

Returns what a scan of the given number of repositories is expected to cost on your organization's plan, as a range from the median to the 90th percentile of measured scans, in AI credits and in euro cents at your plan's price per 1M AI credits (null when the plan sets no price). Also returns your pay-as-you-go balance and whether it covers the median, which a scan needs to start; when it does not, refusal carries the error a scan would get. A scan that would run on your own Productmind agent uses no AI credits (userHosted).

Estimate the cost of scanning repositories › path Parameters

workspaceId
​string · required

Workspace UUID

Estimate the cost of scanning repositories › query Parameters

repositories
​integer · min: 1 · max: 50 · required

How many repositories the scan would cover, 1 to 50.

Estimate the cost of scanning repositories › Responses

200

The scan estimate

​ScanEstimateDTO · required

Check which scans can start now

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/scan-step-funding

Returns, for each scan you can start from the Applications scan menu (the service architecture map, feature discovery and its AI reading pass, and the readiness and documentation checks across all applications), whether your organization's plan and pay-as-you-go balance let it start now. Each scan is judged on what its first run reserves, the same check a start of it meets before anything is created. When one cannot start, refusal carries the error that start would get (402, or 429 when spending is paused or a usage limit is reached) and, for a balance refusal, the amounts and the top-up that covers them. A scan that would run on your own Productmind agent is judged on its session fee instead of AI credits.

Check which scans can start now › path Parameters

workspaceId
​string · required

Workspace UUID

Check which scans can start now › Responses

200

Whether each scan can start

​ScanStepFundingDTO · required

Resume scans paused for funding

POST
https://api.productmind.ai
/workspaces/{workspaceId}/applications/scan-resume

A scan that runs out of pay-as-you-go balance part-way does not fail: its next step waits, paused, until the balance covers it. A top-up resumes it automatically; this starts it again by hand, for example after turning spending back on. Returns the steps that were started. If the balance still does not cover the next step, it stays paused and the call answers 402 (or 429 when spending is paused) with the reason. While the workspace has Productmind cloud sessions turned off, a step runs on the Productmind agent of the person who started the scan: with that agent not online, the step stays paused and the call answers 409, with coding.local_agent_required when the agent is your own.

Resume scans paused for funding › path Parameters

workspaceId
​string · required

Workspace UUID

Resume scans paused for funding › Request Body

Resume scans paused for funding › Responses

The scan steps that were started again

​ResumeWorkspaceScanResponseDTO · required

List recent application-detection runs

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/detection-runs

Returns the workspace's recent 'Detect applications' runs (status, scanned repo, created application ids) — drives the detection progress surface.

List recent application-detection runs › path Parameters

workspaceId
​string · required

Workspace UUID

List recent application-detection runs › Responses

200

Recent detection runs

​ApplicationDetectionRunDTO[] · required

List the features that depend on an application

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/features

Returns the features linked to this application (feature depends_on application). Each row carries the feature id, display id (FEAT-N), title, status, and priority. Surfaces how a given application powers a set of features.

List the features that depend on an application › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

List the features that depend on an application › Responses

200

Linked features

​LinkedFeatureDTO[] · required

List the KB documents linked to an application

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/documents

Returns the knowledge base documents that document this application (kb_document documents application), with hierarchy fields (parentDocumentId, sortOrder) so callers can render the documentation tree, plus each link's last-scanned commit baseline.

List the KB documents linked to an application › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

List the KB documents linked to an application › Responses

200

Linked KB documents

​LinkedDocumentDTO[] · required

Read a file from the attached repo

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/repo-file

Fetches the first existing file among the comma-separated paths from the application's attached git repo, live from the provider (via workforce's generic get_file action). Generic — the README-import flow passes README variants, but any file works. Returns { found: false } when the app has no repo or none of the candidates exist. Requires a user token.

Read a file from the attached repo › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Read a file from the attached repo › query Parameters

paths
​string · required

Comma-separated candidate file paths, tried in order (first hit wins)

Read a file from the attached repo › Responses

200

The first matching file (if any)

​ApplicationRepoFileDTO · required

Suggest repository paths for a code-path entry

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/repo-paths

Lists the application's attached git repository at a ref (the scan commit or the base branch) live from the git provider, caches the tree for up to ten minutes, and returns the entries that best match q: segments split on / must occur in order, so api/auth finds the directory src/api/auth/. Files and directories both; a directory is what a code path records with a trailing slash. truncated says the provider or the connector's entry cap did not list the whole tree; total is the match count before limit. Answers { ref: null, entries: [] } when the application has no repository. ref must be a commit sha or the repository's base branch. Requires a user token.

Suggest repository paths for a code-path entry › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Suggest repository paths for a code-path entry › query Parameters

q
​string · maxLength: 500

Path fragment to match; segments split on / must occur in order

Default:
ref
​string · maxLength: 256

Commit sha or the repository's base branch; defaults to the base branch

limit
​integer · min: 1 · max: 100

Matches to return, best first

Default: 20

Suggest repository paths for a code-path entry › Responses

200

The best-matching repository paths

​ApplicationRepoPathsDTO · required

List an application's API description files

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/api-specs

Lists the OpenAPI and Swagger files in the application's repository at its base branch and says which web service each describes. A service uses the file pinned on it; otherwise a single web service takes the best-ranked file, and several web services each take the best-ranked file in a folder named like the service. Files no service took are listed in otherSpecs. truncated says the repository was too large to list whole. Answers { ref: null } for an application with no repository. Requires a user token.

List an application's API description files › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

List an application's API description files › Responses

200

Each web service's API description file

​ApplicationApiSpecsDTO · required

Read an application's API description file

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/api-specs/content

Answers the raw text of one of the application's API description files at the base branch: a file the API description list names, or one pinned on a service. Files up to 4 MB. Requires a user token.

Read an application's API description file › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Read an application's API description file › query Parameters

path
​string · minLength: 1 · maxLength: 1024 · required

The API description file to read: one the application's API descriptions list

Read an application's API description file › Responses

The file's text

string

List where an application's API reference can send requests

GET
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/api-specs/targets

Lists the running live previews of sessions that run this application and that the caller can see, one entry per port, and, for a caller who may change the application, its deployed environments with the domain requests may go to.

List where an application's API reference can send requests › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

List where an application's API reference can send requests › Responses

200

Live previews and environments

​ApplicationApiTargetsDTO · required

Set an application's install and run commands

PUT
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/commands

Sets the command that installs the application's dependencies, the command that starts it for a live preview, and the directory both run in, relative to the repository root, and whether its dependencies must install (requireDependencyInstall: true stops a plan, a build or a scan before the AI starts when the install fails, times out or cannot run). A field left out is kept and null clears it; send at least one. Requiring the install needs an install command, the stored one or this call's: without one it is refused with 400, and clearing the install command turns the requirement off. Every later coding session and live preview of the application runs these commands. Owner and Admin only: needs configuration-tools:manage as well as application:update. A coding session's token is refused with 403. Answers the updated application.

Set an application's install and run commands › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Set an application's install and run commands › Request Body

​

The shell command that installs dependencies, run in the working directory before the dev command, e.g. bun install. null clears it; leave it out to keep it.

​

The shell command that starts the application for a live preview, e.g. bun run dev. null clears it; leave it out to keep it.

​

The directory both commands run in, relative to the repository root, e.g. services/web. null runs them at the root; leave it out to keep it.

requireDependencyInstall
​boolean

Require dependencies to install: true makes a plan, a build or a scan of this application stop before the AI starts when its install command fails, times out or cannot run; false lets the run continue without it, as by default. true needs an install command, the stored one or installCommand in this call; clearing the install command turns it off. Leave it out to keep it.

Set an application's install and run commands › Responses

200

The updated application, secret values masked

​ApplicationDTO · required

Change an application's environment variables

PATCH
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/env-vars

Adds, replaces and removes the application's environment variables by key: set adds a key or replaces it, remove deletes one, and every variable not named is kept as it is. A secret is stored encrypted and never shown again. Leaving secret out keeps a variable's kind, and leaving a secret's value out keeps its stored value. Refused with 400: a secret with no value to keep, a secret made plain without a new value, a key in both set and remove, and more than 100 variables in the result. Owner and Admin only: needs configuration-tools:manage as well as application:update. A coding session's token is refused with 403. Answers the updated application, secret values masked.

Change an application's environment variables › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Change an application's environment variables › Request Body

​WorkspaceEnvVarPatchEntry[] · maxItems: 100

Variables to add, or to replace by key, each { key, value?, secret? }. A key already stored is replaced in place; a new one is added at the end. Every key once.

remove
​string[] · maxItems: 100

Keys to delete. A key that is not set is ignored. A key cannot be in both set and remove.

Change an application's environment variables › Responses

200

The updated application, secret values masked

​ApplicationDTO · required

Replace an application's services and preview ports

PUT
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/services

Replaces the application's services, the runnable units inside it, with the list sent. A service with a port is a preview port: ports are unique, at most 20 services have one, and one of them is the main port a live preview opens first (the first service with a port when none is marked). At most 50 services; an empty list removes them all. Owner and Admin only: needs configuration-tools:manage as well as application:update. A coding session's token is refused with 403. Answers the updated application.

Replace an application's services and preview ports › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Replace an application's services and preview ports › Request Body

​ApplicationService[] · maxItems: 50 · required

Every runnable unit of the application, replacing the stored list: send the services to keep too, [] removes them all. Each is { name, type, port?, protocol?, isMain? }. A service with a port is a preview port: ports are unique, and at most 20 services have one. isMain marks the port a live preview opens first: one service at most, and only one with a port; when none is marked, the first service with a port is the main one. At most 50 services.

Replace an application's services and preview ports › Responses

200

The updated application, secret values masked

​ApplicationDTO · required

Replace an application's risk rules

PUT
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/risk-rules

Replaces the risk profile that pull request reviews rate the application's changed files with. An array is the whole profile, and null puts the application back on the default rules. Owner and Admin only: needs configuration-tools:manage as well as application:update. A coding session's token is refused with 403. Answers the updated application.

Replace an application's risk rules › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Replace an application's risk rules › Request Body

​required

The rules pull request reviews rate each changed file with, replacing the whole profile, or null to put the application back on Productmind's default rules. An array is the complete profile: a rule left out is no longer applied, the defaults included. get-application answers riskRules: null while the application is on the defaults. Each rule is { id, name, tier, pathPatterns, nameWords, lineTexts, minChangedLines }, every key present (empty lists and null where unused), with at least one condition.

Replace an application's risk rules › Responses

200

The updated application, secret values masked

​ApplicationDTO · required

Set an application's branches

PATCH
https://api.productmind.ai
/workspaces/{workspaceId}/applications/{id}/branches

Sets the branches of the repository already attached to the application: the base branch coding sessions branch from and open pull requests against, and the branches whose merges deploy it to Development and Production (null falls back to the workspace's Git workflow default). Also sets the application's branch for any of the workspace's own environments (null unmaps one), and whether it is read-only (readOnly: true makes coding sessions read this application's repository for context and never push to it or open pull requests on it, in every session, the open ones included). A field left out is kept. The repository itself never changes here: attaching, switching or removing one is done in the app. Refused before anything is written: with 409 for an application with no repository, a branch an open coding session works on, or a change to the branch of an environment that deploys to a cloud account (detach it in the app first), and with 400 for Development or Production named as an environment. Owner and Admin only: needs configuration-tools:manage as well as application:update. A coding session's token is refused with 403. Works with a person's own sign-in or their own AI assistant's. Answers the updated application; list-application-environments reads each environment's branch.

Set an application's branches › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

Set an application's branches › Request Body

baseBranch
​string · minLength: 1 · maxLength: 256

The branch coding sessions branch from and open their pull requests against.

​

The branch whose merges deploy this application to Development. null falls back to the workspace's Git workflow default.

​

The branch whose merges deploy this application to Production, and what a release merges into. null falls back to the workspace's Git workflow default.

​ApplicationEnvironmentBranchEntry[] · maxItems: 50

Custom environments' branches, each { environmentId, branch }. Every environment once.

readOnly
​boolean

Read-only: true makes coding sessions read this application's repository for context and never push to it or open pull requests on it, in every session, the open ones included; false lets sessions push their working branch again, as by default. Leave it out to keep it.

Set an application's branches › Responses

The updated application, secret values masked

​ApplicationDTO · required