POST/v1/checks/tcp

Create a TCP check

Create a new TCP check to monitor TCP connectivity

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Body parameters

name:string
Name of the monitor
test_interval:integeroptional
Interval in seconds between checks
test_regions:string[]optional
Regions to run checks from. Valid regions: aws:us-east-1, aws:us-east-2, aws:us-west-1, aws:eu-central-1, aws:eu-west-2, aws:ap-south-1, aws:ap-southeast-2, aws:ap-northeast-1
user_alerts:string[]optional
slack_alerts:string[]optional
discord_alerts:string[]optional
incident_io_alerts:string[]optional
microsoft_teams_alerts:string[]optional
telegram_alerts:string[]optional
webhook_alerts:string[]optional
IDs of webhooks to associate with this check
oncall_alerts:string[]optional
IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)
alert_priority:stringoptional
Alert Priority
Accepted values: "LOW" | "HIGH"
Default: "LOW"
confirmation_period_seconds:integeroptional
Confirmation period in seconds
Default: 60
recovery_period_seconds:integeroptional
Recovery period in seconds
Default: 180
reminder_alert_interval_minutes:integeroptional
Interval in minutes between reminders (-1 for never)
Default: 1440
timeout:integeroptional
Timeout in milliseconds
Default: 10000
type:stringoptional
Accepted values: "TCP_CHECK"
tcp_hostname:string
Publicly reachable hostname or IP address to connect to
tcp_port:integer
TCP port to connect to
tcp_ip_family:stringoptional
IP family to use for DNS resolution and socket connection
Accepted values: "IPv4" | "IPv6"
Default: "IPv4"
tcp_data:stringnulloptional
Optional TCP payload to send immediately after connecting
tcp_should_fail:booleanoptional
Whether a failed TCP connection should be treated as passing
Default: false
assertions:object[]optional
TCP assertions to run on response time or response data

Responses

StatusMeaningDescription
201CreatedCreate a new OnlineOrNot TCP Check
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

POST
/v1/checks/tcp
curl --request POST \
  --url https://api.onlineornot.com/v1/checks/tcp \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"name":"TCP for example.com:443","tcp_hostname":"example.com","tcp_port":443,"test_interval":60}'

Response

