---
title: "Create a new user"
method: POST
path: "/users"
tags: ["users"]
---

# Create a new user

`POST /users`

Creates a new user account. Requires admin role.

## Request body

- CreateUserRequest — Request body for creating a new user
  - `username` string, required — Unique username
  - `password` string, required — User's password
  - `role` 'admin' | 'manager' | 'developer' | 'operator' | 'viewer', required — User role determining access permissions. admin: full access including user management, manager: DAG CRUD and execution with audit log access, developer: DAG CRUD and execution, operator: DAG execution only, viewer: read-only
  - `workspaceAccess` WorkspaceAccess — Workspace access policy. all=true grants the top-level role in every workspace. all=false requires explicit workspace grants and a top-level viewer role.
    - `all` boolean, required — Whether this identity can access all workspaces
    - `grants` WorkspaceGrant[], required — Workspace-specific grants used when all=false — unresolved $ref

## Response `201`

User created successfully

- UserResponse — Response containing user information
  - `user` User, required — User information
    - `id` string, required — Unique user identifier
    - `username` string, required — User's username
    - `role` 'admin' | 'manager' | 'developer' | 'operator' | 'viewer', required — User role determining access permissions. admin: full access including user management, manager: DAG CRUD and execution with audit log access, developer: DAG CRUD and execution, operator: DAG execution only, viewer: read-only
    - `workspaceAccess` WorkspaceAccess, required — Workspace access policy. all=true grants the top-level role in every workspace. all=false requires explicit workspace grants and a top-level viewer role.
      - `all` boolean, required — Whether this identity can access all workspaces
      - `grants` WorkspaceGrant[], required — Workspace-specific grants used when all=false — unresolved $ref
    - `authProvider` 'builtin' | 'oidc' | 'proxy' — Authentication provider for a user account
    - `isDisabled` boolean — Whether the user account is disabled
    - `createdAt` string, date-time, required — Account creation timestamp
    - `updatedAt` string, date-time, required — Last update timestamp

## Other responses

- `400` — Invalid request (e.g., weak password, invalid role)
- `401` — Not authenticated
- `403` — Forbidden - requires admin role
- `409` — Conflict - username already exists
- `default` — Unexpected error

---

[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/f8982f33e540/schema)
