---
title: "Create a persistent session that preserves working directory and environment across exec calls"
method: POST
path: "/smolmachines/v1/machines/{id}/sessions"
tags: ["Smol Machines"]
---

# Create a persistent session that preserves working directory and environment across exec calls

`POST /smolmachines/v1/machines/{id}/sessions`

## Request

- Base URL: `https://api.orthogonal.com/mpp`
- URL: `https://api.orthogonal.com/mpp/smolmachines/v1/machines/{id}/sessions`
- Auth: none declared
- TypeScript: <https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/docs/smolmachines/v1/machines/:id/sessions/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` string, required

## Request body

- object
  - `cwd` string
  - `env` object
  - `id` string

## Response `200`

Successful response

## Changes

- **2026-11-08** `857e915717f4`: 1 breaking, 1 info
  - added the new path request parameter `id`
  - added optional request body
- **2026-08-21** `bf5b6f84d6e0`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/changes/smolmachines/v1/machines/:id/sessions/post.md)

---

[API](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace.md) - [All operations](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/llms.txt) - [OpenAPI document](https://skmtc.dev/orthogonal/apis/orthogonal-api-marketplace/revisions/f3e9572f3f12?raw)
