Last updated Jul 16, 2025

Branch

The Branch object type represents a branch object within a repository. atlassian:branch should be used to ingest branch-specific fields.

Payload structure

1
2
  object
  ├─ schemaVersion (string) [Required]
  ├─ id (string) [Required]
  ├─ updateSequenceNumber (long) [Required]
  ├─ displayName (string) [Required]
  ├─ description (string) [Optional]
  ├─ url (string) [Required]
  ├─ createdAt (string) [Required]
  └─ createdBy  [Optional]
      ├─ accountId (string)
      └─ ari (string)
  └─ lastUpdatedAt (string) [Required]
  └─ lastUpdatedBy [Required]
      ├─ accountId (string)
      └─ ari
  └─ containerKey [Optional]
      ├─ type
      ├─ value
      └─ repositoryId
  └─ permissions [] [Required]
      └─ accessControls
         └─ principals
            └─type
  └─ associations [] [Optional]
      ├─ associationType (string)
      └─ values []
      
  atlassian:branch
  ├─ name (string) [Optional]
  └─ lastCommit [Optional]
     ├─ id (string) [Required]
     ├─ displayId (string) [Optional]
     ├─ authorTimestamp (string) [Optional]
     └─ message (string) [Optional]
  └─ createPullRequestUrl (string) [Optional]

You may send the container repository as a separate entity in the same payload or in a separate request.

Common properties

PropertyTypeRequiredDescription
schemaVersion

string

YesThe schema version of the object.
id

string

YesThe ID of the object in the source system.
updateSequenceNumberlongYesA sequence number to compare when writing to the database. Objects are written following a last write wins strategy, therefore an object with a greater UpdateSequenceNumber is considered a more recently updated object.
displayNamestringYesThe display name of the object.
descriptionstringNoThe description of the object.
urlstringYesThe URL from the provider which the object is accessible from.
createdAtstringYes

The date the object was created.

Format: Instant (ISO8601 / RFC3339)

createdByuserNo

The user that created the object.

See User to learn more.

lastUpdatedAtstringYes

The date the object was last updated.

Format: Instant (ISO8601 / RFC3339)

lastUpdatedByuserNo

The user that last updated the object.

See User to learn more.

ownerslist<User>NoList of users that own the object.
thumbnailthumbnailNo

The thumbnail of the object.

See Thumbnail to learn more.

parentKeyentityKeyNo

The ID of the parent object. If null, it is a standalone object.

See Entity key to learn more.

containerKeyentityKeyYes

The container identifier that this object belongs to.

See Entity key to learn more.

permissionslist<Permissions>Yes

The permissions configuration of the object.

See Permissions to learn more.

associationsassociationNo

List of objects associated with the object. Generally used to link an external object to a Atlassian object.

See Association to learn more.

Branch properties

PropertyTypeRequiredDescription
name

string

No

The name of the branch.

Maximum length: 255

lastCommit

Commit

No

Information about the last commit on this branch.

createPullRequestUrlstringNo

URL to create a pull request from this branch.

Example payload

1
2
{
  "objects" : [ {
    "id" : "repo-1",
    "updateSequenceNumber" : 1,
    "displayName" : "My Repository",
    "description" : "This is a test repository",
    "url" : "https://bitbucket.org/myproject/myrepo/src/master/",
    "lastUpdatedAt" : "2023-07-19T15:27:37.000Z",
    "atlassian:repository" : {
      "forkOf" : "repo-2",
      "avatar" : "avatar.png",
      "avatarDescription" : "something cool idk"
    }
  }, {
    "id" : "branch-1",
    "updateSequenceNumber" : 1,
    "displayName" : "SAI-123-a-branch",
    "description" : "A working branch",
    "url" : "https://bitbucket.org/myproject/myrepo/src/master/",
    "lastUpdatedAt" : "2023-07-19T15:27:37.000Z",
    "containerKey" : {
      "type" : "atlassian:repository",
      "value" : {
        "repositoryId" : "repo-1"
      }
    },
    "atlassian:branch" : {
      "createPullRequestUrl" : "https://url.com",
      "lastCommit" : {
        "id" : "commit-1",
        "updateSequenceNumber" : 1,
        "displayName" : "deadbeef",
        "description" : "SAI-123 A commit that fixes things",
        "url" : "https://bitbucket.org/myproject/myrepo/src/master/",
        "lastUpdatedAt" : "2023-07-19T15:27:37.000Z",
        "containerKey" : {
          "type" : "atlassian:repository",
          "value" : {
            "repositoryId" : "repo-1"
          }
        },
        "owners" : [ {
          "externalId" : "external-id-1",
          "email" : "user@userdomain.com"
        } ],
        "atlassian:commit" : {
          "flags" : [ "MERGE_COMMIT" ],
          "fileCount" : 34,
          "files" : [ {
            "path" : "a/b/c",
            "url" : "https://url.com/a/b/c",
            "changeType" : "ADDED",
            "linesAdded" : 23,
            "linesRemoved" : 0
          } ]
        }
      }
    }
  } ],
  "operationType" : "NORMAL"
}

Rate this page: