Skip to main content
GET
/
v1
/
sessions
/
{session_id}
/
workspace.zip
curl "https://api.dari.dev/v1/sessions/sess_123/workspace.zip" \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -o workspace-sess_123.zip
Content-Type: application/zip
Content-Disposition: attachment; filename="workspace-sess_123.zip"

<zip file bytes>

Documentation Index

Fetch the complete documentation index at: https://docs.dari.dev/llms.txt

Use this file to discover all available pages before exploring further.

Downloads the current files in a session’s /workspace directory as a zip file. Use this endpoint after a session has run when you need to retrieve files an agent created or modified during the session. By default, the response includes the full /workspace directory. To download only specific subdirectories, repeat the path query parameter. Paths are interpreted relative to /workspace, so reports and /workspace/reports refer to the same directory.
curl "https://api.dari.dev/v1/sessions/sess_123/workspace.zip" \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -o workspace-sess_123.zip
curl "https://api.dari.dev/v1/sessions/sess_123/workspace.zip?path=reports&path=logs" \
  -H "Authorization: Bearer $DARI_API_KEY" \
  -o workspace-subdirs.zip

Path Parameters

session_id
string
required
Session ID.

Query Parameters

path
string
Optional workspace subdirectory to include in the zip. Repeat this parameter to include multiple subdirectories. Omit it to download the full /workspace directory.

Headers

Authorization
string
required
Bearer token using your Dari API key.

Response

A successful response returns 200 OK with Content-Type: application/zip. The body is the zip file bytes, and the Content-Disposition header suggests a filename like workspace-sess_123.zip.
Content-Type: application/zip
Content-Disposition: attachment; filename="workspace-sess_123.zip"

<zip file bytes>

Errors

A missing or invalid API key returns 401. If the session does not exist, the API returns 404. If the API key belongs to a different organization than the session, the API returns 403. If the requested workspace path is invalid, does not exist, or is not a directory, the API returns 400. If the session does not have a workspace available to download yet, the API returns 409; run the session first, then retry after the agent has started work.