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

# Create a new active session

`POST /sessions`

Create a new active session for the provided user ID.

**This operation is intended only for use in testing, and is not available for production instances.** If you are looking to generate a user session from the backend,
we recommend using the [Sign-in Tokens](https://clerk.com/docs/reference/backend-api/tag/Sign-in-Tokens#operation/CreateSignInToken) resource instead.

## Request body

- object
  - `user_id` string, required — The ID representing the user
  - `active_organization_id` string — The ID of the organization to set as active for this session

## Response `200`

Success

- Session
  - `object` 'session', required — String representing the object's type. Objects of the same type share the same value.
  - `id` string, required
  - `user_id` string, required
  - `client_id` string, required
  - `actor` object, nullable
  - `status` 'active' | 'revoked' | 'ended' | 'expired' | 'removed' | 'abandoned' | 'replaced' | 'pending', required
  - `last_active_organization_id` string, nullable
  - `last_active_at` integer, required
  - `latest_activity` SessionActivityResponse, nullable
    - `object` string, required
    - `id` string, required
    - `device_type` string
    - `is_mobile` boolean, required
    - `browser_name` string
    - `browser_version` string
    - `ip_address` string
    - `city` string
    - `country` string
  - `expire_at` integer, required — Unix timestamp of expiration.
  - `abandon_at` integer, required — Unix timestamp of abandonment.
  - `updated_at` integer, required — Unix timestamp of last update.
  - `created_at` integer, required — Unix timestamp of creation.
  - `tasks` SessionTask[], nullable
    - `key` string, required

## Other responses

- `400` — Request was not successful
- `401` — Authentication invalid
- `404` — Request was not successful
- `422` — Invalid request parameters

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/revisions/cf036e7951d3/schema)
