---
title: "Create a durable connect session"
method: POST
path: "/v1/users/{user_id}/connect-sessions"
tags: ["Users"]
---

# Create a durable connect session

`POST /v1/users/{user_id}/connect-sessions`

## Request

- Base URL: `http://0.0.0.0:3000`
- URL: `http://0.0.0.0:3000/v1/users/{user_id}/connect-sessions`
- Auth: none declared

Creates a durable connect session for invisible end-user onboarding. The session can be used from a partner app, email recovery flow, CLI handoff, or agent-driven flow and is exchanged into fresh pit_ tokens during provider OAuth. Partner credentials may create a session for any provisioned user. A user sk_ token may create a session for its own user only; in that case an existing active session with more than a day left is returned, otherwise a fresh one is minted. pit_ tokens are not accepted on this route.

## Path parameters

- `user_id` string, uuid, required

## Request body

- object
  - `client_id` string
  - `provider` 'gmail' | 'outlook' | 'slack' | 'google_calendar' | 'google_meet' | 'teams'
  - `display` 'popup' | 'redirect'
  - `return_to` string, uri
  - `include_install` boolean

## Response `200`

Default Response

- object
  - `success` true, required
  - `data` object, required
    - `session_id` string, uuid, required
    - `user_id` string, uuid, required
    - `activation_url` string, required
    - `expires_at` string, required
    - `organization_name` string, required
    - `partner_name` string, nullable, required
    - `recommended_provider` 'gmail' | 'outlook' | 'slack' | 'google_calendar' | 'google_meet' | 'teams', nullable, required
    - `connected_providers` string[], required
    - `cli` object, nullable, required
      - `command` string, required
      - `json_command` string, required
      - `install_claude_code` string, required
      - `install_cursor` string, required
      - `install_claude_desktop` string, required
    - `install` object, nullable, required
      - `claude_code` object, required
        - `client` string, required
        - `recommended_scope` string, required
        - `command` string, required
        - `config_path` string, required
        - `config` object, required
      - `cursor` object, required
        - `client` string, required
        - `install_url` string, required
        - `deeplink_url` string, required
        - `config` object, required
      - `claude_desktop` object, required
        - `client` string, required
        - `config_path` string, required
        - `config` object, required
      - `chatgpt` object, required
        - `client` string, required
        - `beta` boolean, required
        - `url` string, required
        - `note` string, required
      - `codex` object, required
        - `client` string, required
        - `config_path` string, required
        - `config_toml` string, required
        - `login_command` string, required
        - `note` string, required

## Other responses

- `400`: Default Response
- `401`: Default Response
- `403`: Default Response
- `404`: Default Response
- `429`: Default Response
- `500`: Default Response

---

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