---
title: "Create a new active session"
method: POST
path: "/api/active-sessions"
tags: ["Active Sessions"]
---

# Create a new active session

`POST /api/active-sessions`

## Request body

- object
  - `agentId` string, required
  - `taskId` string
  - `triggerType` string, required
  - `inboxMessageId` string
  - `taskDescription` string
  - `runnerSessionId` string
  - `runtimeInstanceId` string

## Response `201`

Session created

- object
  - `session` ActiveSession, required
    - `id` string, uuid, required
    - `agentId` string, required
    - `taskId` string, nullable, required
    - `triggerType` string, required
    - `inboxMessageId` string, nullable, required
    - `taskDescription` string, nullable, required
    - `runnerSessionId` string, nullable, required
    - `providerSessionId` string, nullable, required
    - `runtimeInstanceId` string, nullable
    - `startedAt` string, date-time, required
    - `lastHeartbeatAt` string, date-time, required

## Other responses

- `400` — Validation error

## Changes

- **2026-08-19** `ea4adca6e927` — 2 info
  - added the new optional request property `runtimeInstanceId`
  - added the optional property `session/runtimeInstanceId` to the response with the `201` status
- **2026-08-07** `06cac6a7c5bc` — 2 info
  - added the media type `application/json` for the response with the status `201`
  - added the media type `application/json` for the response with the status `400`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/active-sessions/post.md)

---

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