---
title: "Create agent session"
method: POST
path: "/api/v0/agent/sessions"
tags: ["Agent"]
---

# Create agent session

`POST /api/v0/agent/sessions`

Create a new agent session, optionally linked to a persona.

## Request body

- AgentSessionCreateRequest — Request body for creating an agent session.
  - `name` string, nullable — Optional name for the session.
  - `persona_id` string, uuid, nullable — Optional persona ID. The persona defines the agent's prompt, tools, and knowledge bases. When null, uses the default persona.
  - `settings` AgentSessionSettings — Settings for an agent session.
    - `max_iterations` integer, nullable — Maximum number of agent loop iterations. When null, uses server default (30).

## Response `200`

Successful Response

- AgentSessionPostResponse — Response for creating an agent session.
  - `id` string, uuid, required — The ID of the created session.
  - `persona_id` string, uuid, nullable — The ID of the persona used by this session. Null means default persona.
  - `name` string, nullable, required — The name of the session.
  - `status` string, required — The status of the session.
  - `settings` AgentSessionSettings, required — Settings for an agent session.
    - `max_iterations` integer, nullable — Maximum number of agent loop iterations. When null, uses server default (30).
  - `is_roaming` boolean — True iff this session's persona exposes any fs_* / fs_bash tool and therefore has a workspace directory the agent reads/writes.
  - `created_at` string, date-time, required — When the session was created.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/outerport/apis/outerport-api.md) · [All operations](https://skmtc.dev/outerport/apis/outerport-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/outerport/outerport-api/revisions/f565b46daaea/schema)
