---
title: "Run Task"
method: POST
path: "/tasks/run"
tags: ["Tasks"]
---

# Run Task

`POST /tasks/run`

Run a task

## Request body

- RunTaskInput
  - `cmd` string
  - `mode` string
  - `node_group_ids` string[]
  - `node_ids` string[]
  - `param` string
  - `priority` integer
  - `spider_id` string, required

## Response `200`

OK

- ControllersResponseGoMongodbPrimitiveObjectID
  - `data` string[]
  - `error` string
  - `message` string
  - `status` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

## Changes

- **2026-07-17** `c7a4715c1f13` — 2 breaking, 15 info
  - the `param` request property type changed from `object` to `string`
  - the response's body type changed from no type to `object` for status `200`
  - api operation id `run_task` was added
  - added the new optional request property `cmd`
  - …13 more
- **2025-03-03** `14e4eafea538` — 1 breaking, 3 warning, 1 info
  - the response's body type changed from `object` to no type for status `200`
  - removed the optional property `code` from the response with the `200` status
  - removed the optional property `data` from the response with the `200` status
  - removed the optional property `message` from the response with the `200` status
  - …1 more
- **2025-03-02** `526e5bdf6dee` — 4 breaking, 6 warning, 5 info
  - request body became required
  - added the pattern `^[0-9a-fA-F]{24}$` to the request property `spider_id`
  - the `param` request property type changed from `string` to `object`
  - the `data` response's property type changed from `array` to `object` for status `200`
  - …11 more

[Change history](https://skmtc.dev/crawlab-team/apis/crawlab-api/changes/tasks/run/post.md)

---

[API](https://skmtc.dev/crawlab-team/apis/crawlab-api.md) · [All operations](https://skmtc.dev/crawlab-team/apis/crawlab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/crawlab-team/crawlab-api/revisions/c7a4715c1f13/schema)
