NAV Navbar
curl
  • Introduction
  • Authentication
  • Rate limiting
  • Versioning
  • Endpoints
  • Errors
  • Introduction

    Register as a AdminLabs user and get your free API key.

    API related credentials (api-key, account-id) can be found in Dashboard (Settings / API). Baseurl for API is https://api.adminlabs.com/v1.

    Contact Technical Support

    Authentication

    curl -X GET "https://api.adminlabs.com/v1/account"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    At the moment, this API supports only pre-generated key based authentication. Key and account ID can be obtained from AdminLabs dashboard when API is enabled for account.

    All API requests must contain the following headers:

    And all request bodies should have content type application/json and be valid JSON.

    Rate limiting

    AdminLabs API is not rate limited at the time being. Be aware that rate limiting might be added later on, to prevent abuses.

    Versioning

    Current API version is v1 and all calls should be made using that version. New versions will be released when we make backwards-incompatible changes to any of our endpoints.

    Endpoints

    GET: Account

    Example request

    curl -X GET "https://api.adminlabs.com/v1/account"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    {
      "id": "f3282448-c32c-11e6-9b20-08002744557f",
      "company": "The Best Company In The World Ltd",
      "timeZone": "Europe/Helsinki",
      "funds": 120
    }
    

    Get account details.

    HTTP Request

    GET https://api.adminlabs.com/v1/account

    GET: Users

    Example request

    curl -X GET "https://api.adminlabs.com/v1/users"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
          "id": "f3282448-c32c-11e6-9b20-08002744557f",
          "name": "John Doe",
          "email": "ex.ample@address.com",
          "emailConfirmed": true,
          "mobile": "+358401231234",
          "mobileConfirmed": false,
          "pushoverKey": "gsdsZPP3SdgjqPvNscyM2fgfkx2yn",
          "slackWebhookUrl": "https://hooks.slack.com/services/T1234567/B12345678/KfuwefDFSGunwgsdfgsfd",
          "slackChannel": "#testing",
          "isAdmin": true
        }
    ]
    

    Get attached users (ascending by name).

    HTTP Request

    GET https://api.adminlabs.com/v1/users

    GET: Monitors

    Example request

    curl -X GET "https://api.adminlabs.com/v1/monitors"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "f3282448-c32c-11e6-9b20-08002744557f",
            "groupId": "h3282448-c32c-11e6-9b20-08002744557f",
            "name": "High availability web site",
            "interval": 1,
            "retryInterval": 60,
            "scannerLocationId": 1,
            "outageId": null,
            "lastScan": 1499226127,
            "type": "url",
            "health": "ok",
            "state": "enabled",
            "address": "http://www.yourpersonalwebsite.xyz"
        }
    ]
    

    Get all monitors (ascending by name).

    HTTP Request

    GET https://api.adminlabs.com/v1/monitors

    Return values

    Type Description
    interval integer Scanning interval - minutes
    retryInterval integer Retry interval (after first unsuccessful scan) - seconds
    type string Monitor type. Possible values are 'url', 'port', 'ping'
    health string Monitor health state. Possible values are 'ok', 'down'
    state string Monitors state. Possible values are 'enabled', 'disabled', 'paused'

    GET: Monitor history

    Example request

    curl -X GET "https://api.adminlabs.com/v1/monitors/{id}/history/{year}/{month}"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "report-date": "2017-04-02",
            "active-time": 1450,
            "downtime-total": 360,
            "downtime-maintenance-noticed": 180,
            "outages-total": 4,
            "outages-maintenance-noticed": 2,
            "service-level": 98.12,
            "service-level-maintenance-noticed": 99.99,
            "scan-counter": 1450
        }
    ]
    

    Get daily history details for selected year and month (ascending by date).

    HTTP Request

    GET https://api.adminlabs.com/v1/monitors/{id}/history/{year}/{month}

    Query Parameters

    Required Type Description
    id true string Monitor ID
    year true integer Numeric representation of a year
    month true integer Numeric representation of a month, with leading zeros

    GET: Monitor scan history

    Example request

    curl -X GET "https://api.adminlabs.com/v1/monitors/{id}/scans/{date}"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "runTime": 1499226127,
            "loadTime": 10.12,
            "wasSuccessful": true
        }
    ]
    

    Get scans for defined date (ascending by runTime)

    HTTP Request

    GET https://api.adminlabs.com/v1/monitors/{id}/scans/{date}

    Query Parameters

    Required Type Description
    id true string Monitor ID
    date true string Date formatted YYYY-MM-DD (for example 2017-08-04)

    GET: Monitor outage history

    Example request

    curl -X GET "https://api.adminlabs.com/v1/monitors/{id}/outages"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "f3282448-c32c-11e6-9b20-08002744557f",
            "maintenanceId": null,
            "started": 1499226127,
            "ended": 1499226327,
            "comments": [
                {
                    "id": "d3282448-c32c-11e6-9b20-08002744557f",
                    "userId": "g3282448-c32c-11e6-9b20-08002744557f",
                    "name": "John Doe",
                    "comment": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
                    "showOnStatusPage": true,
                    "posted": 1499226127
                }
            ]
        }
    ]
    

    Get all outages (ascending by started)

    HTTP Request

    GET https://api.adminlabs.com/v1/monitors/{id}/outages

    Query Parameters

    Required Type Description
    id true string Monitor ID

    GET: Monitor maintenances

    Example request

    curl -X GET "https://api.adminlabs.com/v1/monitors/{id}/maintenances"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "f3282448-c32c-11e6-9b20-08002744557f",
            "start": 1499226127,
            "end": 1499228127,
            "ongoing": false,
            "title": "Database maintenance",
            "description": "All database servers will be updated and restarted.",
            "ignoreOutages": true,
            "comments": [
                {
                    "id": "d3282448-c32c-11e6-9b20-08002744557f",
                    "userId": "g3282448-c32c-11e6-9b20-08002744557f",
                    "name": "John Doe",
                    "comment": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
                    "showOnStatusPage": true,
                    "posted": 1499226127
                }
            ]
        }
    ]
    

    Get scheduled (and ongoing) maintenances (ascending by start)

    HTTP Request

    GET https://api.adminlabs.com/v1/monitors/{id}/maintenances

    Query Parameters

    Required Type Description
    id true string Monitor ID

    GET: Components

    Example request

    curl -X GET "https://api.adminlabs.com/v1/components"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "49739a11-a218-11e7-9187-08002744557f",
            "parentComponentId": null,
            "name": "Parent Component",
            "description": "This is an example",
            "state": "operational"
        },
        {
            "id": "c952a5dd-023d-11e8-9b76-08002744557f",
            "parentComponentId": "49739a11-a218-11e7-9187-08002744557f",
            "name": "Child component 1",
            "description": "This is an example",
            "state": "degradedPerformance"
        },
        {
            "id": "b952a5dd-023d-11e8-9b76-08002744557f",
            "parentComponentId": "49739a11-a218-11e7-9187-08002744557f",
            "name": "Child component 2",
            "description": null,
            "state": "partialOutage"
        }
    ]
    

    Get all components (ascending by name).

    HTTP Request

    GET https://api.adminlabs.com/v1/components

    Return values

    Type Description
    state string Component state. Possible values are 'operational', 'degradedPerformance', 'partialOutage', 'majorOutage'

    GET: Maintenances

    Example request

    curl -X GET "https://api.adminlabs.com/v1/maintenances"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "f3282448-c32c-11e6-9b20-08002744557f",
            "start": 1499226127,
            "end": 1499228127,
            "ongoing": true,
            "title": "Database maintenance",
            "description": "All database servers will be updated and restarted.",
            "ignoreOutages": true,
            "components": [
                {
                    "id": "2983c5c2-ddd8-11e7-90ff-08002744557f"
                },
                {
                    "id": "bce463d3-c093-11e7-b0af-08002744557f"
                }
            ],
            "monitors": [
                {
                    "id": "f3282448-c32c-11e6-9b20-08002744557f"
                }
            ],
            "comments": [
                {
                    "id": "d3282448-c32c-11e6-9b20-08002744557f",
                    "userId": "g3282448-c32c-11e6-9b20-08002744557f",
                    "name": "John Doe",
                    "comment": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.",
                    "showOnStatusPage": true,
                    "posted": 1499226127
                }
            ]
        }
    ]
    

    Get scheduled (and ongoing) maintenances (ascending by start)

    HTTP Request

    GET https://api.adminlabs.com/v1/maintenances

    GET: Status Pages

    Example request

    curl -X GET "https://api.adminlabs.com/v1/status-pages"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "41421d49-3e2e-11e8-b4a5-08002744557f",
            "name": "Business Status Page",
            "nextCharge": 1526114905,
            "plan": "Business",
            "subscribers": 2,
            "trial": false
        }
    ]
    

    Get status pages (ascending by name).

    HTTP Request

    GET https://api.adminlabs.com/v1/status-pages

    GET: Status Pages subscribers (paid plans)

    Example request

    curl -X GET "https://api.adminlabs.com/v1/status-pages/{id}/subscribers"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example response

    [
        {
            "id": "119faaf0-4217-11e8-9cf2-57cde79403a2",
            "email": "user1@example.com",
            "source": "api",
            "type": "partial",
            "components": [
                "aaab8b27-3e21-11e8-b4a5-08002744557f"
            ]
    
        },
        {
            "id": "17f170c0-4217-11e8-b751-6bba8c43f963",
            "email": "user2@example.com",
            "source": "status-page",
            "type": "all",
            "components": []
        }
    ]
    

    Get status pages subscribers (ascending by email).

    HTTP Request

    GET https://api.adminlabs.com/v1/status-pages/{id}/subscribers

    Return values

    Type Description
    source string Possible values are 'status-page', 'api', 'dashboard'.
    type string Possible values are partial and all.
    components array If subscription type is 'partial', list of component ids is returned here. If subscription type is 'all', array will be empty.

    POST: Save new subscriber to Status Page (paid plans)

    Example request

    curl -X POST "https://api.adminlabs.com/v1/status-pages/{id}/subscribers"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example 1 - parameters

    {
        "email": "user1@example.com",
        "components": []
    }
    

    Example 1 - response

    {
        "id": "b43cadb0-4221-11e8-854c-0b019918638d",
        "email": "user1@example.com",
        "source": "api",
        "type": "all",
        "components": []
    }
    

    Example 2 - parameters

    {
        "email": "user1@example.com",
        "components": [
            "h43cadb0-4221-11e8-854c-0b019918638d"
        ]
    }
    

    Example 2 - response

    {
        "id": "b43cadb0-4221-11e8-854c-0b019918638d",
        "email": "user1@example.com",
        "source": "api",
        "type": "partial",
        "components": [
            "h43cadb0-4221-11e8-854c-0b019918638d"
        ]
    }
    

    Save new subscriber to Status Page.

    Example 1: Save new subscriber and add it to all components.

    Example 2: Save new subscriber and add it selected components.

    HTTP Request

    GET https://api.adminlabs.com/v1/status-pages/{id}/subscribers

    DELETE: Delete Status Page subscriber (paid plans)

    Example request

    curl -X DELETE "https://api.adminlabs.com/v1/status-pages/{id}/subscribers"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
    

    Example - parameters

    {
        "email": "user1@example.com"
    }
    

    Example - response

    {
        "success": true
    }
    

    Save new subscriber to Status Page.

    Example 1: Save new subscriber and add it to all components.

    Example 2: Save new subscriber and add it selected components.

    HTTP Request

    GET https://api.adminlabs.com/v1/status-pages/{id}/subscribers

    Errors

    Example error response

    {
      "code": 110,
      "message": "General error message"
    }
    

    AdminLabs API returns standard HTTP success or error status codes. For errors, we will also include extra information about what went wrong. The various HTTP status codes we might return are listed below.

    Error Code Meaning
    400 Bad Request - The request was unacceptable, often due to invalid or missing a required parameter.
    401 Unauthorized - No valid API key (api-key) provided.
    402 Request failed - The parameters were valid but the request failed.
    404 Not found - The requested resource doesn’t exist.
    429 Too Many Requests - Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
    500 Server errors - Something went wrong on Admin Labs’ end. (Should never happed)