# Create a session

Launch stage: Beta

`POST /api/2.0/agents/{parent=session-stores/*}/sessions`

Creates a session within a session store.

API scopes: agent-kit

## Path parameters

- `parent` (string, required)
  Resource name of the containing session store, in the form
   `session-stores/{session_store_id}`.

## Query parameters

- `session_id` (string, optional)
  Optional caller-selected session ID. The service generates a UUID when this field is omitted.
   The ID must be unique; a collision returns `ALREADY_EXISTS`.

## Request body

The session to create. `actor_id` is required. A session with `parent_session_id` is a child and
 must use its parent's `actor_id`. Independent forks are created only through `ForkSession`.
- `actor_id` (string, required, Immutable)
  Opaque caller-provided identifier for the application actor associated with the session.
  
   This is application data and has no Databricks authentication or authorization semantics.
   Use the same value as the Managed Memory Entry `actor_id` when storing memories associated
   with this actor. Every session must set it. A child session must use the same value as its parent.
- `parent_session_id` (string, optional, Immutable)
  Immediate parent session ID. Set only at creation for child sessions, immutable thereafter, and
   restricted to the same store.
- `metadata` (object, optional)
  Mutable caller-defined string labels.

## Returns

Returns the Session object.

## Response

```json
{
  "session_id": "string",
  "actor_id": "string",
  "parent_session_id": "string",
  "root_session_id": "string",
  "metadata": {},
  "create_time": "string",
  "update_time": "string",
  "last_activity_time": "string",
  "name": "string"
}
```

