---
title: "Create a new DAG definition"
method: POST
path: "/dags"
tags: ["dags"]
---

# Create a new DAG definition

`POST /dags`

Creates a new empty DAG file with the specified name

## Query parameters

- `remoteNode` string

## Request body

- object
  - `name` string, regex, required — Name of the DAG
  - `spec` string — Optional DAG spec in YAML format to initialize the DAG. If provided, the spec will be validated before creation.

## Response `201`

A successful response

- object
  - `name` string, required — Name of the newly created DAG

## Other responses

- `400` — Invalid DAG spec
- `default` — Generic error response

---

[API](https://skmtc.net/dagucloud/apis/dagu.md) · [All operations](https://skmtc.net/dagucloud/apis/dagu/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dagucloud/dagu/revisions/93cc41f2018a/schema)
