Create a File
Please note: If you include "filename" and "fileversion" elements, a new version will be created and served.
POST https://{region}.getafile.io/api/v1/teams/:team_id/file
This endpoint allows you to create a file.
Path Parameters
team_id*
integer
ID of the team
Request Body
description*
string
Description of the file for social sharing
published*
integer
Published: 0 or 1
type*
string
Type of File (image, document, video)
name*
string
Reference name for the File
url*
string
URL where the FIle can be accessed
domain_id*
string
ID of the Domain
path_id*
integer
ID of the File Path
fileversion
string
Base64 file data for the first version
fileversion_url
string
URL of a file to use as the first version. It must be a publicly accessible URL.
filename
string
Name of the file for the first version
ips
string
Restrict access to the File to IP addresses: eg. xxx.xx.xxx.xxx, xx.xxx.xx.x
password
string
Password protect the File
download_only*
integer
This forces the file to always be downloaded: 0 or 1
domaincustom*
array
An array of custom domain IDs
tags*
array
An array of tags to attach to the file
optimizer_enabled*
number
Optimize file versions (only applies to file type "image"): 0 or 1
optimizer_quality*
number
Desired image quality after optimizing: Min 10, Max 100
serving_type*
string
The type of content to serve. Values: file: Uploaded files content: File content will be managed in the Getafile code editor (Javascript / CSS only).
content
string
The Javascript / CSS content of the first version when the serving type is content
external_id
string
External ID from another platform for reference
Last updated
Was this helpful?