Skip to main content
POST
/
lucca-api
/
files
Upload a file
curl --request POST \
  --url https://{host}/lucca-api/files \
  --header 'Api-Version: <api-version>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form form='@example-file'
{
  "id": "2face165-5345-4cf3-ab05-5421a6b19df2",
  "type": "file",
  "url": "https://example.ilucca.net/lucca-api/files/2face165-5345-4cf3-ab05-5421a6b19df2",
  "fileName": "pic.jpg",
  "contentType": "image/jpg",
  "createdAt": "2024-01-15T08:30:00Z",
  "links": {},
  "embedded": {}
}
This API endpoint is in beta and may be subject to changes, including breaking changes, without prior notice.
OAuth 2.0 scopes
 files.readwrite

Authorizations

Authorization
string
header
required

The Lucca API implements the oAuth 2 protocol with the client-credentials-flow. Refer to RFC8725.

Headers

Api-Version
enum<string>
required

Set the API version.

Available options:
2024-11-01
Allowed value: "2024-11-01"
Maximum string length: 10
Example:

"2024-11-01"

If-None-Match
string

Only execute the request if current cached version of the resource does not match the one given here.

Example:

"W/q5sd4w2x1c1gfdg"

If-Match
string

Only execute the request if current cached version of the resource matches the one given here. Useful to avoid concurrency conflicts.

Example:

"W/q5sd4w2x1c1gfdg"

Accept-Encoding
string

List of compression algorithms you support.

Query Parameters

include
enum<string>[]

Include metadata:

  • embedded: the partial or complete representations of related resources (e.g. the employee the resource belongs to).
  • links: links to related resources or actions (e.g. approving a leave-request). May be null when you do not have access to the resource (or action).
  • totalCount: only applicable on collections (i.e. lists of resources), gives the total number of items across all pages.

Read more about expanding responses.

Available options:
embedded,
links,
totalCount

Body

multipart/form-data
form
file

Response

File successfully uploaded.

JSON representation of a file. A file may be downloaded via the Accept: octet-stream HTTP header.

id
string
Minimum string length: 1
type
string
Allowed value: "file"
url
string<uri>
fileName
string
Minimum string length: 1
contentType
enum<string>

Indicates the content-type of the file. Refer to the enum values to figure out which are accepted.

Available options:
message/rfc822,
binary/octet-stream,
unknown/unknown,
audio/mpeg,
video/mp4,
image/png,
image/heic,
image/heif,
image/jpe,
image/jpg,
image/pjpeg,
image/gif,
image/bmp,
image/tif,
image/tiff,
image/x-dcraw,
image/x-jb2,
image/x-jbig2,
image/x-jpf,
image/x-ms-bmp,
image/x-panasonic-raw,
image/x-pcx,
image/x-icon,
image/x-png,
image/vnd.microsoft.icon,
image/webp,
image/svg+xml,
image/x-portable-anymap,
text/plain,
text/csv,
text/rtf,
text/calendar,
text/comma-separated-values,
text/css,
text/html,
text/xml,
text/markdown,
text/x-affix,
application/pdf,
application/msword,
application/xls,
application/x-csv,
application/ms-excel,
application/vnd.ms-office,
application/vnd.ms-word,
application/vnd.ms-outlook,
application/vnd.ms-powerpoint,
application/vnd.ms-excel,
application/vnd.ms-excel.sheet.binary.macroEnabled.12,
application/vnd.ms-excel.sheet.macroEnabled.12,
application/vnd.ms-pki.stl,
application/vnd.ms-xpsdocument,
application/vnd.oasis.opendocument.text,
application/vnd.oasis.opendocument.spreadsheet,
application/vnd.oasis.opendocument.presentation,
application/vnd.oasis.opendocument.graphics,
application/vnd.openxmlformats-officedocument.wordprocessingml.document,
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,
application/vnd.openxmlformats-officedocument.presentationml.presentation,
application/vnd.openxmlformats-officedocument.presentationml.slideshow,
application/vnd.openxmlformats-officedocument.presentationml.template,
application/x-7z-compressed,
application/rar,
application/x-rar,
application/zip,
application/andrew-inset,
application/binary,
application/csv,
application/download,
application/force-download,
application/x-download,
application/hta,
application/javascript,
application/json,
application/mac-binhex40,
application/oleobject,
application/pkcs7-signature,
application/postscript,
application/rtf,
application/text,
application/txt,
application/unknown,
application/x-iwork-keynote-sffkey,
application/x-ms-application,
application/x-ms-manifest,
application/x-msdownload,
application/x-pdf,
application/x-unknown,
application/x-zip-compressed,
application/xml,
application/x-wine-extension-ini,
application/vnd.hp-hpgl,
application/x-sega-pico-rom
createdAt
string<date-time-offset>

Read-only. UTC timestamp of the moment this object was created.

Example:

"2023-01-23T12:45:23.1234Z"

embedded
object

No embedded resources on a file response. Expect an empty object if embedded are requested.