---
title: "Write or create a userdata file"
method: POST
path: "/api/userdata/{file}"
tags: ["userdata"]
---

# Write or create a userdata file

`POST /api/userdata/{file}`

Writes (creates or replaces) a file in the authenticated user's data directory.

## Path parameters

- `file` string, required

## Query parameters

- `overwrite` boolean
- `full_info` boolean

## Headers

- `Comfy-User` string

## Request body

- unknown

## Response `200`

File written

- union — Response body for the POST endpoints `/api/userdata/{file}` and `/api/userdata/{file}/move/{dest}`. Returns a single item whose shape depends on the `full_info` query parameter.
  - object — A single entry in a full-info user data listing.
    - `path` string — File name or path relative to the user directory
    - `created` number — Unix timestamp of file creation
    - `size` integer — File size in bytes
    - `modified` integer — Unix timestamp of last modification in milliseconds
  - string — Relative path of the written or moved file. Returned when `full_info` is absent or false.

## Other responses

- `400` — Missing or invalid 'file' parameter.
- `401` — Unauthorized.
- `403` — The requested path is not allowed.
- `409` — File exists and overwrite not set
- `500` — General error

## Changes

- **2026-05-22** `09a5075587c8` — 5 info
  - api operation id `writeUserdataFile` removed and replaced with `postUserdataFile`
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - …1 more
- **2026-04-24** `a66055fa384e` — 11 breaking, 3 warning, 9 info
  - for the `query` request parameter `full_info`, default value `false` was removed
  - for the `query` request parameter `overwrite`, default value `true` was removed
  - removed the enum value `false` from the `query` request parameter `full_info`
  - removed the enum value `false` from the `query` request parameter `overwrite`
  - …19 more

[Change history](https://skmtc.dev/comfy-org/apis/comfyui-api/changes/api/userdata/:file/post.md)

---

[API](https://skmtc.dev/comfy-org/apis/comfyui-api.md) · [All operations](https://skmtc.dev/comfy-org/apis/comfyui-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comfy-org/comfyui-api/revisions/09a5075587c8/schema)
