No matching sections.

Host-Tracker REST API v1

A stable, token-authenticated HTTP API for managing website-monitoring tasks, contacts, alert/report subscriptions, and reading statistics, outages and incidents.

This is API v1. It does not run instant checks and uses a different authentication scheme than API v2 — the two are not interchangeable. For automated instant checks use the API v2 instead.

Base URL

Every path in this document is relative to a base URL. Two entry points serve the same API:

Entry pointBase URL (BASE_URL)Notes
Direct https://api1.host-tracker.com/ Recommended for server-to-server integrations.
Via the main site https://www.host-tracker.com/api/web/v1/ Reverse-proxied to the same service. Convenient when you already talk to www.host-tracker.com.

Throughout this reference, a call written as GET tasks means GET BASE_URL/tasks — e.g. https://api1.host-tracker.com/tasks or https://www.host-tracker.com/api/web/v1/tasks.

Content type & HTTP methods

Requests and responses are application/json by default (see Conventions for XML). The API uses standard HTTP methods:

  • GET — read entities (tasks, contacts, subscriptions, stats, outages, incidents, agents).
  • POST — create an entity or start an action.
  • PUT — update existing entities.
  • DELETE — remove entities.
  • PATCH — partial updates (used for resending a contact confirmation code).

HTTP method override

If your client cannot send PUT, DELETE or PATCH, send a POST and add an X-HTTP-Method-Override header naming the intended verb. For example, to update tasks, POST to tasks with X-HTTP-Method-Override: PUT.

Conventions

JSON serialization

JSON uses camelCase property names. Null fields are omitted from responses (empty arrays are still emitted as []). Property ordering is stable: identifier and address/url first, then inherited fields, then type-specific fields.

Date & time

Task create/read responses carry timestamps as ISO-8601 UTC strings (e.g. 2024-06-21T22:26:23Z). The statistics, outages, incidents and results endpoints additionally use a dual representation: each time appears both as a Unix-seconds integer field (suffix Unix) and as a human-readable string formatted to the account's profile date format and time zone. Request filters accept Unix-seconds and/or formatted strings depending on the endpoint (documented per endpoint below). All Unix timestamps are seconds since 1970-01-01T00:00:00Z.

XML content negotiation

All endpoints can also return XML. Send Accept: application/xml to receive an XML body instead of JSON; the response uses the classic .NET XmlSerializer representation of the same object graph. JSON is the default and recommended format.

CORS

Cross-origin requests are allowed. Plain (non-credentialed) requests are accepted from any origin (Access-Control-Allow-Origin: *). Requests that send cookies/credentials are accepted only from *.host-tracker.com origins. Token-based callers (using the Authorization header, as documented here) are unaffected by the credentialed-origin restriction.

Authentication

Every endpoint except POST users/token and the anonymous agent-list endpoints requires authentication. Two schemes are accepted:

  • Bearer token — obtained from POST users/token, sent as Authorization: bearer <token>. This is the primary scheme.
  • HTTP BasicAuthorization: Basic <base64(login:password)>. Credentials are decoded as ISO-8859-1. Convenient for quick tests; the bearer token is preferred for automation.

POST users/token anonymous

Exchange a login and password for a bearer token. The token is valid for 48 hours.

Request body

application/json
{
  "login": "your-login",
  "password": "your-password"
}
FieldTypeDescription
loginstringAccount login. Required. The account email is also accepted.
passwordstringAccount password. Required.
forLoginstringOptional. The super-account login to act on behalf of (subaccount impersonation — see below).

Response — 200 OK

application/json
{
  "ticket": "<bearer token>",
  "expirationTime": "2024-06-23T22:26:23Z",
  "expirationUnixTime": 1719181583
}

On failure the response is 401 with the machine code IncorrectLoginOrPassword (or AccessDenied if API access is disabled for the account) and a WWW-Authenticate: Bearer header.

Using the token

HTTP
GET BASE_URL/tasks HTTP/1.1
Host: api1.host-tracker.com
Accept: application/json
Authorization: bearer 3DD135...5EE510417

Subaccount impersonation (forLogin)

If a super-account granted your subaccount access to its data, log in as the subaccount but pass the super-account's login in forLogin. The returned token then lets you manage the super-account exactly as if the endpoints were called for your own account, subject to the rights the super-account granted. For example, if it granted read-only access to monitoring tasks, GET calls succeed but POST/PUT/PATCH/DELETE on tasks are rejected.

