Skip to main content
POST
/
client_sessions
/
get_or_create
await seam.clientSessions.getOrCreate({
  user_identifier_key: "jane_doe",
  connect_webview_ids: ["5e297cfe-23df-4638-bb87-08c4f0f8233b"],
  connected_account_ids: ["f87f0ab7-b8d7-44aa-9e59-3239b209570e"],
  user_identity_id: "71ff7f71-2cf4-458a-8db4-6ad539c8b66a",
  expires_at: "2025-06-18T06:10:42.000Z",
});

/*
{
  "client_session_id": "c2cbd177-1ace-414b-bb1e-9f129e4a05c1",
  "connect_webview_ids": [
    "5e297cfe-23df-4638-bb87-08c4f0f8233b"
  ],
  "connected_account_ids": [
    "f87f0ab7-b8d7-44aa-9e59-3239b209570e"
  ],
  "created_at": "2025-06-15T16:54:17.946309Z",
  "customer_id": "e387e15f-be27-47ad-881f-4a6fc5460c57",
  "device_count": 1,
  "expires_at": "2025-06-18T06:10:42.000Z",
  "token": "seam_cst1891oqCmD_6dBwV8PJ2Fsoe9dWYVyMfVHq",
  "user_identifier_key": "jane_doe",
  "user_identity_id": "71ff7f71-2cf4-458a-8db4-6ad539c8b66a",
  "workspace_id": "b887bf84-9849-4454-a562-cf84293d9781"
}
*/
{
  "client_session": {
    "client_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "connect_webview_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "connected_account_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "created_at": "2023-11-07T05:31:56Z",
    "device_count": 123,
    "expires_at": "2023-11-07T05:31:56Z",
    "token": "<string>",
    "user_identifier_key": "<string>",
    "user_identity_ids": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ],
    "workspace_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "customer_key": "<string>",
    "user_identity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "ok": true
}

Authorizations

seam-publishable-key
string
header
required

Body

application/json
connect_webview_ids
string[]

IDs of the Connect Webviews that you want to associate with the client session (or that are already associated with the existing client session).

connected_account_ids
string[]

IDs of the connected accounts that you want to associate with the client session (or that are already associated with the existing client session).

expires_at
string<date-time>

Date and time at which the client session should expire in ISO 8601 format. If the client session already exists, this will update the expiration before returning it.

user_identifier_key
string

Your user ID for the user that you want to associate with the client session (or that is already associated with the existing client session).

Minimum string length: 1
user_identity_id
string<uuid>

ID of the user identity that you want to associate with the client session (or that are already associated with the existing client session).

user_identity_ids
string<uuid>[]
deprecated

IDs of the user identities that you want to associate with the client session.

Required array length: 1 element

Response

OK

client_session
object
required

Represents a client session. If you want to restrict your users' access to their own devices, use client sessions.

ok
boolean
required