TurboFiles

Create a File

Creates a file with given attributes.

POST
/ v1 / files
Use the provided signed URL to upload the actual file content.
Attributes
format
The format of the file.
size
The size of the file in bytes.

Returns

Returns a File object
curl -X "POST" "https://api.turbofiles.io/v1/files" \
  -H 'Accept: application/vnd.api+json' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Authorization: Bearer {api_key}' \
  -d $'{
  "data": {
    "type": "files",
    "attributes": {
      "format": "png",
      "size": 1901020
    }
  }
}'
{
  "jsonapi": {
    "version": "1.1"
  },
  "links": {
    "self": "https://api.turbofiles.io/v1/files/a8fhd83jpk.png"
  },
  "data": {
    "type": "files",
    "id": "a8fhd83jpk.png",
    "attributes": {
      "format": "png",
      "size": 1901020,
      "created_at": "2023-11-07T05:31:56Z",
      "updated_at": "2023-11-07T05:31:56Z"
    },
    "links": {
      "self": "https://api.turbofiles.io/v1/files/a8fhd83jpk.png",
      "upload": "https://turbofiles-storage.s3-accelerate.amazonaws.com/public/a8fhd83jpk.png"
    }
  }
}