end-to-end example
# 1. Obtain an impersonation token
POST BASE_URL/users/token HTTP/1.1
Content-Type: application/json

{
  "login": "subaccount-login",
  "password": "subaccount-password",
  "forLogin": "superaccount-login"
}

# 2. Use the returned ticket to read the SUPER-account's tasks
GET BASE_URL/tasks HTTP/1.1
Authorization: bearer <ticket from step 1>

curl

bash
# fetch a token and store it
TOKEN=$(curl -s -X POST https://api1.host-tracker.com/users/token \
  -H "Content-Type: application/json" \
  -d '{"login":"your-login","password":"your-password"}' \
  | grep -o '"ticket":"[^"]*"' | cut -d'"' -f4)

# call an authenticated endpoint
curl -s https://api1.host-tracker.com/tasks \
  -H "Authorization: bearer $TOKEN"

Errors & machine codes

Errors return a standard HTTP status code plus a short machine-readable code your integration can branch on. The body is a plain-text English description (not JSON), intended for humans/logs.

The machine code is delivered two ways:

  • X-HT-Reason response header — carries the code on every response and every HTTP version. This is the recommended way to detect the error type.
  • HTTP/1.1 reason phrase — the status line reads e.g. HTTP/1.1 400 SimilarExists. Preserved for backward compatibility, but note that HTTP/2 and HTTP/3 removed reason phrases from the protocol, so this slot may be empty when the connection negotiates HTTP/2+. Prefer X-HT-Reason.
example error response
HTTP/1.1 400 SimilarExists
X-HT-Reason: SimilarExists
Content-Type: text/plain; charset=utf-8

Same task allready exists
Authentication challenges. A missing or invalid token returns 401 with WWW-Authenticate: Bearer and one of AccessDenied, WrongTicket, TicketExpired or IncorrectLoginOrPassword.

Error code reference

Every machine code the API can return, grouped by area, with the typical HTTP status. Unless noted, errors are 400 Bad Request.

Authentication

CodeStatusMeaning
AccessDenied401API access is disabled for this account, or the caller lacks the required rights.
IncorrectLoginOrPassword401Login/password rejected at users/token.
WrongTicket401The bearer token is malformed / unreadable.
TicketExpired401The bearer token has expired — obtain a new one.
RequestThrottled429Rate limit exceeded (see Rate limits). Includes Retry-After.

Tasks

CodeStatusMeaning
NotFound404The requested task does not exist.
SimilarExists400A task with the same type and key already exists (unless the account allows similar tasks).
EmptyTaskData400No task data supplied.
UncomplitedData400The task data is incomplete.
NoIdInTaskData400An update was requested but the task id is missing.
WrongEditableTaskDataType400The edit payload's type does not match the target task's type.
WrongTaskType400Unknown task type.
WrongTaskStatus400Unsupported status value (expected Enabled/Disabled).
WrongInterval400The monitoring interval is not one of the accepted values (see tasks/intervals).
EmptyUrl400No URL/host supplied for a task that requires one.
WrongUrl400The URL is invalid.
WrongSchema400Unsupported URL scheme.
BadIP400The URL resolves to a denied or malformed IP address.
UrlInBlackList400The URL is on an internal block list.
WrongHttpMethod400Unsupported HTTP method for an HTTP task (allowed: Get, Post, Head).
WrongKeywordMode400Unsupported keyword mode.
WrongPort400Invalid port for a port task.
WrongAgentPool400One or more requested agent pools do not exist. The message lists the bad and available pools.
SelectMoreAgents400The selected agent pools do not contain enough agents (7 required). The message lists per-pool counts.
ApiFullLogNotAllowed400fullLog is only available on advanced packages.
WrongExpectedSLA400expectedSLA must be between 0 and 100.
WrongDate400Invalid start/end date in a filter.
WrongDateFormat400A date string did not match the required format (given in the message).
EndDateIsGreaterThanStartDate400Start date must be ≤ end date.
StartEndIntervalIsTooBig400A results query would return more than 10 000 rows. The message includes the allowed interval (see GET tasks).
WrongSubscription400An inline subscription on the task body is invalid (the inner subscription code/message is carried through).
EmptyFilter400A bulk DELETE tasks was sent with an empty filter (rejected to prevent deleting the whole account).

