Productmind API

Git covers the repositories your workspace reaches through a connected Git provider, such as GitHub. List a repository's branches, with your workspace's development branch marked as the default. After you reinstall a Git provider or change Productmind's access, repair repository links so your applications, sessions, releases and channel notifications use the current connection, and see which repositories it still can't reach. See Integrations.


List remote branches for a workforce-known git repository

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

Proxies workforce's list_branches action on the repository's connector instance. Used by the session detail Code widget to populate the source-branch picker. The isDefault flag marks the branch whose name matches the workspace's git.developmentBranch setting.

List remote branches for a workforce-known git repository › path Parameters

workspaceId
​string · required

Workspace UUID

List remote branches for a workforce-known git repository › query Parameters

provider
​string · minLength: 1 · required

Provider slug (github, gitlab, bitbucket)

externalRepoId
​string · minLength: 1 · required

Vendor-side repository id

connectorId
​string

Ignored - the server derives the connector instance from the repository's own record

repoUrl
​string · maxLength: 1024

The repository's URL, which names its server: two GitLab servers can both have a project with this id. Without it, the repository is found by id alone when only one server has it.

repoName
​string

Ignored - the server derives the repository name from its own record

List remote branches for a workforce-known git repository › Responses

200

Branches available on the remote

​GitBranchDTO[] · required

Check which repositories have a branch

GET
https://api.productmind.ai
/workspaces/{workspaceId}/git/branches/presence

For each of up to 50 of the workspace's repositories, whether it has the named branch. exists is null where the repository's branches could not be read. A repository the workspace cannot reach is left out of the answer. Used to choose each repository's default branch when picking repositories to scan.

Check which repositories have a branch › path Parameters

workspaceId
​string · required

Workspace UUID

Check which repositories have a branch › query Parameters

branch
​string · maxLength: 256 · required

The branch to look for

repos
​string · minLength: 1 · required

The repositories to check: a comma-separated list of repository keys, at most 50. A key is <provider>:<externalRepoId>, or gitlab@<host>:<externalRepoId> for a project on a GitLab server other than gitlab.com (the host with its port, when it has one)

Check which repositories have a branch › Responses

200

One entry per repository the workspace can reach

​GitBranchPresenceDTO[] · required

Check what a git connection can do on each application's repository

GET
https://api.productmind.ai
/workspaces/{workspaceId}/git/connections/{instanceId}/access

For the workspace's git connection named by instanceId, the account every repository action runs as and, for each application whose repository uses the connection, whether that account can read it, push a session's branch, open a merge request, and merge into the base branch (and if not, the lowest role that may). GitLab connections only for now: another provider answers supported: false. A connection the provider refuses outright answers with error.code (gitlab_connection_refused) and no verdicts.

Check what a git connection can do on each application's repository › path Parameters

workspaceId
​string · required

Workspace UUID

instanceId
​string · required

The connection's id

Check what a git connection can do on each application's repository › Responses

200

The connection's account and a verdict per repository

​GitConnectionAccess · required

List the merge request webhook of each project a git connection's applications use

GET
https://api.productmind.ai
/workspaces/{workspaceId}/git/connections/{instanceId}/webhooks

For the workspace's git connection named by instanceId, each GitLab project an application uses through it, those applications, and the project's merge request webhook as GitLab answers: present (it delivers to this connection), stale (it delivers to a connection of this workspace that was replaced), missing, or what stopped GitLab answering (no_permission: the connection's account cannot manage the project's webhooks, it takes Maintainer, so the webhook is added by hand; not_found; failed). disabled marks a webhook GitLab turned off after failed deliveries. Reads only. GitLab connections only: another provider answers supported: false. A connection GitLab refuses outright answers with error.code (gitlab_connection_refused) and its projects unchecked.

List the merge request webhook of each project a git connection's applications use › path Parameters

workspaceId
​string · required

Workspace UUID

instanceId
​string · required

The connection's id

List the merge request webhook of each project a git connection's applications use › Responses

200

Each project and its webhook

​GitConnectionWebhooks · required

Add or re-point the merge request webhook of each project a git connection's applications use

POST
https://api.productmind.ai
/workspaces/{workspaceId}/git/connections/{instanceId}/webhooks

Through the workspace's GitLab connection named by instanceId, makes each project's merge request webhook current: a missing one is added (merge request events only, SSL verification on, named Productmind), a stale one is moved onto this connection, and a present one is given Productmind's secret again. The secret is one Productmind keeps for the workspace, set as both the signing token and the secret token; it is listed among the webhook's secrets. Nothing is removed. A project whose webhooks the connection's account cannot manage answers no_permission and is added by hand. Answers the same list as the GET, with added and repointed where something changed.

Add or re-point the merge request webhook of each project a git connection's applications use › path Parameters

workspaceId
​string · required

Workspace UUID

instanceId
​string · required

The connection's id

Add or re-point the merge request webhook of each project a git connection's applications use › Request Body

Add or re-point the merge request webhook of each project a git connection's applications use › Responses

200

Each project and its webhook, as it was left

​GitConnectionWebhooks · required

Repoint stored connector-instance ids at the live instances

POST
https://api.productmind.ai
/workspaces/{workspaceId}/git/connector-rebind

Workforce's ConnectorInstance.id is a per-row UUID: disconnecting a provider hard-deletes the row and reconnecting mints a new one, so every id Productmind snapshotted (Application repository blobs, session git-repository rows, release application snapshots, notification-channel subscriptions) starts 404-ing. This pass resolves each repository by its durable identity (its provider, its server and its repository id) and rewrites the stored id. Idempotent and cheap: fire it after any connector connect or disconnect. A repository no connected provider can currently serve keeps its existing id and is returned in unresolved rather than being rebound onto a connector that cannot see it. Then, on each live GitLab workspace connection, the merge request webhook of each project its applications use that still delivers to a replaced connection is moved onto it (webhooks).

Repoint stored connector-instance ids at the live instances › path Parameters

workspaceId
​string · required

Workspace UUID

Repoint stored connector-instance ids at the live instances › Request Body

Repoint stored connector-instance ids at the live instances › Responses

200

Rebind complete

​GitConnectorRebindResult · required