Skip to main content
POST
/
api
/
files
Create File
curl --request POST \
  --url https://api.rapidly.tech/api/files/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "mime_type": "<string>",
  "size": 123,
  "upload": {
    "parts": [
      {
        "number": 123,
        "chunk_start": 123,
        "chunk_end": 123,
        "checksum_sha256_base64": "<string>"
      }
    ]
  },
  "service": "<string>",
  "workspace_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
  "checksum_sha256_base64": "<string>",
  "version": "<string>"
}
'
{
  "id": "<string>",
  "workspace_id": "<string>",
  "name": "<string>",
  "path": "<string>",
  "mime_type": "<string>",
  "size": 123,
  "storage_version": "<string>",
  "checksum_etag": "<string>",
  "checksum_sha256_base64": "<string>",
  "checksum_sha256_hex": "<string>",
  "last_modified_at": "2023-11-07T05:31:56Z",
  "upload": {
    "id": "<string>",
    "path": "<string>",
    "parts": [
      {
        "number": 123,
        "chunk_start": 123,
        "chunk_end": 123,
        "url": "<string>",
        "expires_at": "2023-11-07T05:31:56Z",
        "checksum_sha256_base64": "<string>",
        "headers": {}
      }
    ]
  },
  "version": "<string>",
  "service": "downloadable",
  "size_readable": "<string>",
  "is_uploaded": false
}

Authorizations

Authorization
string
header
required

Create an Workspace Access Token in your workspace's settings page.

Body

application/json

Upload a downloadable file (max 5 GB).

name
string
required
mime_type
string
required

MIME type of the file. Executables and potentially dangerous script types are not allowed for security reasons.

Pattern: ^(application/(pdf|msword|vnd\.openxmlformats-officedocument\..+|vnd\.oasis\.opendocument\..+|rtf|epub\+zip)|application/(zip|x-zip-compressed|x-rar-compressed|x-7z-compressed|x-tar|gzip|x-bzip2)|application/(json|xml|octet-stream)|image/(jpeg|png|gif|webp|svg\+xml|bmp|tiff|x-icon)|audio/(mpeg|wav|ogg|flac|aac|x-m4a)|video/(mp4|webm|ogg|quicktime|x-msvideo|x-matroska)|text/(plain|csv|markdown|x-python|x-java|x-c|x-c\+\+|x-ruby)|font/(ttf|otf|woff|woff2))$
size
integer
required

Size of the file. A maximum of 5 GB is allowed for downloadable files.

Required range: x <= 5368709120
upload
S3FileCreateMultipart · object
required
service
string
required
Allowed value: "downloadable"
workspace_id
string<uuid4> | null

The workspace ID.

Example:

"1dbfc517-0bbf-4301-9ba8-555ca42b9737"

checksum_sha256_base64
string | null
version
string | null

Response

File created.

id
string<uuid4>
required

The ID of the object.

workspace_id
string<uuid4>
required
name
string
required
path
string
required
mime_type
string
required
size
integer
required
storage_version
string | null
required
checksum_etag
string | null
required
checksum_sha256_base64
string | null
required
checksum_sha256_hex
string | null
required
last_modified_at
string<date-time> | null
required
upload
S3FileUploadMultipart · object
required
version
string | null
required
service
enum<string>
required

Discriminator values for the polymorphic File hierarchy.

Available options:
downloadable,
product_media,
workspace_avatar
size_readable
string
required
is_uploaded
boolean
default:false