Contacts

CodeStatusMeaning
NotFound404The requested contact does not exist.
SimilarExists400A contact with the same type, gateway, address and alert delay already exists.
EmptyContactData400No contact data supplied.
UncomplitedData400The contact data is incomplete.
NoIdInContactData400An update was requested but the contact id is missing.
EmptyAddress400No address supplied when creating a contact.
WrongContactType400Unknown contact type (also returned for the retired IM create/update path).
WrongEditableContactDataType400The edit payload's type does not match the target contact's type.
WrongEmailFormat400Invalid email address, or an unsupported email report format.
WrongPhoneFormat400A phone number must contain digits only (a leading + is allowed).
WrongSmsGateway400Unknown SMS gateway.
WrongIMGateway400Unknown IM gateway.
WrongAlertDelay400alertDelay is not one of the accepted values (see contacts/delays).
WrongActivePeriodInterval400Invalid active-period start/end.
WrongActiveDay400Unsupported active-day name.
EmptyFilter400A bulk DELETE contacts was sent with an empty filter (rejected).

Subscriptions

CodeStatusMeaning
AlertsAndReportsAreEmpty400A subscription entry specifies neither alert types nor report types.
UnknownAlertType400An alert type is not one of Up, Down, RepeatedlyDown.
UnknownReportType400A report type is not one of Day, Week, Month, Quarter, Year.

Rate limits

Requests are rate-limited per client, per endpoint. Exceeding a limit returns 429 with machine code RequestThrottled and a Retry-After header (seconds).

ScopeLimit
General endpoints, per account + endpoint6 requests / second and 120 requests / minute
Confirmation-code endpoints (contacts/{id}/code), per account + endpoint1 request / second and 2 requests / minute
Anonymous endpointsSame 6/s + 120/min, keyed per client IP address
429 response
HTTP/1.1 429 RequestThrottled
X-HT-Reason: RequestThrottled
Retry-After: 1
Content-Type: application/json; charset=utf-8

"API calls quota exceeded! maximum admitted 6 per s."

Monitoring tasks

GET tasks/types

Returns the array of task-type names the system knows about:

200 OK
["API","CntCheck","Counter","DNSBL","Database","DomainExp","Http",
 "Ping","Port","RusRegBL","SSLExp","Snmp","Tran","Waterfall","WebRisk"]
Existing tasks of any of these types can be read through this API. Tasks can be created/updated through the typed endpoints for four types only: Http Ping Port RusRegBL (created at tasks/http, tasks/ping, tasks/port, tasks/rusbl respectively).

GET tasks/intervals

Returns the array of monitoring intervals (in minutes) accepted for your account, e.g. [1,5,15,30,60]. Use one of these values for the interval field when creating a task; any other value yields WrongInterval.

GET tasks

List monitoring tasks. All query parameters are optional; with none, all of the account's tasks are returned. Repeat a parameter to pass an array, e.g. ?ids=guid1&ids=guid2.

The info parameter

Requests extra data embedded in each task. Combine values with commas (?info=stats,subscriptions) or pass the equivalent bitmask integer:

ValueBitEffect
subscriptions1Include the task's alert/report subscriptions in subscriptions.
stats2Include daily/monthly/yearly/total uptime in stats.
results4Include check results for the sdtuedtu window in results (last result if the window is omitted).
attachedResultsInclude latest attached-check results (certificate, domain expiration, DNSBL) in attached. Requires the relevant check… flags on the task.

?info=stats,subscriptions,results is equivalent to ?info=7.

Filter parameters

