---
title: "Create Collector Config"
method: POST
path: "/host-collector-config"
tags: ["Collector Config"]
---

# Create Collector Config

`POST /host-collector-config`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/host-collector-config`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/host-collector-config/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to create a new Collector Config

## Request body

- object
  - `data` HostCollectorConfigCreateSchema, required: Create schema for HostCollectorConfig model. Create
    - `projectId` string, uuid: ID of your OneUptime Project in which this object belongs. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [No access - you don't have permission for this operation]
    - `name` string, required: What the hosts this config is for have in common. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `description` string: What this config collects, for the people who edit it. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `osType` 'any' | 'linux' | 'windows' | 'darwin': The system of the hosts this config is for: linux, windows, darwin (macOS) or any. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `labels` object[]: Only hosts with at least one of these labels get this config. Leave empty for every host of its system. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
      - `id` string
    - `order` number: Where this config sits in the list. A host runs the first config in the list that applies to it. A new config is added to the end of the list. Setting a number another one already has puts it in that place, and the ones in the way move one place along. In the dashboard, drag the rows to reorder them. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `configYaml` string: The collector's config.yaml. Left empty on create, it starts as OneUptime's default for the config's system. Every saved change is checked and becomes a new version. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]

## Response `201`

Created successfully

- object
  - `data` HostCollectorConfigReadSchema: Read schema for HostCollectorConfig model. Read
    - `_id` string, uuid: ID of this object. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `createdAt` object: Date and Time when the object was created. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `updatedAt` object: Date and Time when the object was updated. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `deletedAt` object: Date and Time when the object was deleted. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `projectId` string, uuid: ID of your OneUptime Project in which this object belongs. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [No access - you don't have permission for this operation]
    - `name` string, required: What the hosts this config is for have in common. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `description` string: What this config collects, for the people who edit it. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `osType` 'any' | 'linux' | 'windows' | 'darwin': The system of the hosts this config is for: linux, windows, darwin (macOS) or any. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `labels` object[]: Only hosts with at least one of these labels get this config. Leave empty for every host of its system. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
      - `id` string
    - `order` number: Where this config sits in the list. A host runs the first config in the list that applies to it. A new config is added to the end of the list. Setting a number another one already has puts it in that place, and the ones in the way move one place along. In the dashboard, drag the rows to reorder them. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `configYaml` string: The collector's config.yaml. Left empty on create, it starts as OneUptime's default for the config's system. Every saved change is checked and becomes a new version. Permissions - Create: [Project Owner, Project Admin, Create Collector Config], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [Project Owner, Project Admin, Edit Collector Config]
    - `currentVersionNumber` number: The number of the config's current version. Every saved change to the config adds one. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [No access - you don't have permission for this operation]
    - `configHash` string: The SHA-256 of the current version's config, which a host reports back once it runs it. Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [No access - you don't have permission for this operation]
    - `createdByUserId` string, uuid: User ID who created this object (if this object was created by a User). Permissions - Create: [No access - you don't have permission for this operation], Read: [Project Owner, Project Admin, Project Member, Read Collector Config], Update: [No access - you don't have permission for this operation]

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
