API V1
  • Global information
  • Authentication
  • Data format
  • Rate Limit
  • Errors
  • Pagination
RESOURCES
  • Addon providers
  • Addons
  • Alerts
  • Applications
  • Audit Logs
  • Autoscalers
  • Billing
  • Collaborators
  • Container Sizes
  • Cron Tasks
  • Data Access Consents
  • Databases
  • Deployment
  • Domains
  • Environment variables
  • Event Categories
  • Event Types
  • Events
  • Invoices
  • SSH Keys
  • Log Drains
  • Application Logs
  • Metrics
  • Notification Platforms
  • Notifiers
    • Data Sent to the Webhook Endpoint (Non-Slack)
    • List Application Notifiers
    • Add a Notifier
    • Show a Notifier
    • Update a Notifier
    • Test a Notifier
    • Remove a Notifier
  • One-off Containers
  • Operations
  • Projects
  • Referral
  • Regions
  • SCM Integrations
  • Integration Link
  • Sources
  • Stacks
  • Tokens
  • User Account
LINKS
  • Addon Provider API
  • Database API
  • One-click Deployment API
  • scalingo.json Schema
  • Main site
  • Dashboard

Notifier

Notifier attributes

field type description
id string unique ID identifying the notifier
created_at date date of creation of the notifier
updated_at date when was the notifier updated
name string name of the notifier
active boolean is the notifier active or not
type string notifier type
app_id string app reference
platform_id string notification platform used by this notifier
send_all_alerts boolean should the notifier accept all alerts
send_all_events boolean should the notifier accept all events
selected_event_ids []string list of events accepted by this notifier
type_data object notification platform dependant additional data

The type_data Object depends of the platform_id which is used.

Email Platform

field type description
user_ids []string IDs of users (owner and collaborators)
emails []string Additional email addresses

Slack/Webhook/RocketChat Platforms

field type description
webhook_url string URL to send the event payloads

Example object:

{
  "id": "no-824fd8bb-0efe-4b7b-9605-1b98110abeef",
  "name": "My notifier",
  "active": true,
  "type": "slack",
  "platform_id": "5982f145d48c3600273ef089",
  "created_at": "2018-05-14T11:46:42.077+02:00",
  "updated_at": "2019-04-10T20:51:32.298+02:00",
  "send_all_alerts": false,
  "send_all_events": false,
  "selected_event_ids": [],
  "app_id": "53e45e576461730a0c021817",
  "app": "my-app",
  "type_data": {
    "webhook_url": "https://hooks.slack.com/services/AAAAAAAAAAA/BBBBBBBBBBB/cccccddddeeeefffff"
  }
}

Data Sent to the Webhook Endpoint (Non-Slack)

Notifications are app events sent to a custom HTTP endpoint. You can refer to our ‘Events’ documentation to know the notification JSON format.

Example of a deployment notification:

{
  "id": "54dcdd4a73636100011a0000",
  "created_at" : "2015-02-12T18:05:14.226+01:00",
  "user" : {
    "username" : "johndoe",
    "email" : "john@doe.com",
    "id" : "51e6bc626edfe40bbb000001"
  },
  "app_id" : "5343eccd646173000a140000",
  "app_name": "appname",
  "type": "deployment",
  "type_data": {
    "deployment_id" : "5343eccd646aa3012a140230",
    "deployment_type": "deployment",
    "pusher": "johndoe",
    "stack": "scalingo-18",
    "last_commits": {
      "commits": [],
      "remaining": 0
    },
    "git_ref" : "0123456789abcdef",
    "git_ref_url": "https://github.com/johndoe/appname/commit/0123456789abcdef",
    "status": "success",
    "duration": 40,
    "finished_at": "2020-04-16T14:55:05.338+00:00"
  }
}

List Application Notifiers

GET https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers

List all the provisioned notifiers for a given application.

Example

curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X GET https://$SCALINGO_API_URL/v1/apps/example-app/notifiers

Returns 200 OK

