Grant Access to a Client Session

Grant a client session access to resources

Grants a client session access to one or more resources, such as Connect Webviews, user identities, and so on.

/client_sessions/grant_access

POSThttps://connect.getseam.com/client_sessions/grant_access
Authorization
Body
client_session_idstring
user_identifier_keystring
connected_account_idsarray of string
connect_webview_idsarray of string
user_identity_idsarray of string
Response

OK

Body
client_session*client_session (object)
ok*boolean
Request
const response = await fetch('https://connect.getseam.com/client_sessions/grant_access', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer API Key",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
{
  "client_session": {
    "client_session_id": "123e4567-e89b-12d3-a456-426614174000",
    "workspace_id": "123e4567-e89b-12d3-a456-426614174000",
    "created_at": "2024-11-21T06:20:56.950Z",
    "token": "text",
    "user_identifier_key": "text",
    "device_count": 0,
    "connected_account_ids": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "connect_webview_ids": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "user_identity_ids": [
      "123e4567-e89b-12d3-a456-426614174000"
    ]
  },
  "ok": false
}

Request

Specify the resources that you want a client session to be able to access by including the corresponding parameters in the request body. You can also specify an existing client session ID if desired.

Request Body Parameters

ParameterTypeDescription

client_session_id

String Optional

ID of the desired client session

user_identifier_key

String Optional

Your own internal user ID for the user to associate with the client session

connected_account_ids

Array of strings Optional

Array of IDs of the connected accounts to associate with the client session

connect_webview_ids

Array of strings Optional

Array of IDs of the Connect Webviews to associate with the client session

user_identity_ids

Array of strings Optional

Array of IDs of the user identities to associate with the client session

Sample Request

await seam.clientSessions.grant_access({
  user_identifier_key: "internal user ID 2",
  connect_webview_ids: [
    "b9f2ad01-12b7-47cf-b566-ed5d9b47e834"
  ]
})

Response

Returns a client_session containing the following properties:

PropertyDescription

token

Client session token associated with the client session

workspace_id

ID of the workspace that contains the client session

user_identifier_key

Your own internal user ID for the user

client_session_id

ID of the client session

created_at

Date and time at which the client session was created

This response also includes a Boolean ok status indicator.

Sample Response

{
  workspace_id: '398d80b7-3f96-47c2-b85a-6f8ba21d07be',
  token: 'seam_cst12GGG4LUp_AoHvcSx39aY4AoHQ7GdMDRTH',
  user_identifier_key: 'internal user ID 2',
  created_at: '2023-12-26T05:11:55.048Z',
  client_session_id: '911b4a3f-e566-44a9-a8ac-267d9e586754',
  connected_account_ids: [
      '3ea0b67f-649f-4131-bfe3-f2035e77a3f9',
      '6e1cad57-b244-40ca-b4f3-30a46c8000d4'],
  connect_webview_ids: [
      'b9f2ad01-12b7-47cf-b566-ed5d9b47e834'],
  user_identity_ids: [
      '5c945ab5-c75e-4bcb-8e5f-9410061c401f'],
  device_count: 4
}

Last updated

Logo

© Seam Labs, Inc. All rights reserved.