---
title: "创建任务"
method: POST
path: "/api/v1/task/add"
tags: ["任务中心"]
---

# 创建任务

`POST /api/v1/task/add`

创建新的任务

## Request body

- ControllerCreateTaskRequest
  - `cron_expr` string
  - `host_ids` string, required
  - `name` string, required
  - `remark` string
  - `shell` string, required
  - `type` integer, required

## Response `200`

OK

- ResultResult
  - `code` integer — 状态码
  - `data` unknown
  - `message` string — 提示信息

---

[API](https://skmtc.net/opsre/apis/devops.md) · [All operations](https://skmtc.net/opsre/apis/devops/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opsre/devops/versions/25cac8835c4c/schema)
