Sign in Start for free

Branches

Request the list of Branches for a given Project

GET /api/{spaceId}/projects/{projectId}/git/branches

Also reachable at /api/projects/{projectId}/git/branches, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/branches.

Path Parameters

  • projectId string (required)
    ID of the project.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Query Parameters

  • searchByName string
    A partial or complete name to search on. This will perform a “contains” style match against the supplied name or name-fragment.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 30. Minimum 0.

Response

200 — The requested list of Branches

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • CanonicalName string
      Minimum length 1.
    • Id string
      Gets or sets a unique identifier for this resource.
    • IsProtected boolean
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Name string
      Minimum length 1.
  • ItemsPerPage integer
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastPageNumber integer
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "Id": "string",
  "ItemType": "string",
  "Items": [
    {
      "CanonicalName": "string",
      "Id": "string",
      "IsProtected": true,
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Name": "string"
    }
  ],
  "ItemsPerPage": 0,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastPageNumber": 0,
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "NumberOfPages": 0,
  "TotalResults": 0
}

Create a branch given a project, the base git ref, and the new branch’s name

POST /api/{spaceId}/projects/{projectId}/git/branches/v2

Also reachable at /api/projects/{projectId}/git/branches/v2, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/branches/v2.

Path Parameters

  • projectId string (required)
  • spaceId string (required)
    The ID of the space containing the resource(s).

Request Body

  • BaseGitRef string (required)
  • NewBranchName string (required)
    Minimum length 1.
  • ProjectId string (required)
  • SpaceId string (required)
    The ID of the space containing the resource(s).

Response

200 — The newly-created Branch

  • CanonicalName string
    Minimum length 1.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsProtected boolean
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Minimum length 1.

Example Request

JSON
{
  "BaseGitRef": "string",
  "NewBranchName": "string",
  "ProjectId": "Projects-1",
  "SpaceId": "Spaces-1"
}

Example Response

JSON
{
  "CanonicalName": "string",
  "Id": "string",
  "IsProtected": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string"
}

Get a Git branch by name

GET /api/{spaceId}/projects/{projectId}/git/branches/{branchName}

Also reachable at /api/projects/{projectId}/git/branches/{branchName}, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/branches/{branchName}.

Gets a named version control branch for a project.

Path Parameters

  • branchName string (required)
    Name of the branch.
  • projectId string (required)
    ID of the project.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Response

200 — The requested Branch

  • CanonicalName string
    Minimum length 1.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsProtected boolean
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Minimum length 1.

Example Response

JSON
{
  "CanonicalName": "string",
  "Id": "string",
  "IsProtected": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string"
}

Get a Git commit by hash

GET /api/{spaceId}/projects/{projectId}/git/commits/{hash}

Also reachable at /api/projects/{projectId}/git/commits/{hash}, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/commits/{hash}.

Gets a git commit for a project.

Path Parameters

  • hash string (required)
    Hash of the commit.
  • projectId string (required)
    ID of the project.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Response

200 — The requested Commit

  • CanonicalName string
    Minimum length 1.
  • Id string
    Gets or sets a unique identifier for this resource.
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Minimum length 1.

Example Response

JSON
{
  "CanonicalName": "string",
  "Id": "string",
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string"
}

Get a Git named reference by name

GET /api/{spaceId}/projects/{projectId}/git/refs/{refName}

Also reachable at /api/projects/{projectId}/git/refs/{refName}, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/refs/{refName}.

Gets a named version control reference for a project.

Path Parameters

  • projectId string (required)
    ID of the project.
  • refName string (required)
    Name of the git reference.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Response

200 — The requested Named Git Reference

  • CanonicalName string
    Minimum length 1.
  • Id string
    Gets or sets a unique identifier for this resource.
  • IsProtected boolean
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Minimum length 1.

Example Response

JSON
{
  "CanonicalName": "string",
  "Id": "string",
  "IsProtected": true,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string"
}

Request a list of Git Tags for the project

GET /api/{spaceId}/projects/{projectId}/git/tags

Also reachable at /api/projects/{projectId}/git/tags, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/tags.

Path Parameters

  • projectId string (required)
    ID of the project.
  • spaceId string (required)
    The ID of the space containing the resource(s).

Query Parameters

  • searchByName string
    A partial or complete name to search on. This will perform a “contains” style match against the supplied name or name-fragment.
  • skip integer
    Number of items to skip. Defaults to zero. Minimum 0.
  • take integer
    Number of items to take. Defaults to 30. Minimum 0.

Response

200 — The requested Git Tags

  • Id string
    Gets or sets a unique identifier for this resource.
  • ItemType string
  • Items array of object
    • CanonicalName string
      Minimum length 1.
    • Id string
      Gets or sets a unique identifier for this resource.
    • LastModifiedBy string
      Gets or sets the username of the user who last modified this resource.
    • LastModifiedOn string
      Gets or sets the date/time that this resource was last modified. Format date-time.
    • Links object
      Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
    • Name string
      Minimum length 1.
  • ItemsPerPage integer
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • LastPageNumber integer
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • NumberOfPages integer
  • TotalResults integer

Example Response

JSON
{
  "Id": "string",
  "ItemType": "string",
  "Items": [
    {
      "CanonicalName": "string",
      "Id": "string",
      "LastModifiedBy": "string",
      "LastModifiedOn": "2020-01-01T00:00:00.000Z",
      "Links": {
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      },
      "Name": "string"
    }
  ],
  "ItemsPerPage": 0,
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "LastPageNumber": 0,
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "NumberOfPages": 0,
  "TotalResults": 0
}

Get an individual Git Tag; searching for it by Name

GET /api/{spaceId}/projects/{projectId}/git/tags/{tagName}

Also reachable at /api/projects/{projectId}/git/tags/{tagName}, /api/spaces/{spaceIdentifier}/projects/{projectId}/git/tags/{tagName}.

Path Parameters

  • projectId string (required)
    ID of the project.
  • spaceId string (required)
    The ID of the space containing the resource(s).
  • tagName string (required)
    Name of the tag.

Response

200 — The requested Tag

  • CanonicalName string
    Minimum length 1.
  • Id string
    Gets or sets a unique identifier for this resource.
  • LastModifiedBy string
    Gets or sets the username of the user who last modified this resource.
  • LastModifiedOn string
    Gets or sets the date/time that this resource was last modified. Format date-time.
  • Links object
    Gets or sets a dictionary of links to other related resources. These links can be used to navigate the resources on the server.
  • Name string
    Minimum length 1.

Example Response

JSON
{
  "CanonicalName": "string",
  "Id": "string",
  "LastModifiedBy": "string",
  "LastModifiedOn": "2020-01-01T00:00:00.000Z",
  "Links": {
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "Name": "string"
}