Create a file upload session for a message attachment.
Create a file upload session for a message attachment. The request enforces thread membership and content visibility for the authenticated caller.
Authorizations
Bearer JWT token or API Key (sk-*).
Body
Retention for the finalized file. Duration starts at finalization; null means no expiration.
Parent folder id. Required for create mode when uploading into a folder.
"00000000-0000-4000-8000-000000000000"
Optional configured storage id for root-level uploads. Omit for managed default storage. Ignored when parentStorageEntryId is provided or when replacing an existing file.
"00000000-0000-4000-8000-000000000001"
Existing storage entry id to replace instead of creating a new file.
"00000000-0000-4000-8000-000000000002"
Expected current version of the file being replaced. The upload is rejected if the file changed after overwrite confirmation.
x >= 03
File name. Required for create mode.
"contracts.csv"
Expected content type.
"text/csv"
Expected size in bytes.
x >= 01048576
Logical storage lifecycle tier. Select only when creating a new file or upload session; existing files keep their tier. HOT: Active files used in live workflows, previews, and frequent downloads. WARM: Completed or less-active business files that are still occasionally accessed. COLD: Compliance snapshots, historic imports, and retained evidence that is rarely opened. FROZEN: Deep archive or legal-hold data kept mainly for audit or recovery obligations.
HOT, WARM, COLD, FROZEN "HOT"
Upload mode. Use "direct" for provider resumable uploads, "chunked" for explicit numbered parts, and "incremental" for server-assigned part numbering by default. Incremental sessions can still re-upload a specific part number when repairing an upload.
direct, chunked, incremental "incremental"
Default post-finalize compute mode for this upload session.
none, sync, async "async"
File metadata. Values may use any JSON type. Maximum 16 KiB and 64 top-level keys. Top-level keys starting with "__" are reserved for backend use.
Optional external reference id.
Optional external reference type.
Optional external reference version.
Whether the finalized entry should be restricted.
Explicit allowed group ids for the finalized entry.
Explicit allowed user ids for the finalized entry.
Response
OK.

