NAV Navbar
shell

Introduction

Welcome to the Amixr Incident Management API!

We are always happy to help online in chat and in GitHub issues.

Also please be aware about Rate Limits.

Simplified API Structure

Amixr API Scheme

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
  --header "Authorization: meowmeowmeow"

Make sure to replace meowmeowmeow with your API key. Or use meowmeowmeow for test purposes.

Amixr uses API keys to allow access to the API. You can request a new Amixr API key here.

API key is specific for a User and a Team. That means that you should request the different API Key if you want to switch the team you are working with.

Amixr expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: meowmeowmeow

Pagination

List endpoints such as “List Integrations” or “List Incidents” return multiple objects. Amixr API return them in pages. Please note that the page size may vary.

Parameter Meaning
count The total number of items. It can be 0 if a request does not return any data.
next A link to the next page. It can be null if the next page does not contain any data.
previous A link to the previous page. It can be null if the previous page does not contain any data.
results The data list. Can be [] if a request does not return any data.

- Users

Get User

curl "https://amixr.io/api/v1/users/current/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured like this:

{
    "id": "U4DNY931HHJS5",
    "team_id": "TCNPY4A1BWUMP",
    "email": "public-api-demo-user-1@amixr.io",
    "slack": [
        {
            "user_id": "UALEXSLACKDJPK",
            "team_id": "TALEXSLACKDJPK"
        }
    ],
    "name": "Alex",
    "role": "admin"
}

This endpoint retrieves the user object.

HTTP Request

GET https://amixr.io/api/v1/users/<USER_ID>/

Parameter Unique Description
id Yes/team User ID
team Yes Team ID
email Yes/team User E-Mail
slack Yes/team List of user ID's from connected Slack. User linking key is e-mail.
name No User name
role No Options: "user", "observer", "admin". Read more about user statuses here.

List Users

curl "https://amixr.io/api/v1/users/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured like this:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "U4DNY931HHJS5",
            "team_id": "TCNPY4A1BWUMP",
            "email": "public-api-demo-user-1@amixr.io",
            "slack": [
                {
                    "user_id": "UALEXSLACKDJPK",
                    "team_id": "TALEXSLACKDJPK"
                }
            ],
            "name": "Alex",
            "role": "admin"
        }
    ]
}

This endpoint retrieves all users.

HTTP Request

GET https://amixr.io/api/v1/users/

Update User

curl "https://amixr.io/api/v1/users/U4DNY931HHJS5/" \
  --request PUT \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "name":"Alex",
      "role":"admin"
  }'

The above command returns JSON structured like this:

{
    "id": "U4DNY931HHJS5",
    "team_id": "TCNPY4A1BWUMP",
    "email": "public-api-demo-user-1@amixr.io",
    "slack": [
        {
            "user_id": "UALEXSLACKDJPK",
            "team_id": "TALEXSLACKDJPK"
        }
    ],
    "name": "Alex",
    "role": "admin"
}

This endpoint allows to update user.

Parameter Unique Required
name No Optional
role No Optional

HTTP Request

PUT https://amixr.io/api/v1/users/<USER_ID>/

- Integrations

Create Integration

curl "https://amixr.io/api/v1/integrations/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "type":"grafana"
  }'

The above command returns JSON structured like this:

{
    "id": "CFRPV98RPR1U8",
    "name": "Grafana :blush:",
    "link": "https://app.amixr.io/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
    "incidents_count": 1,
    "type": "grafana",
    "default_route_id": "RVBE4RKQSCGJ2",
    "templates": {
        "grouping_key": "",
        "resolve_signal": "",
        "slack": {
            "title": "",
            "message": "",
            "image_url": ""
        }
    }
}

Integrations are sources of alerts and incidents for Amixr. For example check how to integrate Amixr with AlertManager in our docs.

HTTP Request

POST https://amixr.io/api/v1/integrations/

Get Integration

curl "https://amixr.io/api/v1/integrations/CFRPV98RPR1U8/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured like this:

{
    "id": "CFRPV98RPR1U8",
    "name": "Grafana :blush:",
    "link": "https://app.amixr.io/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
    "incidents_count": 1,
    "type": "grafana",
    "default_route_id": "RVBE4RKQSCGJ2",
    "templates": {
        "grouping_key": "",
        "resolve_signal": "",
        "slack": {
            "title": "",
            "message": "",
            "image_url": ""
        }
    }
}

This endpoint retrieves an integration. Integrations are sources of alerts and incidents for Amixr. For example check how to integrate Amixr with AlertManager in our docs.

HTTP Request

GET https://amixr.io/api/v1/integrations/<INTEGRATION_ID>/

List Integrations

curl "https://amixr.io/api/v1/integrations/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured like this:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "CFRPV98RPR1U8",
            "name": "Grafana :blush:",
            "link": "https://app.amixr.io/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
            "incidents_count": 3,
            "type": "grafana",
            "default_route_id": "RVBE4RKQSCGJ2",
            "templates": {
                "grouping_key": "",
                "resolve_signal": "",
                "slack": {
                    "title": "",
                    "message": "",
                    "image_url": ""
                }
            }
        }
    ]
}

HTTP Request

GET https://amixr.io/api/v1/integrations/

Update Integration

curl "https://amixr.io/api/v1/integrations/CFRPV98RPR1U8/" \
  --request PUT \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "templates": {
          "grouping_key": "",
          "resolve_signal": "",
          "slack": {
             "title": "",
             "message": "",
             "image_url": ""
          }
      }
  }'

The above command returns JSON structured like this:

{
    "id": "CFRPV98RPR1U8",
    "name": "Grafana :blush:",
    "link": "https://app.amixr.io/integrations/v1/grafana/mReAoNwDm0eMwKo1mTeTwYo/",
    "incidents_count": 1,
    "type": "grafana",
    "default_route_id": "RVBE4RKQSCGJ2",
    "templates": {
        "grouping_key": "",
        "resolve_signal": "",
        "slack": {
           "title": "",
           "message": "",
           "image_url": ""
        }
    }
}

HTTP Request

PUT https://amixr.io/api/v1/integrations/<INTEGRATION_ID>/

Delete Integration

curl "https://amixr.io/api/v1/integrations/CFRPV98RPR1U8/" \
  --request DELETE \
  --header "Authorization: meowmeowmeow"

Integration removal won't trigger removal of related Incidents or Alerts. Deleted integration will stop recording new Alerts from monitoring.

HTTP Request

DELETE https://amixr.io/api/v1/integrations/<INTEGRATION_ID>/

- Routes

Create Route

curl "https://amixr.io/api/v1/routes/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "integration_id": "CFRPV98RPR1U8",
      "routing_regex": "us-(east|west)",
      "position": 0,
      "slack": {
        "channel_id": "CH23212D"
      }
  }'

The above command returns JSON structured like this:

{
    "id": "RIYGUJXCPFHXY",
    "integration_id": "CFRPV98RPR1U8",
    "routing_regex": "us-(east|west)",
    "position": 0,
    "is_the_last_route": false,
    "slack": {
        "channel_id": "CH23212D"
    }
}

Routes allow to direct different alerts to different messenger channels and Escalation Policies. Useful for:

Parameter Unique Required Description
integration_id No Yes Each Route is assigned to a specific Integration.
routing_regex Yes Yes Python Regex query (use https://regex101.com/ for debugging). Amixr choose the route for an alert in case there is a match inside the whole alert payload.
position Yes Optional Route matching is performed one after another starting from position=0. Position=-1 will put the Route to the end of the list before is_the_last_route. The new Route created with a position of already existing route will move the old Route (and all following) down in the list.
slack Yes Optional Dictionary with slack-specific settings for a route.

HTTP Request

POST https://amixr.io/api/v1/routes/

Get Route

curl "https://amixr.io/api/v1/routes/RIYGUJXCPFHXY/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \

The above command returns JSON structured like this:

{
    "id": "RIYGUJXCPFHXY",
    "integration_id": "CFRPV98RPR1U8",
    "routing_regex": "us-(east|west)",
    "position": 0,
    "is_the_last_route": false,
    "slack": {
        "channel_id": "CH23212D"
    }
}

HTTP Request

GET https://amixr.io/api/v1/routes/<ROUTE_ID>/

List Routes

curl "https://amixr.io/api/v1/routes/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

The above command returns JSON structured like this:

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "RIYGUJXCPFHXY",
            "integration_id": "CFRPV98RPR1U8",
            "routing_regex": "us-(east|west)",
            "position": 0,
            "is_the_last_route": false,
            "slack": {
                "channel_id": "CH23212D"
            }
        },
        {
            "id": "RVBE4RKQSCGJ2",
            "integration_id": "CFRPV98RPR1U8",
            "routing_regex": ".*",
            "position": 1,
            "is_the_last_route": false,
            "slack": {
                "channel_id": "CH23212D"
            }
        }
    ]
}

