---
title: "Upload a file — universe-scoped; images are readable back, other uploads are write-once [write]"
method: POST
path: "/files"
tags: ["files"]
---

# Upload a file — universe-scoped; images are readable back, other uploads are write-once \[write\]

`POST /files`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/files`
- Auth: HTTP bearer

multipart/form-data with a `file` part and an optional `expires_in_seconds` (3600–7776000). 32 MiB per file (413 file_too_large); upload larger files through POST /files/uploads. Reference the returned id from a message as `{"type":"image","source":{"type":"file","file_id":"file_…"}}` or a `document` block.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required
  - `expires_in_seconds` integer

## Response `200`

OK

- File
  - `type` 'file', required
  - `id` string, required: file_…
  - `created_at` string, date-time, required
  - `filename` string, required
  - `mime_type` string, required
  - `size_bytes` integer, required
  - `downloadable` boolean, required: true for image uploads (readable within the workspace) and for the per-session copies minted when a file rides a message; false for other uploads (write-once)
  - `attach_by_default` boolean, required: Whether every new session in the workspace starts with a read-only copy under /workspace/shared/
  - `expires_at` string, date-time, nullable, required
  - `canonical` object: Optional reference for a currently readable canonical execution-generated meeting file. Ordinary uploads and older unprojected Recall files omit it. This is a discovery reference, not a permission grant: read GET /artifacts/{artifact_id} for current can_discuss and other authoritative controls before using existing private history/comments/policy/delete operations. Generated content remains read-only; no public sharing is implied.
    - `artifact_id` string, required
    - `origin` 'execution', required
    - `version` integer, required

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 2 info
  - added the optional property `canonical` to the response with the `200` status
  - added the optional property `error/request_id` to the response with the `default` status

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/files/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/0d435187cd55?raw)
