---
title: "Upload temporary files via multipart form"
method: POST
path: "/api/v1/temp"
tags: ["Temporary Files"]
---

# Upload temporary files via multipart form

`POST /api/v1/temp`

Uploads one or more files as temporary resources via multipart form data. Files are stored temporarily and can be referenced when creating content. The response streams back a JSON object with the created temporary file references. Anonymous access can be allowed via the TEMP_RESOURCE_ALLOW_ANONYMOUS configuration property.

**Use this endpoint to supply files for binary and image fields** (`ImmutableBinaryField`, `ImmutableImageField`) when creating or updating contentlets. After uploading, pass `tempFiles[0].id` (e.g. `"temp_5311313004"`) as the field value in the workflow fire endpoint. See `PUT /api/v1/workflow/actions/default/fire/{systemAction}` for the full pattern.

## Query parameters

- `maxFileLength` string

## Response `200`

Temporary files created successfully

- TempFilesView — Response body for /api/v1/temp and /api/v1/temp/byUrl uploads. Contains the tempFiles array; use tempFiles[0].id (e.g. "temp_5311313004") as the field value when creating contentlets with binary or image fields.
  - `tempFiles` DotTempFile[]
    - `id` string
    - `mimeType` string
    - `referenceUrl` string
    - `thumbnailUrl` string
    - `fileName` string
    - `folder` string
    - `image` boolean
    - `metadata` object
    - `length` integer

## Other responses

- `400` — Invalid file, origin, or referer
- `401` — Authentication required (when anonymous access is disabled)
- `404` — Temp file resource is not enabled

---

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