---
title: "Create file"
method: POST
path: "/orgs/files"
tags: ["Workspace"]
---

# Create file

`POST /orgs/files`

## Request

- Base URL: `https://api.useinvent.com`
- URL: `https://api.useinvent.com/orgs/files`
- Auth: HTTP bearer

Create a new file.

## Request body

- object: CreateOrgFileSchema
  - `file` union: File to be uploaded. It can be a file object, a base64 encoded string, or a file data object containing base64 data, name, and type.
    - string, binary
    - FileDataSchema: Data payload for creating a file
      - `data` string, required: URL, Raw or Base64 encoded file data.
      - `type` string: Mime type of the file, if not provided it will be inferred.
      - `name` string: Name of the file.
      - `encoding` 'base64' | 'raw': Encoding of the file data when it's a direct input, by default base64 is expected.
    - string
  - `file_url` string: URL of the file to be uploaded
  - `allowed_types` string[]: The allowed mime types for the file field (e.g. image/*, application/pdf)
  - `visibility` 'PUBLIC' | 'PRIVATE': Whether the file is private or public, private files URLs are signed with a token and can be accessed temporarily

## Response `200`

- FileSchema: Detailed information about a file
  - `id` string, required: Unique identifier for the file
  - `file_path` string, required: Path to the file in the storage system
  - `file_filename` string, required: Name of the file
  - `file_size` number, required: Size of the file in bytes
  - `file_mimetype` string, required: MIME type of the file
  - `file_url` string, required: URL to access the file
  - `created_at` string, date-time, nullable, required: Timestamp when the file was created

---

[API](https://skmtc.dev/useinvent/apis/invent-api.md) · [All operations](https://skmtc.dev/useinvent/apis/invent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/useinvent/apis/invent-api/revisions/98824f3fde82?raw)
