NAV Navbar
shell
  • Introduction
  • Authentication
  • Rate limiting
  • Versioning
  • Endpoints
  • Errors
  • Changelog
  • 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",
      "billingAddress": "12345 Santa Monica Boulevard",
      "zipCode": "90210",
      "city": "Beverly Hills",
      "country": "United States",
      "vatId": "VAT identification number",
      "timeZone": "Europe/Helsinki",
      "funds": 120,
      "primaryContactId": "d3282448-c32c-11e6-9b20-08002744557f"
    }
    

    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": "Ex Ample",
          "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

    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 last 24 hours or 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 false 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": "Jon 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 maintenance history

    Example request

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

    Example response

    [
      {
          "id": "f3282448-c32c-11e6-9b20-08002744557f",
          "started": 1499226127,
          "ended": 1499228127,
          "title": "Database maintenance",
          "description": "All database servers will be updated and restarted.",
          "comments": [
            {
              "id": "d3282448-c32c-11e6-9b20-08002744557f",
              "userId": "g3282448-c32c-11e6-9b20-08002744557f",
              "name": "Jon 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
            }
          ],
          "ignoreOutages": true
        }
    ]
    

    Get all maintenance (ascending by started)

    HTTP Request

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

    Query parameters

    Required Type Description
    id true string Monitor ID

    PUT: Outage comment

    Example request

    curl -X POST "https://api.adminlabs.com/v1/v1/monitors/{monitorId}/outages/{outageId}/comments"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
     -d '{
        "userId": "c1fe9693-3ed2-11e6-99b5-08002744557f",
        "comment": "TEstffddssdf21",
        "showOnStatusPage": true
    }'
    

    Example response

    {
        "id": "91341690-89a0-11e7-902d-bd74c8a1a5d6",
        "userId": "c1fe9693-3ed2-11e6-99b5-08002744557f",
        "name": "Jon Doe",
        "comment": "TEstffddssdf21",
        "showOnStatusPage": false,
        "posted": 1503660038
    }
    

    Add a comment to outage

    HTTP Request

    GET https://api.adminlabs.com/v1/v1/monitors/{monitorId}/outages/{outageId}/comments

    Query parameters

    Required Type Description
    monitorId true string Monitor ID
    outageId true string Outage ID

    Request body

    Required Type Description
    userId true string User ID in whos name to make this comment
    comment true string Payload of request, the actual comment
    showOnStatusPage true boolean Should this comment be public in monitors status page

    PUT: Maintenance comment

    Example request

    curl -X POST "https://api.adminlabs.com/v1/v1/monitors/{monitorId}/maintenance/{maintenanceId}/comments"
     -H "accept: application/json"
     -H "account-id: ACCOUNT-ID"
     -H "api-key: API-KEY"
     -d '{
        "userId": "c1fe9693-3ed2-11e6-99b5-08002744557f",
        "comment": "TEstffddssdf21",
        "showOnStatusPage": true
    }'
    

    Example response

    {
        "id": "91341690-89a0-11e7-902d-bd74c8a1a5d6",
        "userId": "c1fe9693-3ed2-11e6-99b5-08002744557f",
        "name": "Jon Doe",
        "comment": "TEstffddssdf21",
        "showOnStatusPage": false,
        "posted": 1503660038
    }
    

    Add a comment to maintenance

    HTTP Request

    GET https://api.adminlabs.com/v1/v1/monitors/{monitorId}/maintenance/{maintenanceId}/comments

    Query parameters

    Required Type Description
    monitorId true string Monitor ID
    maintenanceId true string Maintenance ID

    Request body

    Required Type Description
    userId true string User ID in whos name to make this comment
    comment true string Payload of request, the actual comment
    showOnStatusPage true boolean Should this comment be public in monitors status page

    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)

    Changelog

    2017-08-25