---
title: "Create Flight Task"
method: POST
path: "/openapi/v2.0/flight-task"
tags: ["Flight Task/Task Creation"]
---

# Create Flight Task

`POST /openapi/v2.0/flight-task`

## Request

- Base URL: `` (relative, and it does not resolve against the document’s source URL)
- URL: `/openapi/v2.0/flight-task`
- Auth: none required

Create a wayline flight task. You can use the `Wayline Upload Completion Notification` interface to obtain the wayline UUID uploaded to FlightHub 2, then call this interface to create a wayline task

## Headers

- `X-User-Token` string, required
- `X-Project-Uuid` string, required
- `X-Request-Id` string
- `X-Language` string

## Request body

- object
  - `name` string, required: Task Name
  - `sn` string, required: Dock SN
  - `wayline_uuid` string, required: Wayline File UUID
  - `time_zone` string, required: Time zone, time zone name in TZ database
  - `task_type` 'immediate' | 'timed' | 'recurring' | 'continuous', required: Task Type
  - `rth_altitude` integer: Return-to-Home Altitude
  - `rth_mode` 'optimal' | 'preset': Return-to-Home Mode
  - `out_of_control_action_in_flight` 'return_home' | 'continue_task': UAV Action After Signal Loss
  - `wayline_precision_type` 'gps' | 'rtk': Task Precision
  - `resumable_status` 'auto' | 'manual': Auto Resume from Breakpoint
  - `repeat_type` 'nonrepeating' | 'daily' | 'weekly' | 'absolute_monthly' | 'relative_monthly': Task Repetition Mode
  - `repeat_option` object: Recurring task configuration options (filled when task_type=recurring). Fields are conditionally required based on repeat_type value: daily - interval required; weekly - interval and days_of_week required; absolute_monthly - interval and days_of_month required; relative_monthly - interval, days_of_week, and week_of_month required
    - `interval` integer: Repeat interval value, minimum 1. Unit corresponds to repeat_type (daily=day, weekly=week, monthly=month)
    - `days_of_week` integer[]: Specify the day of week when repeating weekly/monthly (by week). 0=Sunday, 1=Monday, ..., 6=Saturday
    - `days_of_month` integer[]: When repeating monthly (by date), specifies the day, valid values 1-31
    - `week_of_month` integer: When repeating monthly (by week), specifies which week, valid values 1-4
  - `landing_dock_sn` string: Landing Dock SN, not required for non-frog-jump tasks
  - `begin_at` integer: Start time, seconds-level timestamp. Not required for immediate tasks. For timed tasks, this is the task execution time. For recurring and continuous tasks, this is the task start time
  - `end_at` integer: End time, seconds-level timestamp; required for recurring/continuous tasks
  - `recurring_task_start_time_list` integer[]: Multiple start execution times for recurring tasks, seconds-level timestamps; must fall on the same day as begin_at
  - `continuous_task_periods` array[]: Multiple execution time ranges of a continuous task, seconds-level timestamps; must fall on the same day as begin_at
    - integer[]
  - `min_battery_capacity` integer: Minimum Battery Level for Continuous Execution

## Response `200`

Success

- object
  - `code` integer: Non-zero Indicates Exception
  - `message` string: Message Prompt
  - `data` object: New Task Result
    - `task_uuid` string, uuid, required: Unique identifier of the newly created flight task, used to subsequently query task status, track, media resources, etc.

## Other responses

- `401`: Login Expired
- `403`: No permission to create flight tasks under the current project. Please check the user's role and permissions in this project
- `422`: Invalid parameters / invalid wayline
- `500`: Server Internal Error

---

[API](https://skmtc.dev/dji/apis/flighthub-2-openapi-v2-0-public-cloud.md) - [All operations](https://skmtc.dev/dji/apis/flighthub-2-openapi-v2-0-public-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/dji/apis/flighthub-2-openapi-v2-0-public-cloud/revisions/aeef0010be34?raw)