ParameterTypeDescription
idsguid[]Return only these task ids. For a single id, prefer GET tasks/{id}.
excludeIdsboolWith ids: return everything except those ids.
taskType / taskTypesstring / string[]Filter by task type (case-sensitive), e.g. Http.
excludeTaskTypesboolInvert the type filter.
statusstringEnabled or Disabled (user-disablement). E.g. ?status=Disabled.
url / urlsstring / string[]Filter by URL. Values in urls must be URL-encoded.
urlSearchLikeboolWith url (not urls): substring match instead of exact.
excludeUrlsboolInvert the URL filter.
name / namesstring / string[]Filter by task name. name/names combined with id/ids is an OR; combined with other filters it is an AND.
nameSearchLikeboolWith name: substring match.
excludeNamesboolInvert the name filter.
interval / intervalsint / int[]Filter by monitoring interval (minutes).
excludeIntervalsboolInvert the interval filter.
openStatboolPublic tasks (public statistics/event log).
lastStatebooltrue = currently up, false = currently down.
tagsstring[]Filter by tag.
overlimitedboolTasks with (true) or without (false) a billing overlimit.
activebooltrue = active, false = system-disabled (overlimit, low balance, …). For user-disablement use status.
sdtu / edtuint64Unix-seconds (UTC) start/end of a window. Used only when info=results is set; provide both. edtu must be > sdtu.
Results row limit. When requesting results, the estimated row count (edtu − sdtu) × (#tasks) / (avg interval) must not exceed 10 000. Otherwise the response is 400 StartEndIntervalIsTooBig, whose message includes the largest interval that would fit. This cap applies to task-results reads only.

Response — 200 OK

An array of task objects. The exact fields depend on the task type; the common base includes id, name, taskType, enabled, interval, lastState, creationTime, tags, agentPools, and (when requested via info) subscriptions, stats, results and attached. When results are included, each result carries at least timestamp (Unix-seconds UTC) and eventNumber; the remaining fields are task-type specific (see the create response below for the HTTP shape).

example request
GET BASE_URL/tasks?info=stats,subscriptions&taskType=Http HTTP/1.1
Accept: application/json
Authorization: bearer <token>

GET tasks/{id:guid}

Fetch a single task by id. Accepts the same info parameter (and sdtu/edtu when info=results). Returns the task object, or 404 NotFound if it does not exist.

POST tasks/http · tasks/ping · tasks/port · tasks/rusbl

Create a monitoring task of the given type. On success returns 201 Created, a relative Location: /tasks/{id} header, and the full created task object.

Request body — HTTP task

POST tasks/http · application/json
{
  // HTTP-specific fields
  "url": "https://www.example.com",        // REQUIRED
  "httpMethod": "Get",                       // Get | Post | Head (default Get)
  "userAgent": "MyMonitor",
  "referer": "https://www.google.com",
  "acceptHeader": "application/json",
  "followRedirect": false,
  "treat300AsError": false,                // if set, followRedirect is ignored
  "checkDnsbl": false,                       // check domain against DNS block lists
  "checkDomainExpiration": false,            // monitor domain expiry (valid domains only)
  "checkCertificateExpiration": false,       // monitor TLS cert expiry (https only)
  "checkRussianBlackLists": false,
  "checkWebRisk": false,
  "timeout": 40000,                          // ms before a check fails
  "keywords": ["error", "maintenance"],
  "keywordMode": "ReverseAny",             // see keyword modes below
  "userName": "basic-auth-user",          // credentials for the monitored resource
  "password": "basic-auth-pass",
  "postParameters": "a=1\r\nb=2",          // only with httpMethod=Post
  "ignoredStatuses": [404, 500],

  // fields common to every task type
  "interval": 5,                             // minutes; must be an accepted interval
  "enabled": true,
  "fullLog": false,                          // advanced packages only
  "openStat": true,
  "name": "My website",
  "tags": ["production", "web"],
  "agentPools": ["westeurope", "asia"],  // see notes below
  "subscriptions": [ /* inline subscriptions, see below */ ]
}
Keyword modeTask is OK when…
PresentAnyany keyword is present in the response.
PresentAllall keywords are present.
ReverseAnyall keywords are absent.
ReverseAllany keyword is absent.
ReverseWithResultall keywords are absent; the failure message includes the rest of the response line where the first keyword appeared (first 100 chars of each line analysed).
agentPools selects the monitoring locations. It is optional (the profile default is used otherwise). If specified, the pools must together contain at least 7 agents, or the request fails with SelectMoreAgents. Unknown pool ids fail with WrongAgentPool. Pool ids come from GET agents/pools.

Inline subscriptions

The subscriptions array subscribes contacts to this task's alerts/reports at creation time. Each entry uses the subscription shape; do not set taskIds (it is fixed to the new task). If contactIds is omitted, all of your confirmed contacts are subscribed. Report subscriptions are applied to Email contacts only.

Other task types

  • tasks/ping — body carries host plus the common fields.
  • tasks/port — body carries host and port plus the common fields.
  • tasks/rusbl — Russian-registry block-list check; body carries url, plus ignoreWarnings, doNotSendMsgOnWarnings, prefixMatch and the common fields.

Response — 201 Created (HTTP task)

application/json
{
  "id": "ef10cd12-93f9-e311-bec5-dc85de1f0bc2",
  "url": "https://www.example.com",
  "rawUrl": "https://www.example.com",
  "name": "My website",
  "creationTime": "2024-06-21T22:26:23Z",
  "taskType": "Http",
  "enabled": true,
  "interval": 5,
  "lastState": true,
  "openStatEnabled": true,
  "fullLogEnabled": false,
  "tags": ["production", "web"],
  "agentPools": ["westeurope", "asia"],
  "subscriptions": [
    { "alertTypes": ["Up"],   "taskIds": ["ef10cd12-...-0bc2"], "contactIds": ["4cedf037-...-0bc2"] },
    { "alertTypes": ["Down"], "taskIds": ["ef10cd12-...-0bc2"], "contactIds": ["4cedf037-...-0bc2"] },
    { "reportTypes": ["Month"], "taskIds": ["ef10cd12-...-0bc2"], "contactIds": ["4cedf037-...-0bc2"] }
  ],
  "httpMethod": "Get",
  "keywords": ["error"],
  "keywordMode": "ReverseAny",
  "timeout": 40000
}

curl

bash
curl -s -X POST https://api1.host-tracker.com/tasks/http \
  -H "Authorization: bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.example.com","interval":5,"name":"My website"}'

