Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

Link a source repository to a project

POST/v1/source-repositoriesLink a source repository to a project

⚠️ Experimental endpoint: this API is in active development and may change at any time without notice. ⚠️

Links a GitHub repository to a Prisma project via an existing SCM installation.

Request body

application/json
object
installationIdstring

Optional SCM installation ID to use for linking. When omitted, the API auto-picks the workspace's installation.

pattern ^(scminstall_)?([cC][^\s-]{8,}|[a-z0-9]+)$

projectIdstringrequired

pattern ^(proj_)?([cC][^\s-]{8,}|[a-z0-9]+)$

providerstringrequired

const "github"

providerRepositoryIdintegerrequired

exclusiveMinimum 0

Example request
{
  "installationId": "string",
  "projectId": "string",
  "provider": "github",
  "providerRepositoryId": 0
}

Responses

201Source repository linked.application/json
object
dataobjectrequired
Show child attributes
createdAtstring · date-timerequired
defaultBranchstringrequired
idstringrequired

pattern ^(srcrepo_)([cC][^\s-]{8,}|[a-z0-9]+)$

installationIdstringrequired
isPrivatebooleanrequired
projectIdstringrequired
providerstringrequired

one of "github"

repoFullNamestringrequired
repoIdintegerrequired
statusstringrequired

one of "active", "archived"

typestringrequired

const "source-repository"

updatedAtstring · date-timerequired
urlstring · urirequired
hintstring
Example response
{
  "data": {
    "createdAt": "2026-06-09T00:00:00Z",
    "defaultBranch": "string",
    "id": "string",
    "installationId": "string",
    "isPrivate": true,
    "projectId": "string",
    "provider": "github",
    "repoFullName": "string",
    "repoId": 0,
    "status": "active",
    "type": "source-repository",
    "updatedAt": "2026-06-09T00:00:00Z",
    "url": "https://example.com"
  },
  "hint": "string"
}
401Missing or invalid authorization token.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
403SCM installation is suspended, uninstalled, or actor lacks access.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
404Project or SCM installation not found.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
409Repository or project already linked.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
422Repository not accessible to the installation.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu