Skip to main content
Skip table of contents

REST APIs for Slack notifications for Bitbucket app

The REST APIs are primary for the internal use and can be changed without notice.

Slack notifications for Bitbucket REST APIs

Slack notifications for Bitbucket provides the following endpoints:

  1. Get all configurations

    CODE
    GET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations

    Permission: Global admin permissions are required.

  2. Get configurations for a project

    CODE
    GET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations?projectKey=PROJECT_KEY

Permission: Global or project admin permissions are required.

  1. Get configurations for the repository

    CODE
    GET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations?projectKey=PROJECT_KEY&repositorySlug=REPOSITORY_SLUG

Permission: Global, project or repository admin permissions are required.

  1. Get configuration by ID

    CODE
    GET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations/ID

    Permission: Global, project or repository admin permissions are required.

  2. Create new configuration

    CODE
    POST <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations

    Permission: Admin on the level (global, project, repository) the configuration is created.

  3. Update configuration by ID

    CODE
    PUT GET <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations/ID

Permission: Admin on the level (global, project, repository) the configuration is created.

  1. Delete configuration by ID

    CODE
    DELETE <BITBUCKET_BASE_URL>/rest/mwf-slack/1.0/configurations/ID

Permission: Admin on the level (global, project, repository) the configuration is created.

Configuration scheme

CODE
{
   "id": integer, 
   "enabled":boolean,
   "lastModified":long, //readonly timestamp
   "destinations":[
      {
         "url": string, // URL
         "slackUserName":string,
         "channelName":string,
         "channelSource": enum, // "FROM" or "TO"
         "slackApi":enum, //"WEBHOOK", "OAUTH"
         "token":string,
         "tenantId": string,
         "channelId": string
      }
   ],
   "users":[
      string  // usernames
   ],
   "ignoredUsers":[
      string  // usernames
   ],
   "groups":[
      string  // user groups
   ],
   "ignoredGroups":[
      string  // user groups
   ],
   "projectKey": string, // project key
   "repositorySlug": string, // optional repository slug
   "eventTypes":[
      enum // "PULL_REQUEST_ACTIVITY", "REPOSITORY_PUSH", "BUILD_STATUS_SET"
   ],
   "pullRequestBranchSource": enum, // "FROM" or "TO"
   "overrideEnabled": boolean,
   "notificationLevel": enum, // "VERBOSE", "COMPACT", "MINIMAL"
   "notificationPrLevel": enum, // "VERBOSE", "COMPACT", "MINIMAL"
   "slackIconUrl": string,
   "slackIconEmoji": string,
   "pullRequestActions":[
      enum // "OPENED", "REOPENED","UPDATED","APPROVED","UNAPPROVED","DECLINED","MERGED","COMMENTED","REVIEWED"
   ],
   "pullRequestReviewersAdded":boolean,
   "pullRequestReviewersRemoved":boolean,
   "enabledForPersonal":boolean,
   "alwaysAddPrReviewers":boolean,
   "level": enum, //readonly "REPOSITORY", "REPOSITORY", "GLOBAL"
}

Updated:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.