{
  "result": {
    "id": "a1b2c3d4",
    "name": "My landing page",
    "last_queued": "2021-01-01T00:00:00.000Z",
    "status": "UP",
    "headers": {
      "X-My-Header": "My Value"
    },
    "text_to_search_for": "string",
    "reminder_alert_interval_minutes": 1440,
    "confirmation_period_seconds": 60,
    "recovery_period_seconds": 180,
    "test_interval": 60,
    "timeout": 10000,
    "script": "string",
    "alert_priority": "HIGH",
    "verify_ssl": true,
    "method": "GET",
    "body": "string",
    "follow_redirects": true,
    "auth_username": "string",
    "auth_password": "string",
    "test_regions": [
      "aws:us-east-1",
      "aws:eu-central-1"
    ],
    "user_alerts": [
      "string"
    ],
    "slack_alerts": [
      "string"
    ],
    "discord_alerts": [
      "string"
    ],
    "incident_io_alerts": [
      "string"
    ],
    "microsoft_teams_alerts": [
      "string"
    ],
    "telegram_alerts": [
      "string"
    ],
    "oncall_alerts": [
      "string"
    ],
    "webhook_alerts": [
      "string"
    ],
    "check_type": "TCP",
    "url": null,
    "version": "NODE24_TCP",
    "tcp_hostname": "tcpbin.com",
    "tcp_port": 4242,
    "tcp_ip_family": "IPv4",
    "tcp_data": "string",
    "tcp_should_fail": false,
    "assertions": [
      {
        "type": "TCP_RESPONSE_DATA",
        "property": "",
        "comparison": "EQUALS",
        "expected": "OK"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/checks/tcp/{check_id}

Retrieve a TCP check

Look up detailed information about a specific TCP check

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

check_id:string
Uptime Check ID

Responses

StatusMeaningDescription
200OKRetrieve the specified OnlineOrNot TCP Check
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundTCP check not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

GET
/v1/checks/tcp/{check_id}
curl --request GET \
  --url https://api.onlineornot.com/v1/checks/tcp/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4",
    "name": "My landing page",
    "last_queued": "2021-01-01T00:00:00.000Z",
    "status": "UP",
    "headers": {
      "X-My-Header": "My Value"
    },
    "text_to_search_for": "string",
    "reminder_alert_interval_minutes": 1440,
    "confirmation_period_seconds": 60,
    "recovery_period_seconds": 180,
    "test_interval": 60,
    "timeout": 10000,
    "script": "string",
    "alert_priority": "HIGH",
    "verify_ssl": true,
    "method": "GET",
    "body": "string",
    "follow_redirects": true,
    "auth_username": "string",
    "auth_password": "string",
    "test_regions": [
      "aws:us-east-1",
      "aws:eu-central-1"
    ],
    "user_alerts": [
      "string"
    ],
    "slack_alerts": [
      "string"
    ],
    "discord_alerts": [
      "string"
    ],
    "incident_io_alerts": [
      "string"
    ],
    "microsoft_teams_alerts": [
      "string"
    ],
    "telegram_alerts": [
      "string"
    ],
    "oncall_alerts": [
      "string"
    ],
    "webhook_alerts": [
      "string"
    ],
    "check_type": "TCP",
    "url": null,
    "version": "NODE24_TCP",
    "tcp_hostname": "tcpbin.com",
    "tcp_port": 4242,
    "tcp_ip_family": "IPv4",
    "tcp_data": "string",
    "tcp_should_fail": false,
    "assertions": [
      {
        "type": "TCP_RESPONSE_DATA",
        "property": "",
        "comparison": "EQUALS",
        "expected": "OK"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

PATCH/v1/checks/tcp/{check_id}

Modify a TCP check

Modify the configuration of an existing TCP check

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

check_id:string
Uptime Check ID

Body parameters

name:stringoptional
Name of the monitor
test_interval:integeroptional
Interval in seconds between checks
test_regions:string[]optional
Regions to run checks from. Valid regions: aws:us-east-1, aws:us-east-2, aws:us-west-1, aws:eu-central-1, aws:eu-west-2, aws:ap-south-1, aws:ap-southeast-2, aws:ap-northeast-1
user_alerts:string[]optional
slack_alerts:string[]optional
discord_alerts:string[]optional
incident_io_alerts:string[]optional
microsoft_teams_alerts:string[]optional
telegram_alerts:string[]optional
webhook_alerts:string[]optional
IDs of webhooks to associate with this check
oncall_alerts:string[]optional
IDs of on-call integrations (Grafana, PagerDuty, Opsgenie, Spike)
alert_priority:stringoptional
Alert Priority
Accepted values: "LOW" | "HIGH"
Default: "LOW"
confirmation_period_seconds:integeroptional
Confirmation period in seconds
recovery_period_seconds:integeroptional
Recovery period in seconds
reminder_alert_interval_minutes:integeroptional
Interval in minutes between reminders (-1 for never)
timeout:integeroptional
Timeout in milliseconds
paused:booleanoptional
Whether the monitor is paused (completely stops execution) or actively running
muted:booleanoptional
Whether the monitor is muted (continues running but suppresses alerts) or sending alerts normally
tcp_hostname:stringoptional
Publicly reachable hostname or IP address to connect to
tcp_port:integeroptional
TCP port to connect to
tcp_ip_family:stringoptional
Accepted values: "IPv4" | "IPv6"
tcp_data:stringnulloptional
Optional TCP payload to send immediately after connecting
tcp_should_fail:booleanoptional
assertions:object[]optional

Responses

StatusMeaningDescription
200OKModify an OnlineOrNot TCP Check
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundTCP check not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

PATCH
/v1/checks/tcp/{check_id}
curl --request PATCH \
  --url https://api.onlineornot.com/v1/checks/tcp/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}' \
  --header 'Content-Type: application/json' \
  --data '{"tcp_hostname":"example.org","tcp_port":8443,"tcp_ip_family":"IPv4"}'

Response

{
  "result": {
    "id": "a1b2c3d4",
    "name": "My landing page",
    "last_queued": "2021-01-01T00:00:00.000Z",
    "status": "UP",
    "headers": {
      "X-My-Header": "My Value"
    },
    "text_to_search_for": "string",
    "reminder_alert_interval_minutes": 1440,
    "confirmation_period_seconds": 60,
    "recovery_period_seconds": 180,
    "test_interval": 60,
    "timeout": 10000,
    "script": "string",
    "alert_priority": "HIGH",
    "verify_ssl": true,
    "method": "GET",
    "body": "string",
    "follow_redirects": true,
    "auth_username": "string",
    "auth_password": "string",
    "test_regions": [
      "aws:us-east-1",
      "aws:eu-central-1"
    ],
    "user_alerts": [
      "string"
    ],
    "slack_alerts": [
      "string"
    ],
    "discord_alerts": [
      "string"
    ],
    "incident_io_alerts": [
      "string"
    ],
    "microsoft_teams_alerts": [
      "string"
    ],
    "telegram_alerts": [
      "string"
    ],
    "oncall_alerts": [
      "string"
    ],
    "webhook_alerts": [
      "string"
    ],
    "check_type": "TCP",
    "url": null,
    "version": "NODE24_TCP",
    "tcp_hostname": "tcpbin.com",
    "tcp_port": 4242,
    "tcp_ip_family": "IPv4",
    "tcp_data": "string",
    "tcp_should_fail": false,
    "assertions": [
      {
        "type": "TCP_RESPONSE_DATA",
        "property": "",
        "comparison": "EQUALS",
        "expected": "OK"
      }
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

DELETE/v1/checks/tcp/{check_id}

Delete a TCP check

Permanently delete a TCP check

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Path parameters

check_id:string
Uptime Check ID

Responses

StatusMeaningDescription
200OKReturns the deleted OnlineOrNot TCP Check's ID
400Bad RequestValidation error
401UnauthorizedUnauthenticated
403ForbiddenForbidden
404Not FoundTCP check not found
500Internal Server ErrorInternal Server Error

Response Schema

result:object
success:boolean
Whether the API call was successful
errors:object[]
messages:object[]

Request

DELETE
/v1/checks/tcp/{check_id}
curl --request DELETE \
  --url https://api.onlineornot.com/v1/checks/tcp/a1b2c3d4 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4"
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?