---
title: "Send file bytes"
description: "Send the original raw file bytes to a temporary upload URL using its upload-only secret, then recover safely from interrupted requests."
canonical: "https://ai-glot.com/docs/api/uploads/send"
updated: "2026-10-02"
---

# Send file bytes

Use the `upload_url`, `method` and `headers` returned by [creating an upload session](/docs/api/uploads/create). This endpoint requires the temporary upload-only `Authorization` header. A workspace API key or OAuth access token cannot authorize this request.

Send the file itself as the HTTP body with `Content-Type: application/octet-stream`. Do not wrap it in JSON, base64 or multipart. `Content-Length`, if supplied, must equal the session's `size_bytes`. Requests without that header are still bounded by the expected size. Compressed HTTP bodies are refused; send the original document bytes.

A successful response contains `upload_id`, `uploaded: true` and `size_bytes`. Continue by sending `upload_id` to [create a translation](/docs/api/translations/create) with the same workspace credential that created the session. Only approval starts the translation and spends credits.

## Recovering safely

One session permits one PUT attempt. Concurrent requests and repeated PUT requests cannot replace its file. A failed or interrupted attempt needs a new session.

If the upload response was lost, first try creating the translation with the existing `upload_id`. A complete upload is retained even if the client did not receive its success response. If no complete upload exists, request a new session and send the file again. Never resend bytes to overwrite the old session. Recovery by upload\_id is available until session cleanup, at least 24 hours after issuance. Keep the batch ID to retrieve the translation from your history afterwards.

An expired upload returns `file_expired`. A PUT after the capability has been used returns `batch_not_editable`. A different connection or workspace cannot consume the upload. Incomplete bytes or an incorrect size return `invalid_parameter`; bytes beyond the session size return `file_too_large`.

This binary endpoint is called by an external HTTP client, not by an MCP tool or an AI Glot Code Mode script. If your assistant cannot access the original file or make a PUT request, tell the user and offer the web app, CLI or an HTTPS download link. Never disclose the temporary secret in your explanation.
