Create an upload session
Prepare a local file upload for an agent that can read the bytes and make HTTP PUT calls outside MCP. Returns upload_url, method, exact headers, upload_id and instructions. Send the original raw bytes with the returned temporary Authorization header, never a workspace API key or OAuth token. The upload capability expires after 10 minutes and permits one PUT attempt. After success, send upload_id to create a translation on the same credential within one hour. Costs no credits. Maximum 20 pending uploads and 120 sessions per hour per workspace.
POST/v1/uploads
Requires batches:create. Creating a session costs no credits and does not create a translation. Send a bare filename with its supported extension and the exact size of the original bytes:
{ "filename": "catalogue.xlsx", "size_bytes": 4096 }The response contains upload_id, upload_url, method, headers, expires_at, consume_until and human-readable instructions. Use the returned URL and headers exactly with an external HTTP client, then create the translation with upload_id on the same credential. The filename is already attached to the session.
const session = createUploadResponse.data;
const uploaded = await fetch(session.upload_url, {
method: session.method,
headers: session.headers,
body: originalFileBytes,
redirect: "error",
});
if (!uploaded.ok) throw new Error(`Upload failed: ${uploaded.status}`);
// Use the original workspace credential for POST /v1/batches:
// { upload_id: session.upload_id, instruction: "Translate into French" }The temporary Authorization header grants only one upload attempt for this document within 10 minutes. The URL alone grants no access. Never replace that header with a workspace API key or OAuth token, put secrets in a URL, follow redirects, or log the temporary headers. The upload secret cannot read documents, create translations or approve spending. Revoking the connection or removing its permission invalidates its unused upload capabilities.
The received byte count must match size_bytes; the per-format limit is checked before the capability is issued. Create the translation within one hour. A workspace can have 20 pending uploads and create 120 sessions per hour. Unused files are eligible for cleanup after 24 hours and collected by the daily sweep. Once a translation owns the file, its normal retention applies. 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.
Requirements for agents
The agent runtime needs local file access and an HTTP client that can send raw PUT requests. MCP alone cannot send binary bytes, and AI Glot Code Mode has no local file access or outbound HTTP. If those capabilities are missing, tell the user plainly that the assistant cannot send the attachment. Recommend uploading in the AI Glot web app, using the CLI, or providing an HTTPS download link for file_url. Never claim that an upload succeeded without verifying it.
After upload, review the translation plan and its exclusions before approving the credit cost. Send raw bytes describes retries and failures.
Response
Create a temporary file upload session
dataobjectrequiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_credits
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required, file_retention_expired
errorobjectrequiredrequest_idstringrequiredPossible codes: batch_not_found, glossary_not_found, resource_not_found
errorobjectrequiredrequest_idstringrequiredPossible codes: glossary_already_exists, result_not_ready, batch_not_editable, no_plan_yet, batch_not_awaiting_approval
errorobjectrequiredrequest_idstringrequiredPossible codes: file_expired
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large, file_too_large, result_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: language_not_supported, invalid_language_pair, glossary_term_limit_reached, glossary_limit_reached, invalid_glossary_terms, unsupported_format, file_fetch_failed, plan_invalid
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired