Navigation
You were redirected from a different version of the documentation. Click here to go back.

Create a Configuration for a Third-Party Service Integration

Note

Groups and projects are synonymous terms. Your {PROJECT-ID} is the same as your project id. For existing groups, your group/project id remains the same. This page uses the more familiar term group when referring to descriptions. The endpoint remains as stated in the document.

Base URL: https://cloud.mongodb.com/api/public/v1.0

Syntax

POST /groups/{GROUP-ID}/integrations/{INTEGRATION-TYPE}

Request Path Parameters

Parameter Necessity Description
{PROJECT-ID} Required Project identifier.
{INTEGRATION-TYPE} Required

Third-party service identifier. Accepted values are:

  • PAGER_DUTY
  • SLACK
  • NEW_RELIC
  • OPS_GENIE
  • VICTOR_OPS
  • WEBHOOK
  • PROMETHEUS

Request Query Parameters

Name Type Necessity Description Default
pageNum number Optional One-based integer that returns a subsection of results. 1
itemsPerPage number Optional Number of items to return per page, up to a maximum of 500. 100
pretty boolean Optional Flag that indicates whether the response body should be in a prettyprint format. false
envelope boolean Optional

Flag that indicates whether or not to wrap the response in an envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope : true in the query.

For endpoints that return a list of results, the results object is an envelope. Cloud Manager adds the status field to the response body.

false

Request Body Parameters

The request body should be a single integration view (like a JSON configuration object) for a single third-party service to add to the project. Always include a type property equal to the third-party service INTEGRATION_TYPE.

Service Configuration Options
PagerDuty

You must provide the following fields when you configure a PagerDuty integration:

Property Description
type PAGER_DUTY
serviceKey

Your Service Key.

Note

All new PagerDuty keys use their Events API v2. If you have an Events API v1 key, you can continue to use that key with Cloud Manager.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.
Slack

Important

Slack integrations now use the OAuth2 verification method and must be initially configured, or updated from a legacy integration, through the MongoDB Atlas third-party service integrations page.

Legacy tokens will soon no longer be supported.

You must provide the following fields when you reconfigure an existing Slack integration:

Property Description
type SLACK
apiToken

Your API Token.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.
teamName Your team name.

You may also include the following fields:

Property Description
channelName The channel name to reconfigure.
Opsgenie

You must provide the following fields when you configure a Opsgenie integration:

Property Description
type OPS_GENIE
apiKey

Your API Key.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.
region Indicates which API URL to use, either US or EU. Opsgenie defaults to US.
VictorOps

You must provide the following fields when you configure a VictorOps integration:

Property Description
type VICTOR_OPS
apiKey

Your API Key.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.

You may also include the following fields:

Property Description
routingKey An optional field for your Routing Key.
Webhook Settings

You must provide the following fields when you configure webhook settings:

Property Description
type WEBHOOK
url Your webhook URL.

You may also include the following fields:

Property Description
secret

An optional field for your webhook secret.

Note

After creating a webhook notification, the URL will appear partially redacted when you view or edit the alert, and the secret will appear completely redacted.

Microsoft Teams

You must provide the following fields when you configure a Microsoft Teams integration:

Property Description
type MICROSOFT_TEAMS
microsoftTeamsWebhookUrl

Your Microsoft Teams incoming webhook URL.

Note

When you view or edit the alert for a webhook notification, the URL appears partially redacted, and the secret appears completely redacted.

Prometheus

You must provide the following fields when you configure a Prometheus integration:

Property Description
type PROMETHEUS
username Your Prometheus username.
password Your Prometheus password.
listenAddress The IP address and port your Prometheus instance will reach out to.
serviceDiscovery Indicates which service discovery method is used, either file or http.
scheme Your Prometheus protocol scheme configured for requests, either http or https. If you configure https, you must specify tlsPemPath.
enabled Whether your cluster has Prometheus enabled.

You may also include the following fields:

Property Description
tlsPemPassword An optional field for the password to your PEM file.
tlsPemPath An optional field for the absolute path to your PEM file.

Response Elements

The response includes a results array which lists all third-party integration configurations for the project as objects, and a totalCount of the services integrated with the project.

Each third-party integration configuration object includes a type property equal to its own integration type ("type": "PAGER_DUTY" for the PagerDuty service). Additionally, each third-party service configuration object provides details specific to that service. The following lists the properties returned for each third-party service configuration object:

Service Result
PagerDuty

A returned PagerDuty integration configuration object contains the following fields:

Property Description
type PAGER_DUTY
serviceKey

Your Service Key.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.
Slack

A returned Slack integration configuration object contains the following fields:

Property Description
type SLACK
apiToken

Your API Token.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.
teamName Your team name. This field may not be present with a legacy Slack integration.
channelName The configured Slack channel name. An empty string if the value is not set.
Opsgenie

A returned Opsgenie integration configuration object contains the following fields:

Property Description
type OPS_GENIE
apiKey

Your API Key.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.
region Indicates which API URL to use, either US or EU. Opsgenie defaults to US.
VictorOps

A returned VictorOps integration configuration object contains the following fields:

Property Description
type VICTOR_OPS
apiKey

Your API Key.

Note

After you create a third-party integration that requires an API or integration key, the key appears partially redacted when you:

  • View or edit the alert through the UI.
  • Query the third-party integration settings through the API.

The configuration object may also contain the following fields, depending on your configuration:

Property Description
routingKey An optional field returned if you have a Routing Key configured.
Webhook Settings

A returned webhook configuration object contains the following fields:

Property Description
type WEBHOOK
url

Your webhook URL.

Note

After creating a webhook notification, the URL will appear partially redacted when you view or edit the alert, and the secret will appear completely redacted.

The configuration object may also contain the following fields, depending on your configuration:

Property Description
secret An optional field returned if your webhook is configured with a secret.
Microsoft Teams

A returned Microsoft Teams configuration object will contain the following fields:

Property Description
type MICROSOFT_TEAMS
microsoftTeamsWebhookUrl

Your Microsoft Teams incoming webhook URL.

Note

When you view or edit the alert for a webhook notification, the URL appears partially redacted, and the secret appears completely redacted.

Prometheus

A returned Prometheus configuration object will contain the following fields:

Property Description
type PROMETHEUS
username Your Prometheus username.
listenAddress The IP address and port your Prometheus instance will reach out to.
serviceDiscovery Indicates which service discovery method is used, either file or http.
scheme Your Prometheus protocol scheme configured for requests, either http or https. If you configure https, you must specify tlsPemPath.
enabled Whether your cluster has Prometheus enabled.

The configuration object may also contain the following fields, depending on your configuration:

Property Description
tlsPemPassword An optional field returned if you have a password for your PEM file.
tlsPemPath An optional field returned if you have an absolute path to your PEM file.

Example Request

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
     --header "Accept: application/json" \
     --header "Content-Type: application/json" \
     --include \
     --request POST "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/integrations/SLACK" \
     --data '
     {
       "type": "SLACK",
       "apiToken": "1234567890",
       "teamName": "My Team"
     }'

Example Response

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
{
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/integrations/SLACK?pageNum=1&itemsPerPage=100",
      "rel": "self"
    }
  ],
  "results": [
    {
      "serviceKey": "******7890",
      "type": "PAGER_DUTY"
    },
    {
      "apiToken": "******7890",
      "channelName": "My Channel",
      "teamName": "My Team",
      "type": "SLACK"
    }
  ],
  "totalCount": 2
}