PUT tasks & typed variants

Update tasks. Two forms:

  • By idPUT tasks/{id} (common fields only), or the typed PUT tasks/http/{id}, tasks/ping/{id}, tasks/port/{id}, tasks/rusbl/{id} (type-specific fields too). The body is the same editable shape as create; only the fields you include are changed.
  • By filterPUT tasks?<filter> (common fields only) or the typed PUT tasks/{type}?<filter> (which pins the filter to that type). Uses the same filter parameters as GET tasks. Returns the updated task(s).

The untyped PUT tasks / PUT tasks/{id} can only touch fields common to all task types — use a typed endpoint to change type-specific settings.

DELETE tasks/{id:guid} & tasks

  • DELETE tasks/{id} — delete a single task; returns the deleted task.
  • DELETE tasks?<filter> — bulk delete by the task filter (a filter may also be supplied in the request body). Returns the deleted tasks.
Empty filter is rejected. A bulk DELETE tasks with no selective filter returns 400 EmptyFilter instead of deleting your whole account. To delete everything intentionally, iterate explicitly.

POST tasks/$batch · task/$batch

Run several task operations in one request. The body is a JSON array of sub-requests; the response is a JSON array of sub-responses in the same order. The sub-operation is chosen by the last segment of relativeUrl (e.g. httpPOST tasks/http). The request body must be JSON (Content-Type: application/json). The same mechanism exists for contacts at contacts/$batch / contact/$batch.

Request fieldTypeDescription
methodstringHTTP method of the sub-request (POST, PUT, DELETE…).
relativeUrlstringSub-resource; the last segment selects the operation (http, ping, port, rusbl…).
contentTypestringContent type of content, usually application/json.
contentstringThe sub-request body, as a JSON string.
Response fieldTypeDescription
codeintHTTP status code of the sub-response (e.g. 201, 400).
statusstringReason/status text (carries the machine code on errors).
headersobjectResponse headers of the sub-operation (e.g. Location).
bodystringThe sub-response body.
request · POST tasks/$batch
POST BASE_URL/tasks/$batch HTTP/1.1
Authorization: bearer <token>
Content-Type: application/json

[
  {
    "method": "POST",
    "relativeUrl": "http",
    "contentType": "application/json",
    "content": "{\"url\":\"https://a.example.com\",\"interval\":5}"
  },
  {
    "method": "POST",
    "relativeUrl": "ping",
    "contentType": "application/json",
    "content": "{\"host\":\"b.example.com\"}"
  }
]
response · 200 OK
[
  { "code": 201, "status": "Created",
    "headers": { "Location": "/tasks/ef10cd12-...-0bc2" },
    "body": "{ ...created http task... }" },
  { "code": 201, "status": "Created",
    "headers": { "Location": "/tasks/7a20de34-...-1cd3" },
    "body": "{ ...created ping task... }" }
]

