domains.files by GET /config; use that value as FILES_BASE_URL below. A bearer token must have the required file action for the target path. The Python, TypeScript, Dart, and Rust SDK Files clients discover the domain and send the token for you.
This API is separate from the connected Room Storage API. A room Files target has the same persistent files but uses HTTP requests directly, including when no room runtime is active.
Native REST paths
Room files use${FILES_BASE_URL}/{project_id}/rooms/{room_name}/{path}. Managed-agent files use ${FILES_BASE_URL}/{project_id}/agents/{agent_name}/{path}. Paths are relative to the target’s files root. URL-encode each path component; retain / between components.
{target-root} is the room or agent URL ending at its name, with no file path. GET and HEAD expose ETags for concurrency control. For a conditional replacement, send the last observed ETag in If-Match on PUT. A stale ETag returns 412 Precondition Failed; reread, merge, and retry. If-None-Match: * on PUT creates only when absent and returns 412 if the file exists. ?overwrite=false has the same create-only behavior but returns a conflict response when the path exists. Other If-None-Match values and If-Unmodified-Since on PUT are unsupported. Conditional DELETE, copy, and move are unsupported. See conditional uploads for SDK examples.
S3-compatible interface
The same files domain accepts AWS Signature Version 4 requests using short-lived Files credentials issued for a room or managed-agent target.POST /v1/credentials accepts {"target":{"project_id":"...","kind":"room","name":"..."},"policy":null,"expires_in":3600} with bearer authentication and returns an access key ID, secret access key, effective policy, and expiry. Credentials remain scoped to their target and grants. The S3 adapter uses that target’s name as the bucket name; the project and target kind remain part of the signed request path. Use the native Files SDK or a presigned URL if you do not need an S3 client.
For a room, configure an S3 client’s endpoint as ${FILES_BASE_URL}/{project_id}/rooms, use path-style addressing, and set its bucket to {room_name}. For an agent, use ${FILES_BASE_URL}/{project_id}/agents and the agent name as the bucket. For example, after obtaining a Files credential:
HeadBucket, ListObjectsV2, GetObject, HeadObject, PutObject, DeleteObject, DeleteObjects, same-target CopyObject, and multipart create, upload part, list parts, complete, and abort. PutObject, CopyObject, and multipart completion support destination If-Match and If-None-Match: * conditions. CopyObject also supports ETag-based x-amz-copy-source-if-match and x-amz-copy-source-if-none-match. The source condition is checked against the version read for the copy, and the destination condition is enforced when the copy is published. Multipart completion accepts verified per-part checksum fields and full-object checksum headers. This is an operation subset, not a complete AWS S3 implementation.
The adapter returns S3 NotImplemented for these requests:
- Object version IDs on get, head, and delete, and part-number reads on get and head. Files ETags and backend versions do not provide an S3 object-version history.
- ACLs, object locks, tagging, and server-side encryption controls on
PutObject; multipart initiation also rejects a requested storage class and several other optional controls. - Date-based copy-source conditions, non-
*destinationIf-None-Match, and copy metadata or tagging directives. A copy that names another bucket or a source version is rejected withAccessDeniedinstead. - Non-
/delimiters orFetchOwner=trueinListObjectsV2. - Selected multipart options, including ACLs, tagging, storage class, encryption controls, expected bucket owner, requester-pays, initiation-time conditions, and composite completion checksums. Completion can verify full-object checksum headers against the selected parts and compare per-part checksum fields with the verified checksums stored at part upload.