---
title: "Start a resumable folder upload into the workspace [write]"
method: POST
path: "/sessions/{id}/workspace/imports"
---

# Start a resumable folder upload into the workspace \[write\]

`POST /sessions/{id}/workspace/imports`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/sessions/{id}/workspace/imports`
- Auth: HTTP bearer

For folders over the single-request import's 25 MB: declare the folder's name, the gzipped tar's size (up to 2 GiB) and sha256, then send it in parts and complete. Answers the upload; its parts are numbered from 0. Or send {name, file_id}: a gzipped tar already stored as one of your files, which needs no parts and answers state verified, so complete unpacks it straight away (404 for a file you cannot see, 400 not_downloadable). 404 when resumable imports are not enabled for the workspace, 400 invalid_name or invalid_request (size, sha256 or part_size out of range).

## Path parameters

- `id` string, required

## Request body

- union
  - object
    - `name` string, required: the folder's name in the workspace, as for /workspace/import
    - `size` integer, required: bytes of the gzipped tar, at most 2 GiB
    - `sha256` string, required: hex sha256 of the whole tar
    - `part_size` integer: bytes per part, 1–16 MiB; default 8 MiB
  - object
    - `name` string, required: the folder's name in the workspace, as for /workspace/import
    - `file_id` string, required: one of your files holding the gzipped tar, at most 2 GiB

## Response `201`

Created

- object
  - `id` string
  - `name` string
  - `size` integer
  - `sha256` string
  - `part_size` integer
  - `parts` integer: how many parts the upload has
  - `received` integer[]: part numbers already stored
  - `state` 'uploading' | 'verified' | 'importing' | 'imported' | 'failed'
  - `path` string: where the folder landed, once imported
  - `files` integer: files unpacked, once imported
  - `error` object
    - `code` string
    - `message` string

## Other responses

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

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/sessions/:id/workspace/imports/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/8280a065ef6a?raw)
