---
title: "Update an TCP monitor"
method: PUT
path: "/monitor/tcp/{id}"
tags: ["monitor"]
---

# Update an TCP monitor

`PUT /monitor/tcp/{id}`

## Path parameters

- `id` string, required — The id of the monitor

## Request body

- object
  - `name` string, required — Name of the monitor
  - `description` string
  - `retry` number — Number of retries to attempt
  - `degradedAfter` number — Time in milliseconds to wait before marking the request as degraded
  - `timeout` number — Time in milliseconds to wait before marking the request as timed out
  - `frequency` '30s' | '1m' | '5m' | '10m' | '30m' | '1h', required
  - `active` boolean — Whether the monitor is active
  - `public` boolean — Whether the monitor is public
  - `regions` string[], nullable — Where we should monitor it
  - `openTelemetry` object, nullable
    - `endpoint` string, uri — OTEL endpoint to send metrics to
    - `headers` object — Headers to send with the OTEL request
  - `request` object, required — The TCP Request we are sending
    - `host` string, required — Host to connect to
    - `port` number, required — Port to connect to

## Response `200`

Update a monitor

- Monitor
  - `id` number, required — The id of the monitor
  - `periodicity` '30s' | '1m' | '5m' | '10m' | '30m' | '1h' | 'other', required — How often the monitor should run
  - `url` string, required — The url to monitor
  - `regions` string[], nullable — Where we should monitor it
  - `name` string, required — The name of the monitor
  - `externalName` string, nullable — The external name of the monitor, used to display on the status page or in the external notifications
  - `description` string, nullable — The description of your monitor
  - `method` 'GET' | 'POST' | 'HEAD' | 'PUT' | 'PATCH' | 'DELETE' | 'TRACE' | 'CONNECT' | 'OPTIONS', required
  - `body` string, nullable — The body
  - `headers` object[], nullable — The headers of your request
    - `key` string, required
    - `value` string, required
  - `assertions` union[], nullable — The assertions to run
    - union
      - object — The status assertion
        - `type` 'status', required
        - `compare` 'eq' | 'not_eq' | 'gt' | 'gte' | 'lt' | 'lte', required — Comparison operator
        - `target` integer, required — The target value
      - object — The header assertion
        - `type` 'header', required
        - `compare` 'contains' | 'not_contains' | 'eq' | 'not_eq' | 'empty' | 'not_empty' | 'gt' | 'gte' | 'lt' | 'lte', required
        - `key` string, required — The key of the header
        - `target` string, required — the header value
      - object — The text body assertion
        - `type` 'textBody', required
        - `compare` 'contains' | 'not_contains' | 'eq' | 'not_eq' | 'empty' | 'not_empty' | 'gt' | 'gte' | 'lt' | 'lte', required
        - `target` string, required — The target value
      - object — The DNS record assertion
        - `type` 'dnsRecord', required
        - `key` 'A' | 'AAAA' | 'CNAME' | 'MX' | 'TXT' | 'NS', required
        - `compare` 'contains' | 'not_contains' | 'eq' | 'not_eq', required
        - `target` string, required
  - `active` boolean — If the monitor is active
  - `public` boolean — If the monitor is public
  - `degradedAfter` number, nullable — The time after the monitor is considered degraded in milliseconds
  - `timeout` number, nullable — The timeout of the request in milliseconds
  - `retry` number — The number of retries to attempt
  - `followRedirects` boolean — If the monitor should follow redirects
  - `jobType` 'http' | 'tcp' | 'icmp' | 'udp' | 'dns' | 'ssl' — The type of the monitor
  - `openTelemetry` object — The OpenTelemetry configuration
    - `endpoint` string, uri — The endpoint of the OpenTelemetry collector
    - `headers` object — The headers to send to the OpenTelemetry collector

## Other responses

- `400` — The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
- `401` — The client must authenticate itself to get the requested response.
- `402` — A higher pricing plan is required to access the resource.
- `403` — The client does not have the necessary permissions to access the resource.
- `404` — The server can't find the requested resource.
- `409` — The request could not be completed due to a conflict mainly due to unique constraints.
- `500` — The server has encountered a situation it doesn't know how to handle.

---

[API](https://skmtc.net/openstatus/apis/openstatus-api.md) · [All operations](https://skmtc.net/openstatus/apis/openstatus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openstatus/openstatus-api/revisions/f075fbb509f7/schema)
