Skip to main content

Create a file upload

Creates a new file upload and returns a one-time upload_url that you can upload the file contents to using PUT.

  • Returns a pre-signed upload_url valid for 5 minutes
  • Upload must be completed within 24 hours, otherwise it will be deleted
  • Maximum file size: 5GB (also subject to workspace plan limits)
  • Rate limit: 5 requests per minute

After the upload finishes, call POST /api/files/{id}/complete to finalize the file and receive a file object.

Parameters

filename
string
required
Name of the file to be uploaded.

Returns

Returns an object with id and upload_url.

Upload the file contents

Use the returned upload_url to upload the raw file bytes. Make sure to set Content-Type to the file's actual MIME type.

curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/pdf" \
--data-binary @"./your-file.pdf"
post
/api/files
curl -X POST https://{workspace}.kitchen.co/api/files \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Requested-With: XMLHttpRequest' \
-H 'Authorization: Bearer {API_KEY}'
Response
{
"id": "fi_081dcab571f6c37d709078ce",
"upload_url": "https://ktn.example.r2.cloudflarestorage.com/u/pjk3q6xn4l0wm58z/69f0aca4b40be-002363.pdf?x-amz-acl=private&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=REDACTED%2F20260428%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20260428T124836Z&X-Amz-SignedHeaders=host%3Bx-amz-acl&X-Amz-Expires=300&X-Amz-Signature=REDACTED"
}