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

# [BETA] Create workspace agent session

> Create a new agent session.



## OpenAPI

````yaml https://api.getpg.ai/docs/v1/openapi.json post /agent/sessions
openapi: 3.0.0
info:
  title: PG:AI Public API
  version: 1.0.0
  description: >-
    Public API for accessing PG:AI account intelligence, contacts, territories,
    and more. All endpoints require API key authentication via the x-api-key
    header.
  contact:
    name: PG:AI Support
    url: https://www.getpg.ai
servers:
  - url: https://api.getpg.ai/public-api/v1
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /agent/sessions:
    post:
      tags:
        - agent
      summary: '[BETA] Create workspace agent session'
      description: Create a new agent session.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Session title; defaults to Untitled if omitted
                company_id:
                  type: string
                  description: Optional company UUID (scoped session)
                type:
                  type: string
                  description: Session type; defaults to chat if missing or invalid
                  enum:
                    - document
                    - chat
                    - plan
                    - canvas_settings
                    - email
                    - workspace
                    - project
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                description: Response data
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                description: Response data
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                description: Response data
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                description: Response data
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                type: object
                description: Response data
      deprecated: false
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your API key for authentication. Get your API key from the PG:AI
        dashboard under Settings > API Keys.

````