---
title: "Create File"
method: POST
path: "/v1/files/"
tags: ["files", "public"]
---

# Create File

`POST /v1/files/`

Create a file.

**Scopes**: `files:write`

## Request body

- union
  - DownloadableFileCreate — Schema to create a file to be associated with the downloadables benefit.
    - `organization_id` string, uuid4, nullable — The organization ID.
    - `name` string, required
    - `mime_type` string, required
    - `size` integer, required
    - `checksum_sha256_base64` string, nullable
    - `upload` S3FileCreateMultipart, required
      - `parts` S3FileCreatePart[], required
        - `number` integer, required
        - `chunk_start` integer, required
        - `chunk_end` integer, required
        - `checksum_sha256_base64` string, nullable
    - `service` 'downloadable', required
    - `version` string, nullable
  - ProductMediaFileCreate — Schema to create a file to be used as a product media file.
    - `organization_id` string, uuid4, nullable — The organization ID.
    - `name` string, required
    - `mime_type` string, required — MIME type of the file. Only images are supported for this type of file.
    - `size` integer, required — Size of the file. A maximum of 10 MB is allowed for this type of file.
    - `checksum_sha256_base64` string, nullable
    - `upload` S3FileCreateMultipart, required
      - `parts` S3FileCreatePart[], required
        - `number` integer, required
        - `chunk_start` integer, required
        - `chunk_end` integer, required
        - `checksum_sha256_base64` string, nullable
    - `service` 'product_media', required
    - `version` string, nullable
  - OrganizationAvatarFileCreate — Schema to create a file to be used as an organization avatar.
    - `organization_id` string, uuid4, nullable — The organization ID.
    - `name` string, required
    - `mime_type` string, required — MIME type of the file. Only images are supported for this type of file.
    - `size` integer, required — Size of the file. A maximum of 1 MB is allowed for this type of file.
    - `checksum_sha256_base64` string, nullable
    - `upload` S3FileCreateMultipart, required
      - `parts` S3FileCreatePart[], required
        - `number` integer, required
        - `chunk_start` integer, required
        - `chunk_end` integer, required
        - `checksum_sha256_base64` string, nullable
    - `service` 'organization_avatar', required
    - `version` string, nullable
  - SupportCaseAttachmentFileCreate — Schema to create a file attached to a support case.
    - `organization_id` string, uuid4, nullable — The organization ID.
    - `name` string, required
    - `mime_type` string, required — MIME type of the file. Images, videos, PDF, CSV, plain text, Word and Excel documents are supported.
    - `size` integer, required — Size of the file. A maximum of 250 MB is allowed for this type of file.
    - `checksum_sha256_base64` string, nullable
    - `upload` S3FileCreateMultipart, required
      - `parts` S3FileCreatePart[], required
        - `number` integer, required
        - `chunk_start` integer, required
        - `chunk_end` integer, required
        - `checksum_sha256_base64` string, nullable
    - `service` 'support_case_attachment', required
    - `version` string, nullable

## Response `201`

File created.

- FileUpload
  - `id` string, uuid4, required — The ID of the object.
  - `organization_id` string, uuid4, required
  - `name` string, required
  - `path` string, required
  - `mime_type` string, required
  - `size` integer, required
  - `storage_version` string, nullable, required
  - `checksum_etag` string, nullable, required
  - `checksum_sha256_base64` string, nullable, required
  - `checksum_sha256_hex` string, nullable, required
  - `last_modified_at` string, date-time, nullable, required
  - `upload` S3FileUploadMultipart, required
    - `id` string, required
    - `path` string, required
    - `parts` S3FileUploadPart[], required
      - `number` integer, required
      - `chunk_start` integer, required
      - `chunk_end` integer, required
      - `checksum_sha256_base64` string, nullable
      - `url` string, required
      - `expires_at` string, date-time, required
      - `headers` object
  - `version` string, nullable, required
  - `is_uploaded` boolean
  - `service` 'downloadable' | 'product_media' | 'organization_avatar' | 'support_case_attachment', required
  - `size_readable` string, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/polar/apis/polar-api.md) · [All operations](https://skmtc.net/polar/apis/polar-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/polar/polar-api/versions/964f974aceff/schema)