Contacts

Contacts are the destinations that receive alerts and reports (email addresses, phone numbers for SMS/voice). Contact ids are used when creating subscriptions.

GET contacts/types · contacts/delays · contacts/sms/gateways · contacts/im/gateways

Static enumerations used by the contact endpoints:

EndpointReturns
contacts/types["Email","IM","SMS","VoiceCall"] — the contact types this API enumerates. Creatable types are Email, SMS and VoiceCall (IM is retired — see below).
contacts/delaysThe accepted alertDelay values (minutes): [0,5,15,30,60,180,720,360,1440,3].
contacts/sms/gatewaysSMS gateway ids: ["clickatell","clickatella","infobip","skype","twiliosms"]. The default is twiliosms; other entries are legacy and may be inactive.
contacts/im/gatewaysIM gateway ids: ["GTalk","SkypeChat"]. Listed for compatibility only — IM contacts can no longer be created (see below).
IM contacts are retired. GET contacts/im/gateways still returns the gateway list, but POST contacts/im and PUT contacts/im now return 400 WrongContactType. Existing IM contacts are not creatable through this API.

GET contacts & contacts/{id:guid}

List contacts (optionally filtered) or fetch one by id. Add ?info=subscriptions to embed each contact's subscriptions. With no filter, all of the account's contacts are returned.

Filter parameterTypeDescription
ids / excludeIdsguid[] / boolSelect or exclude by id.
contactType / contactTypesstring / string[]Filter by type (Email, SMS, VoiceCall…).
excludeContactTypesboolInvert the type filter.
confirmedboolConfirmed vs unconfirmed contacts.
overlimitedboolContacts flagged over the package limit.
acceptBillingNotificationsboolContacts used for billing notifications.
name / names / nameSearchLike / excludeNamesstring(s) / boolFilter by name (exact, list, substring, or excluded).
address / addresses / addressSearchLike / excludeAddressesstring(s) / boolFilter by address.

Contact object

Common fields: id, confirmed, contactType, name, address, alertDelay, activePeriodStart/activePeriodEnd (HH:mm), activeDays, sendCost. Email contacts add reportFormat (Text/ShortText), sendNews, sendBillingNotifications; SMS/IM contacts add gateway.

POST contacts/email · contacts/sms · contacts/voice

Create a contact. Returns 201 Created, a relative Location: /contacts/{id}, and a ContactOperationResult ({ contact, status }) whose status reports the confirmation outcome.

POST contacts/email · application/json
{
  "address": "ops@@example.com",          // REQUIRED
  "name": "Ops mailbox",
  "alertDelay": 0,                        // minutes; one of contacts/delays
  "reportFormat": "Text",               // Text | ShortText (email only)
  "activePeriodStart": "00:00",        // optional quiet-hours window (HH:mm)
  "activePeriodEnd": "23:59",
  "activeDays": ["Monday", "Tuesday"],   // optional; default all days
  "subscriptions": [ /* optional inline subscriptions */ ]
}
FieldApplies toNotes
addressallEmail address, or phone number (digits, optional leading +) for SMS/voice. Required on create.
alertDelayallMinutes to wait before alerting. Must be one of contacts/delays.
activePeriodStart / activePeriodEndallHH:mm; the window during which alerts are delivered.
activeDaysallAny of SundaySaturday; default is every day.
reportFormat, sendNews, sendBillingNotificationsemailEmail options.
gatewaysmsOne of contacts/sms/gateways; default twiliosms.

SMS and voice contacts default to gateways twiliosms / twiliovoice, get a default per-message price, and store the number with a leading +. Changing a contact's address or gateway resets its confirmed state.

Confirmation status values

The status field of the result reports the confirmation-code send outcome:

StatusMeaning
ConfirmedContact created already confirmed (no code needed).
CodeSentA confirmation code was sent; the contact becomes active once confirmed.
CodeSentEarlierA code was already sent recently and is still valid.
CodeFailContact created but sending the code failed; retry later.
LowSmsBalanceCould not send the code because the account balance is too low.
OverlimitedThe contact is over the package limit.

PUT contacts & typed variants

  • By idPUT contacts/{id} (common fields), or typed PUT contacts/email/{id}, contacts/sms/{id}, contacts/voice/{id}. Only the fields you send are changed.
  • By filterPUT contacts?<filter> or typed PUT contacts/{type}?<filter> (pins the filter to that type), using the contact filter.