HTTP Request

GET https://amixr.io/api/v1/routes/

Update Route

curl "https://amixr.io/api/v1/routes/RIYGUJXCPFHXY/" \
  --request PUT \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "routing_regex": "us-(east|west)",
      "position": 0,
      "slack": {
        "channel_id": "CH23212D"
      }
  }'

The above command returns JSON structured like this:

{
    "id": "RIYGUJXCPFHXY",
    "integration_id": "CFRPV98RPR1U8",
    "routing_regex": "us-(east|west)",
    "position": 0,
    "is_the_last_route": false,
    "slack": {
        "channel_id": "CH23212D"
    }
}

HTTP Request

PUT https://amixr.io/api/v1/routes/<ROUTE_ID>/

Delete Route

curl "https://amixr.io/api/v1/routes/RIYGUJXCPFHXY/" \
  --request DELETE \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

HTTP Request

DELETE https://amixr.io/api/v1/routes/<ROUTE_ID>/

- Escalation Policies

Create Escalation Policy

curl "https://amixr.io/api/v1/escalation_policies/" \
  --request POST \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "route_id": "RIYGUJXCPFHXY",
      "type": "wait",
      "duration": 60
  }'

The above command returns JSON structured like this:

{
    "id": "E3GA6SJETWWJS",
    "route_id": "RIYGUJXCPFHXY",
    "position": 0,
    "type": "wait",
    "duration": 60
}
Parameter Required Description
route_id Yes Each Escalation Policy is assigned to a specific Route.
position Optional Escalation Policies execute one after another starting from position=0. Position=-1 will put the Escalation Policy to the end of the list. The new Escalation Policy created with a position of already existing Escalation Policy will move the old one (and all following) down in the list.
type Yes A choice: "wait", "notify_persons", "notify_person_next_each_time", "notify_on_call_from_schedule".
duration Optional A time in secs when type "wait" is chosen.
persons_to_notify If type = notify_persons List of id's of users.
persons_to_notify _next_each_time If type = notify_person_next_each_time List of id's of users.
notify_on_call _from_schedule If type = notify_on_call_from_schedule Id of a Schedule.

HTTP Request

POST https://amixr.io/api/v1/escalation_policies/

Get Escalation Policy

curl "https://amixr.io/api/v1/escalation_policies/E3GA6SJETWWJS/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \

The above command returns JSON structured like this:

{
    "id": "E3GA6SJETWWJS",
    "route_id": "RIYGUJXCPFHXY",
    "position": 0,
    "type": "wait",
    "duration": 60
}

HTTP Request

GET https://amixr.io/api/v1/escalation_policies/<ESCALATION_POLICY_ID>/

List Escalation Policies

curl "https://amixr.io/api/v1/escalation_policies/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" 

The above command returns JSON structured like this:

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "E3GA6SJETWWJS",
            "route_id": "RIYGUJXCPFHXY",
            "position": 0,
            "type": "wait",
            "duration": 60
        },
        {
            "id": "E5JJTU52M5YM4",
            "route_id": "RIYGUJXCPFHXY",
            "position": 1,
            "type": "notify_person_next_each_time",
            "persons_to_notify_next_each_time": [
                "U4DNY931HHJS5"
            ]
        }
    ]
}

HTTP Request

GET https://amixr.io/api/v1/escalation_policies/

Delete Escalation Policy

curl "https://amixr.io/api/v1/escalation_policies/E3GA6SJETWWJS/" \
  --request DELETE \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json"

HTTP Request

DELETE https://amixr.io/api/v1/escalation_policies/<ESCALATION_POLICY_ID>/

