Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

List branches in a project

GET/v1/projects/{projectId}/branchesList branches in a project

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

Returns the live Branches of a Project. Supports two mutually exclusive filters: ?gitName= (exact match — at most one row), ?gitNameContains= (case-sensitive substring). Soft-deleted Branches are not returned. Ordered by createdAt ascending.

Parameters

projectIdstringpathrequired

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

cursornull | stringquery

Cursor for pagination

limitnumberquery

Limit for pagination

default 100

gitNamestringquery

minLength 1

gitNameContainsstringquery

minLength 1

Responses

200Returned the list of Branches.application/json
object
dataarray of objectrequired
Show child attributes
Show array items
createdAtstring · date-timerequired
gitNamestringrequired
idstringrequired

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

isDefaultbooleanrequired
projectobjectrequired

Thin reference to the parent Project. Member resources are intentionally NOT inlined — list /v1/databases?branchId=<br_xxx> or /v1/apps?branchId=<br_xxx> instead (see API design principles "Flat and Hierarchical Coexistence").

Show child attributes
idstringrequired
namestringrequired
urlstring · urirequired
rolestringrequired

one of "production", "preview"

typestringrequired

const "branch"

updatedAtstring · date-timerequired
urlstring · urirequired
paginationobjectrequired
Show child attributes
hasMorebooleanrequired
nextCursornull | stringrequired
Example response
{
  "data": [
    {
      "createdAt": "2026-06-09T00:00:00Z",
      "gitName": "string",
      "id": "string",
      "isDefault": true,
      "project": {
        "id": "string",
        "name": "string",
        "url": "https://example.com"
      },
      "role": "preview",
      "type": "branch",
      "updatedAt": "2026-06-09T00:00:00Z",
      "url": "https://example.com"
    }
  ],
  "pagination": {
    "hasMore": true,
    "nextCursor": "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"
  }
}
404Project not found.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
422Mutually exclusive filters specified together.application/json
object
errorobjectrequired
Show child attributes
codestringrequired
hintstring
messagestringrequired
Example response
{
  "error": {
    "code": "string",
    "hint": "string",
    "message": "string"
  }
}
Documentation menu