{
  "notifiers": [
    {
      "id": "no-824fd8bb-0efe-4b7b-9605-1b98110abeef",
      "name": "My notifier",
      "active": true,
      "type": "slack",
      "platform_id": "5982f145d48c3600273ef089",
      "created_at": "2018-05-14T11:46:42.077+02:00",
      "updated_at": "2019-04-10T20:51:32.298+02:00",
      "send_all_alerts": false,
      "send_all_events": false,
      "selected_event_ids": [],
      "app_id": "53e45e576461730a0c021817",
      "app": "my-app",
      "type_data": {
        "webhook_url": "https://hooks.slack.com/services/AAAAAAAAAAA/BBBBBBBBBBB/cccccddddeeeefffff"
      }
    },
    {
      "id": "no-253ea554-bfe3-419c-aaaa-0bfc5bf51beef",
      "name": "Default 'myapp' notifier",
      "active": true,
      "type": "email",
      "platform_id": "59c52ac27651ce002c1d4620",
      "created_at": "2017-10-30T14:43:15.777+01:00",
      "updated_at": "2018-11-09T14:51:56.515+01:00",
      "send_all_alerts": false,
      "send_all_events": false,
      "selected_event_ids": [
        "59c52a9c7651ce001f62f578"
      ],
      "app_id": "59f72c73fb0de600aaa1234aaa",
      "app": "myapp",
      "type_data": {
        "user_ids": [
          "us-07c2180c-b4b4-123a-1234-fabcdbea"
        ],
        "emails": []
      }
    }
  ]
}

Add a Notifier

POST https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers

Add a notifier to the application.

Parameters

  • notifer.platform_id
  • notifer.name
  • notifer.send_all_alerts (optional)
  • notifer.send_all_events (optional)
  • notifer.type_data (optional)
  • notifer.selected_event_ids (optional)
  • notifer.active (optional)

Deprecated

  • notifier.selected_events: arrays of event names
curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X POST https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers \
  -d '{"notifiers":{"platform_id": "5982f145d48c3600273ef08a", "active": true, "name": "My Custom Webhook", "type_data": {"webhook_url": "https://myapp.fr/webhook/scalingo"}}}'

Returns 201 Created

Show a Notifier

GET https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id]

Example request

curl -H "Accept: application/json" -H "Content-Type: application/json" \
 -H "Authorization: Bearer $BEARER_TOKEN" \
 -X GET https://$SCALINGO_API_URL/v1/apps/myapp/notifiers/no-253ea554-bfe3-419c-aaaa-0bfc5bf51beef

Returns 200 OK

{
  "notifier": {
    "id": "no-253ea554-bfe3-419c-aaaa-0bfc5bf51beef",
    "name": "Default 'myapp' notifier",
    "active": true,
    "type": "email",
    "platform_id": "59c52ac27651ce002c1d4620",
    "created_at": "2017-10-30T14:43:15.777+01:00",
    "updated_at": "2018-11-09T14:51:56.515+01:00",
    "send_all_alerts": false,
    "send_all_events": false,
    "selected_event_ids": [
      "59c52a9c7651ce001f62f578"
    ],
    "app_id": "59f72c73fb0de600aaa1234aaa",
    "app": "myapp",
    "type_data": {
      "user_ids": [
        "us-07c2180c-b4b4-123a-1234-fabcdbea"
      ],
      "emails": []
    }
  }
}

Update a Notifier

PATCH https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id]

Change notifier attributes

Parameters

  • notifier.active
  • notifier.name
  • notifier.send_all_alerts
  • notifier.send_all_events
  • notifier.type_data
  • notifier.selected_event_ids

Deprecated

  • notifier.selected_events: arrays of event names
curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X PATCH https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id] \
  -d '{"notifier": {"type_data": { "webhook_url": "https://myendpoint.com" }, active: "false"}}}'

Returns 200 OK

Test a Notifier

POST https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id]/test

Send a test notification to the notifier

curl -H "Authorization: Bearer $BEARER_TOKEN" \
  -X POST https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id]/test

Remove a Notifier

DELETE https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id]

Request deprovisionning of the notifier.

curl -H "Accept: application/json" -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -X DELETE https://$SCALINGO_API_URL/v1/apps/[:app]/notifiers/[:notifier_id]

Returns 204 No Content