---
title: "Create Agent Session"
method: POST
path: "/api/v4/{workspace-slug}/agent-sessions"
---

# Create Agent Session

`POST /api/v4/{workspace-slug}/agent-sessions`

## Request

- Base URL: `https://api.app.shortcut.com`
- URL: `https://api.app.shortcut.com/api/v4/{workspace-slug}/agent-sessions`
- Auth: HTTP bearer

Create work owned by the authenticated agent on a Story or Epic. Repeated identical idempotency keys return the same session.

## Path parameters

- `workspace-slug` string, required

## Request body

- Body2522646
  - `entity_id` integer, required: The public ID of the Story or Epic.
  - `entity_type` 'story' | 'epic', required: The type of entity the session belongs to.
  - `idempotency_key` string, required: Client key that makes repeated identical requests return the same session.

## Response `201`

Resource

- AgentSession
  - `acknowledged_at` string, date-time, nullable, required
  - `agent_member_id` string, uuid, required
  - `closed_reason` string, nullable, required
  - `created_at` string, date-time, required
  - `created_by` string, uuid, required
  - `entity_id` integer, required
  - `entity_type` 'story' | 'epic', required
  - `external_urls` SessionExternalUrl[], required
    - `label` string, required
    - `url` string, required
  - `first_delivery_at` string, date-time, nullable, required
  - `id` string, uuid, required
  - `installation_id` string, uuid, required
  - `last_agent_activity_at` string, date-time, nullable, required
  - `last_delivery_error` string, nullable, required
  - `last_delivery_failed_at` string, date-time, nullable, required
  - `plan` SessionPlanItem[], required
    - `content` string, required
    - `status` 'completed' | 'in_progress' | 'pending' | 'canceled', required
  - `status` 'awaiting_input' | 'complete' | 'error' | 'stale' | 'active' | 'pending', required
  - `stop_requested_at` string, date-time, nullable, required
  - `thread_comment_id` integer, nullable, required
  - `turn` integer, required
  - `updated_at` string, date-time, required
  - `version` integer, required
  - `workspace_id` string, uuid, required

## Other responses

- `400`: Schema mismatch
- `403`: **Either:** (1) Resource does not exist **or** (2)
- `404`: **Either:** (1) Resource does not exist **or** (2)
- `409`: **Either:** (1) Resource does not exist **or** (2)
- `422`: **Either:** (1) Resource does not exist **or** (2)
- `429`: **Either:** (1) Resource does not exist **or** (2)
- `503`: **Either:** (1) Resource does not exist **or** (2)

## Changes

- **2026-10-15** `46322a38c246`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/shortcut-com/apis/shortcut-api/changes/api/v4/:workspace-slug/agent-sessions/post.md)

---

[API](https://skmtc.dev/shortcut-com/apis/shortcut-api.md) · [All operations](https://skmtc.dev/shortcut-com/apis/shortcut-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shortcut-com/apis/shortcut-api/revisions/19f70025330b?raw)
