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

# Create workspace session

> Create a user session from any app within a workspace using workspace API key



## OpenAPI

````yaml /swagger.json post /v1/workspaces/{id}/sessions
openapi: 3.0.1
info:
  title: Scute API
  version: v1
  description: API for managing users in Scute applications
servers:
  - url: https://{defaultHost}
    variables:
      defaultHost:
        default: api.scute.io
  - url: http://localhost:3333
    description: Development server
security:
  - apiSecret: []
    userAccess: []
paths:
  /v1/workspaces/{id}/sessions:
    post:
      tags:
        - Workspace Sessions
      summary: Create workspace session
      description: >-
        Create a user session from any app within a workspace using workspace
        API key
      operationId: createWorkspaceSession
      parameters:
        - name: id
          in: path
          required: true
          description: Workspace ID
          schema:
            type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  access:
                    type: string
                    description: JWT access token
                  refresh:
                    type: string
                    description: JWT refresh token
                  csrf:
                    type: string
                    description: CSRF token
                  access_expires_at:
                    type: string
                    format: datetime
                    description: Access token expiration
                  refresh_expires_at:
                    type: string
                    format: datetime
                    description: Refresh token expiration
                  user_id:
                    type: string
                    description: App user ID
                  key_id:
                    type: string
                    description: Workspace key ID for verification
                  app_id:
                    type: string
                    description: App ID that the session was created for
                required:
                  - access
                  - user_id
                  - app_id
        '401':
          description: unauthorized - invalid workspace API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Workspace API key required
                  error_code:
                    type: string
                    example: workspace_api_key_required
        '403':
          description: forbidden - workspace access denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Workspace access denied
                  error_code:
                    type: string
                    example: workspace_access_denied
        '404':
          description: not found - app not in workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: App not found in workspace
                  error_code:
                    type: string
                    example: app_not_in_workspace
      security:
        - apiSecret: []
          userAccess: []
components:
  securitySchemes:
    apiSecret:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Secret token
    userAccess:
      type: apiKey
      name: X-Authorization
      in: header
      description: User Access token

````