> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seam.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Grant Access to a Client Session

> Grants a [client session](/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](/core-concepts/connect-webviews), [user identities](/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on.



## OpenAPI

````yaml /openapi.json post /client_sessions/grant_access
openapi: 3.0.0
info:
  title: Seam Connect
  version: 1.0.0
servers:
  - url: https://connect.getseam.com
security: []
tags:
  - description: access_codes
    name: /access_codes
  - description: acs
    name: /acs
  - description: action_attempts
    name: /action_attempts
  - description: client_sessions
    name: /client_sessions
  - description: connected_accounts
    name: /connected_accounts
  - description: connect_webviews
    name: /connect_webviews
  - description: devices
    name: /devices
  - description: events
    name: /events
  - description: health
    name: /health
  - description: locks
    name: /locks
  - description: networks
    name: /networks
  - description: noise_sensors
    name: /noise_sensors
  - description: phones
    name: /phones
  - description: thermostats
    name: /thermostats
  - description: user_identities
    name: /user_identities
  - description: webhooks
    name: /webhooks
  - description: workspaces
    name: /workspaces
paths:
  /client_sessions/grant_access:
    post:
      tags:
        - /client_sessions
      summary: Grant Access to a Client Session
      description: >-
        Grants a [client
        session](/core-concepts/authentication/client-session-tokens) access to
        one or more resources, such as [Connect
        Webviews](/core-concepts/connect-webviews), [user
        identities](/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity),
        and so on.
      operationId: clientSessionsGrantAccessPost
      requestBody:
        content:
          application/json:
            schema:
              properties:
                client_session_id:
                  description: >-
                    ID of the client session to which you want to grant access
                    to resources.
                  type: string
                connect_webview_ids:
                  description: >-
                    IDs of the [Connect
                    Webviews](/core-concepts/connect-webviews) that you want to
                    associate with the client session.
                  items:
                    type: string
                  type: array
                connected_account_ids:
                  description: >-
                    IDs of the [connected
                    accounts](/core-concepts/connected-accounts) that you want
                    to associate with the client session.
                  items:
                    type: string
                  type: array
                user_identifier_key:
                  description: >-
                    Your user ID for the user that you want to associate with
                    the client session.
                  type: string
                user_identity_id:
                  description: >-
                    ID of the [user
                    identity](/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity)
                    that you want to associate with the client session.
                  type: string
                user_identity_ids:
                  deprecated: true
                  description: >-
                    Deprecated. Use `user_identity_id`.


                    IDs of the [user
                    identities](/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity)
                    that you want to associate with the client session.
                  items:
                    type: string
                  maxItems: 1
                  minItems: 1
                  type: array
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties: {}
                type: object
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      security:
        - api_key: []
        - pat_with_workspace: []
        - console_session_with_workspace: []
      x-codeSamples:
        - lang: javascript
          label: Seam SDK
          source: |-
            await seam.clientSessions.grantAccess({
              client_session_id: "3ada79d3-2848-4320-b2ef-a82e1e6dafac",
              user_identifier_key: "jane_doe",
              connected_account_ids: ["c35ecf64-474a-466a-95a6-7b35cb4c8bb4"],
              connect_webview_ids: ["dad03fb2-f801-449c-ab88-0529728c7c38"],
              user_identity_id: "bde98963-3615-4e92-943e-17de3017232b",
            });

            /*
            // void
            */
        - lang: bash
          label: cURL
          source: >-
            curl --include --request POST
            "https://connect.getseam.com/client_sessions/grant_access" \
              --header "Authorization: Bearer $SEAM_API_KEY" \
              --json @- <<EOF
            {
              "client_session_id": "3ada79d3-2848-4320-b2ef-a82e1e6dafac",
              "user_identifier_key": "jane_doe",
              "connected_account_ids": [
                "c35ecf64-474a-466a-95a6-7b35cb4c8bb4"
              ],
              "connect_webview_ids": [
                "dad03fb2-f801-449c-ab88-0529728c7c38"
              ],
              "user_identity_id": "bde98963-3615-4e92-943e-17de3017232b"
            }

            EOF


            # Response:

            # {}
        - lang: python
          label: Seam SDK
          source: |-
            seam.client_sessions.grant_access(
                client_session_id="3ada79d3-2848-4320-b2ef-a82e1e6dafac",
                user_identifier_key="jane_doe",
                connected_account_ids=["c35ecf64-474a-466a-95a6-7b35cb4c8bb4"],
                connect_webview_ids=["dad03fb2-f801-449c-ab88-0529728c7c38"],
                user_identity_id="bde98963-3615-4e92-943e-17de3017232b",
            )

            # None
        - lang: ruby
          label: Seam SDK
          source: |-
            seam.client_sessions.grant_access(
              client_session_id: "3ada79d3-2848-4320-b2ef-a82e1e6dafac",
              user_identifier_key: "jane_doe",
              connected_account_ids: ["c35ecf64-474a-466a-95a6-7b35cb4c8bb4"],
              connect_webview_ids: ["dad03fb2-f801-449c-ab88-0529728c7c38"],
              user_identity_id: "bde98963-3615-4e92-943e-17de3017232b",
            )

            # => nil
        - lang: php
          label: Seam SDK
          source: |-
            $seam->client_sessions->grant_access(
                client_session_id: "3ada79d3-2848-4320-b2ef-a82e1e6dafac",
                user_identifier_key: "jane_doe",
                connected_account_ids: ["c35ecf64-474a-466a-95a6-7b35cb4c8bb4"],
                connect_webview_ids: ["dad03fb2-f801-449c-ab88-0529728c7c38"],
                user_identity_id: "bde98963-3615-4e92-943e-17de3017232b",
            );
        - lang: bash
          label: Seam CLI
          source: >-
            seam client-sessions grant-access --client_session_id
            "3ada79d3-2848-4320-b2ef-a82e1e6dafac" --user_identifier_key
            "jane_doe" --connected_account_ids
            ["c35ecf64-474a-466a-95a6-7b35cb4c8bb4"] --connect_webview_ids
            ["dad03fb2-f801-449c-ab88-0529728c7c38"] --user_identity_id
            "bde98963-3615-4e92-943e-17de3017232b"


            # {}
components:
  securitySchemes:
    api_key:
      bearerFormat: API Key
      scheme: bearer
      type: http
    pat_with_workspace:
      bearerFormat: API Token
      scheme: bearer
      type: http
    console_session_with_workspace:
      bearerFormat: Console Session Token
      scheme: bearer
      type: http

````