PUT contacts/im (both forms) returns 400 WrongContactType.

DELETE contacts/{id:guid} & contacts

Delete one contact by id, or bulk-delete by the contact filter. As with tasks, a bulk delete with an empty filter is rejected with 400 EmptyFilter.

Confirmation codes

Unconfirmed contacts must confirm ownership with a short code delivered to the contact address.

  • PATCH contacts/{id}/code — (re)issue and send the confirmation code. Returns a ContactOperationResult with a status such as CodeSent.
  • POST contacts/{id}/code — confirm the contact by submitting the code. Body: { "code": "12345" }. On success the contact becomes confirmed.
These endpoints have a tighter rate limit: 1 request/second and 2 requests/minute.

Alerts & subscriptions

A subscription links one or more tasks and contacts to a set of alert and/or report types. A single subscription entry cross-joins its tasks and contacts, producing one alert/report per (task, contact, type).

Subscription shape

subscription entry
{
  "alertTypes": ["Up", "Down"],       // any of Up, Down, RepeatedlyDown
  "reportTypes": ["Day", "Month"],     // any of Day, Week, Month, Quarter, Year
  "taskIds": ["<task guid>"],
  "contactIds": ["<contact guid>"]
}
  • At least one of alertTypes / reportTypes is required, else AlertsAndReportsAreEmpty.
  • Omitting taskIds defaults to all of your tasks; omitting contactIds defaults to all of your contacts. An explicit empty array means "none".
  • Report subscriptions apply to Email contacts only — report types on non-Email contacts are silently ignored (their alert subscriptions are still created).
  • Ids that you do not own are ignored.

GET subscriptions/alertTypes · subscriptions/reportTypes

EndpointReturns
subscriptions/alertTypes["Up","Down","RepeatedlyDown"]
subscriptions/reportTypes["Day","Week","Month","Quarter","Year"]

GET subscriptions

List subscriptions. Returns one entry per matched alert or report subscription (never merged). Optional filters:

ParameterTypeDescription
taskIdguidOnly subscriptions for this task.
contactIdguidOnly subscriptions for this contact.
typesstring[]Only these alert/report types. Unrecognized names are ignored here (unlike POST/DELETE, which reject them).

POST subscriptions · DELETE subscriptions

Both take a JSON array of subscription entries in the body. POST adds the described subscriptions (only new rows are inserted); DELETE removes those that exist. Both return 200 OK with an empty body. Unknown alert/report types are rejected with UnknownAlertType / UnknownReportType.

POST subscriptions · body
[
  { "alertTypes": ["Up", "Down"],
    "taskIds": ["7ee87894-b8a9-e311-beb2-dc85de1f0bc2"],
    "contactIds": ["4cedf037-d1d9-e311-bebc-dc85de1f0bc2"] },
  { "reportTypes": ["Month"],
    "taskIds": ["7ee87894-b8a9-e311-beb2-dc85de1f0bc2"],
    "contactIds": ["4cedf037-d1d9-e311-bebc-dc85de1f0bc2"] }
]
curl
curl -s -X POST https://api1.host-tracker.com/subscriptions \
  -H "Authorization: bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '[{"alertTypes":["Up","Down"],"taskIds":["<task>"],"contactIds":["<contact>"]}]'

Statistics & results

GET stats

Uptime/downtime aggregates per task over a time window. Accepts the task filter to select tasks, plus:

ParameterTypeDescription
statsStartUnix / statsEndUnixint64Window start/end as Unix-seconds (UTC).
statsStart / statsEndstringWindow start/end as a profile-formatted date string (alternative to the Unix fields).
expectedSLAdouble0–100. When set, each result reports slaExpectationSucceeded.
fullTaskboolInclude the full task object rather than just its reference.

Response

A Stats object with the resolved window (dual date fields) and a stats array. Each entry carries the task reference and: uptimeInMinutes/uptimeSpan, downtimeInMinutes/downtimeSpan, maintenance up/down times, totalTimeInMinutes, the per-bucket check counts, and uptimePercent/downtimePercent.

Uptime percentage: uptime% = (uptime + maintenanceUptime) / (totalTime − maintenanceDowntime). When total time equals maintenance downtime the percentage is null (undefined). slaExpectationSucceeded is uptime% ≥ expectedSLA.

