Productmind API

Environments

An environment is somewhere your applications deploy to: Development and Production in every workspace, and any your workspace adds. List, create, rename and delete environments, and read or set the branch each application deploys to an environment from. An application's Development and Production branches are its own branch fields, else the workspace's Git workflow defaults. See Applications.


List an application's branch for each environment

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

Lists every environment of the workspace with its id, the branch whose merges deploy this application to it, and where that branch comes from: the application's own, the workspace's Git workflow default (Development and Production only), or unmapped. An application with no repository maps nothing. Each environment also carries the cloud account it deploys to, if any. Everyone who may read applications sees its status, kind and tier, the branch it deploys from (during a branch change the new one, and the branch it moves from), and its domain with whether public DNS delegates it yet. Those who may read cloud accounts also see which account it is, why it failed and what it was doing (setting up deploys, changing the branch or detaching), whether it can be retried, why it is paused, and whether a detach would remove it at once. As an MCP tool it is offered to Owners and Admins, on their own AI assistant.

List an application's branch for each environment › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

List an application's branch for each environment › Responses

200

Each environment's branch for the application

​ApplicationEnvironmentDTO[] · required

Set an application's branch for an environment

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

Sets or clears the branch whose merges deploy this application to one of the workspace's own environments. Development and Production take theirs from the application's own branch fields, set by updating the application. Refused for an application with no repository, and for a branch an open coding session is working on. Only a person signed in to Productmind can set one.

Set an application's branch for an environment › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Application UUID

environmentId
​string · required

Environment UUID

Set an application's branch for an environment › Request Body

​required

The branch whose merges deploy to this custom environment, or null to unmap it.

Set an application's branch for an environment › Responses

Each environment's branch for the application

​ApplicationEnvironmentDTO[] · required

List environments

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

Lists the workspace's environments: Development and Production first, then the workspace's own, oldest first. Every workspace has Development and Production.

List environments › path Parameters

workspaceId
​string · required

Workspace UUID

List environments › Responses

The workspace's environments

​EnvironmentDTO[] · required

Create an environment

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

Adds an environment to the workspace. Its key is 2 to 16 lowercase letters, digits and hyphens, starting with a letter, with no hyphen at the end and never two in a row, and it never changes. Only a person signed in to Productmind can create one.

Create an environment › path Parameters

workspaceId
​string · required

Workspace UUID

Create an environment › Request Body

key
​string · minLength: 2 · maxLength: 16 · pattern: ^[a-z](?:-?[a-z0-9])… · required

The environment's key, which never changes.

name
​string · minLength: 1 · maxLength: 100 · required

The environment's display name.

tier
​string · enum · required

The environment's tier: production or non_production.

Enum values:
production
non_production

Create an environment › Responses

The new environment

​EnvironmentDTO · required

Delete an environment

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

Deletes one of the workspace's own environments that no application maps a branch to. Development and Production cannot be deleted. Only a person signed in to Productmind can delete one.

Delete an environment › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Environment UUID

Delete an environment › Responses

The environment is deleted

No data returned

Rename an environment or change its tier

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

Renames an environment, or changes the tier of one of the workspace's own. Development and Production keep their tier. Only a person signed in to Productmind can change one.

Rename an environment or change its tier › path Parameters

workspaceId
​string · required

Workspace UUID

id
​string · required

Environment UUID

Rename an environment or change its tier › Request Body

name
​string · minLength: 1 · maxLength: 100

The environment's display name.

tier
​string · enum

A custom environment's new tier. Development and Production keep theirs.

Enum values:
production
non_production

Rename an environment or change its tier › Responses

The environment

​EnvironmentDTO · required