---
title: "Register and trusts new Kubernetes Monitor."
method: POST
path: "/{spaceId}/observability/kubernetes-monitors"
tags: ["Observability"]
---

# Register and trusts new Kubernetes Monitor.

`POST /{spaceId}/observability/kubernetes-monitors`

## Request

- Base URL: `https://demo.octopus.app/api`
- URL: `https://demo.octopus.app/api/{spaceId}/observability/kubernetes-monitors`
- Auth: one of:
  - API key in header `X-Octopus-ApiKey`
  - API key in query parameter `ApiKey`
  - API key in header `X-NuGet-ApiKey`

## Path parameters

- `spaceId` string, required

## Request body

- RegisterKubernetesMonitorCommand
  - `InstallationId` string, uuid, required: Installation ID of that uniquely identifies the physical installation of the agent.
  - `MachineId` string, required: Machine ID of that uniquely identifies the deployment target or worker that is being observed
  - `PreserveAuthenticationToken` boolean: Controls whether the authentication token should be preserved during re-registration. If not supplied (null), the token will be regenerated (default behavior). If false, the token will be regenerated. If true, the existing token will be preserved.
  - `SpaceId` string, required

## Response `200`

Response containing the registered agent.

- RegisterKubernetesMonitorResponse
  - `AuthenticationToken` string: Authentication token for the monitor. Will be null if PreserveAuthenticationToken was set to true in the request and not registering a new monitor
  - `CertificateThumbprint` string, required
  - `Resource` KubernetesMonitorResource, required
    - `Id` string, required
    - `InstallationId` string, uuid, required
    - `MachineId` string, required
    - `SpaceId` string, required

## Other responses

- `400`: Bad request. Either the payload was not structurally valid or business rules did not permit the operation.
- `404`: Not found. One or more of the entities involved in the operation was not found.

---

[API](https://skmtc.dev/octopus/apis/octopus-server-api.md) - [All operations](https://skmtc.dev/octopus/apis/octopus-server-api/llms.txt) - [OpenAPI document](https://skmtc.dev/octopus/apis/octopus-server-api/revisions/fe937c07da34?raw)