GET outages

Down-time spans per task. Accepts the task filter plus:

ParameterTypeDescription
startTimeUnix / endTimeUnixint64Window as Unix-seconds (UTC).
startTime / endTimestringWindow as profile-formatted strings.
getInUtcTimeZoneintWhen set, formatted times are UTC rather than the profile time zone.
fullTaskboolInclude the full task object.

Response: an Outages object with the resolved window and a taskOutages array; each element pairs a task with its outages spans (startTime/endTime + Unix variants, event numbers, optional comment).

GET incident

Incident (failure event) list per task. Accepts the task filter plus the same window/time-zone parameters as outages, and:

ParameterTypeDescription
startTimeUnix / endTimeUnix / startTime / endTimeint64 / stringWindow (Unix and/or formatted).
getInUtcTimeZoneintFormat times in UTC.
fullTaskboolInclude the full task object.
fullLogboolInclude the detailed per-agent recheck log. Requires an advanced package, else ApiFullLogNotAllowed.

Response: an Incidents object with a taskIncidents array. Each incident carries taskId, checkId, start/end Unix times, the failing location, the error, hasSnapshot, and (with fullLog) a recheck block listing OK locations and per-error failing locations.

GET incident/snapshot

Fetch the stored response snapshot captured for an incident. Parameters:

ParameterTypeDescription
taskIdguidThe task. Required.
checkIdint64The check/event id.
timestampUnixUtcint64The incident timestamp (Unix-seconds UTC).

Returns the snapshot (a timestamp plus the captured bytes) when one exists, or null when there is no snapshot for the given incident.

GET results/http

Aggregated HTTP timing metrics per task. Forces task type Http. Accepts the task filter plus:

ParameterTypeDescription
resultStartUnix / resultEndUnixint64Window as Unix-seconds (UTC).
resultStart / resultEndstringWindow as profile-formatted strings.
fullTaskboolInclude the full task object.

Response: an AggregatedHttpResults object; each taskResults entry reports the task reference and averaged responseTime, dnsTime, headTime, dataTime (milliseconds).

GET cr/httpResponseTime

HTTP response-time series per task. Accepts the task filter plus startDate, endDate and groupBy. Returns a bare array of series objects:

200 OK
[
  {
    "id": "ef10cd12-93f9-e311-bec5-dc85de1f0bc2",
    "rawUrl": "https://www.example.com",
    "name": "My website",
    "results": [ [1719181583, 142], [1719177983, 138] ]   // [unixSeconds, responseTimeMs], newest first
  }
]

Agents

Agents are the geographically distributed monitoring locations. Pool ids returned here are the values you pass in a task's agentPools.

GET agents

List monitoring agents. Optional query parameter:

ParameterTypeDescription
touchedintOnly agents that reported within the last N minutes. Values ≤ 0 (or absent) mean no filter; otherwise clamped to the range 1–10.

Each agent carries id, upFrom, datacenter (name/city/country/state), company (name/url), ip, version, lon/lat, and pools.

200 OK
[
  {
    "id": "a1b2c3d4-...-0001",
    "upFrom": "2024-06-20T08:00:00Z",
    "datacenter": { "name": "Example Hosting", "city": "Frankfurt", "country": "DE", "state": "" },
    "company": { "name": "Example Hosting", "url": "https://example-hosting.com" },
    "ip": "203.0.113.10",
    "version": "1.4.2",
    "lon": 8.68, "lat": 50.11,
    "pools": []
  }
]

GET agents/pools

List the public agent pools (geo regions). Each pool carries id, desc, its agents, childPools, and hidden. Use the pool id values in a task's agentPools.

GET agents/ips anonymous

Return the current monitoring agent IP addresses — useful for whitelisting Host-Tracker in a firewall. This endpoint needs no authentication. By default it returns text/plain, one IP per line; send Accept: application/json to receive a JSON array instead.

text/plain (default)
203.0.113.10
203.0.113.11
198.51.100.7
with Accept: application/json
["203.0.113.10", "203.0.113.11", "198.51.100.7"]
Host-Tracker REST API v1 — host-tracker.com. Machine-readable Swagger/OpenAPI is available at BASE_URL/docs/v1 with an interactive sandbox at BASE_URL/sandbox.