- Schedules

List Schedules

curl "https://amixr.io/api/v1/schedules/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" 

The above command returns JSON structured like this:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "SBM7DV7BKFUYU",
            "name": "Demo schedule",
            "type": "ical",
            "on_call_now": [
                "U4DNY931HHJS5"
            ]
        }
    ]
}

HTTP Request

GET https://amixr.io/api/v1/schedules/

- Incidents

List Incidents

curl "https://amixr.io/api/v1/incidents/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" 

The above command returns JSON structured like this:

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "I68T24C13IFW1",
            "integration_id": "CFRPV98RPR1U8",
            "route_id": "RIYGUJXCPFHXY",
            "alerts_count": 3,
            "state": "resolved",
            "created_at": "2020-05-19T12:37:01.430444Z",
            "resolved_at": "2020-05-19T13:37:01.429805Z",
            "acknowledged_at": null,
            "title": "Memory above 90% threshold"
        }
    ]
}

Filter parameters available, should be provided as get arguments:

HTTP Request

GET https://amixr.io/api/v1/incidents/

Delete Incidents

curl "https://amixr.io/api/v1/incidents/I68T24C13IFW1/" \
  --request DELETE \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" \
  --data '{
      "mode": "wipe"
  }'
Parameter Required Description
mode No By default: "wipe". "wipe" will remove the payload of all Incident's Alerts on Amixr side. That's useful in case you sent a sensitive data to Amixr. All metadata will remain.

HTTP Request

DELETE https://amixr.io/api/v1/incidents/<INCIDENT_ID>

- Alerts

List Alerts

curl "https://amixr.io/api/v1/alerts/" \
  --request GET \
  --header "Authorization: meowmeowmeow" \
  --header "Content-Type: application/json" 

The above command returns JSON structured like this:

{
    "count": 3,
    "next": null,
    "previous": null,
    "results": [
        {
            "id": "AA74DN7T4JQB6",
            "incident_id": "I68T24C13IFW1",
            "created_at": "2020-05-11T20:07:43Z",
            "payload": {
                "state": "alerting",
                "title": "[Alerting] Test notification",
                "ruleId": 0,
                "message": "Someone is testing the alert notification within grafana.",
                "ruleUrl": "https://amixr.io/",
                "ruleName": "Test notification",
                "evalMatches": [
                    {
                        "tags": null,
                        "value": 100,
                        "metric": "High value"
                    },
                    {
                        "tags": null,
                        "value": 200,
                        "metric": "Higher Value"
                    }
                ]
            }
        },
        {
            "id": "AR9SSYFKE2PV7",
            "incident_id": "I68T24C13IFW1",
            "created_at": "2020-05-11T20:07:54Z",
            "payload": {
                "state": "alerting",
                "title": "[Alerting] Test notification",
                "ruleId": 0,
                "message": "Someone is testing the alert notification within grafana.",
                "ruleUrl": "https://amixr.io/",
                "ruleName": "Test notification",
                "evalMatches": [
                    {
                        "tags": null,
                        "value": 100,
                        "metric": "High value"
                    },
                    {
                        "tags": null,
                        "value": 200,
                        "metric": "Higher Value"
                    }
                ]
            }
        },
        {
            "id": "AWJQSGEYYUFGH",
            "incident_id": "I68T24C13IFW1",
            "created_at": "2020-05-11T20:07:58Z",
            "payload": {
                "state": "alerting",
                "title": "[Alerting] Test notification",
                "ruleId": 0,
                "message": "Someone is testing the alert notification within grafana.",
                "ruleUrl": "https://amixr.io/",
                "ruleName": "Test notification",
                "evalMatches": [
                    {
                        "tags": null,
                        "value": 100,
                        "metric": "High value"
                    },
                    {
                        "tags": null,
                        "value": 200,
                        "metric": "Higher Value"
                    }
                ]
            }
        }
    ]
}

Filter parameters available, should be provided as get arguments:

HTTP Request

GET https://amixr.io/api/v1/alerts/

Errors

The Amixr API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden
404 Not Found
405 Method Not Allowed -- You tried to access an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
429 Too Many Requests -- Slow down! read more about rate limits here
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.