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

# Create session

> Creates a session. 
A session refers to the continuous interaction between the user and Powerdrill within a conversation. Your team can have up to 150 sessions simultaneously. If the limit is reached, you can remove unnecessary sessions to make space for new ones.



## OpenAPI

````yaml post /v1/team/sessions
openapi: 3.0.1
info:
  title: Team Open API
  description: ''
  version: 1.0.0
servers:
  - url: https://ai.data.cloud/api
    description: 体验环境
security: []
tags:
  - name: Session
  - name: Dataset
  - name: Data source
  - name: File
  - name: Job
paths:
  /v1/team/sessions:
    post:
      tags:
        - Session
      summary: Create session
      description: >-
        Creates a session. 

        A session refers to the continuous interaction between the user and
        Powerdrill within a conversation. Your team can have up to 150 sessions
        simultaneously. If the limit is reached, you can remove unnecessary
        sessions to make space for new ones.
      parameters:
        - name: x-pd-external-trace-id
          in: header
          description: The external trace ID. The length ranges from 0 to 128 characters.
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: >-
                    The session name, which can be up to 128 characters in
                    length. If it exceeds this limit, it will be truncated.
                languageType:
                  type: string
                  description: >-
                    The language in which the output is generated. Possible
                    values are:

                    - `AUTO`: adaptive recognition

                    - `EN`: English

                    - `ES`: Spanish

                    - `AR`: Arabic

                    - `PT`: Portuguese

                    - `ID`: Indonesian

                    - `JA`: Japanese

                    - `RU`: Russian

                    - `HI`: Hindi

                    - `FR`: French

                    - `DE`: German

                    - `VI`: Vietnamese

                    - `TR`: Turkish

                    - `PL`: Polish

                    - `IT`: Italian

                    - `KO`: Korean

                    - `ZH-CN`: Simplified Chinese

                    - `ZH-TW`: Traditional Chinese
                  enum:
                    - AUTO
                    - EN
                    - ES
                    - AR
                    - PT
                    - ID
                    - JA
                    - RU
                    - HI
                    - FR
                    - DE
                    - VI
                    - TR
                    - PL
                    - IT
                    - KO
                    - ZH-CN
                    - ZH-TW
                  default: AUTO
                jobMode:
                  type: string
                  description: >-
                    Job mode. Possible values are:

                    - `AUTO`: Powerdrill automatically detects your intent and
                    selects the appropriate job mode from data analysis and
                    information retrieval.

                    - `DATA_ANALYTICS`: Powerdrill focuses specifically on data
                    analysis.
                  enum:
                    - AUTO
                    - DATA_ANALYTICS
                  default: AUTO
                maxMessagesInContext:
                  type: integer
                  description: >-
                    The maximum number of messages retained per session, with a
                    value range of 0 to 10. The default is 10.


                    You can set it to 0 if you don't want your answer is to
                    contain any context of job history.
                  default: 10
                agentId:
                  type: string
                  description: >-
                    The ID of the agent. You don't need to specify it or set it
                    to **DATA_ANALYSIS_AGENT**.
                  default: DATA_ANALYSIS_AGENT
                userId:
                  type: string
                  description: >-
                    Your user ID. 


                    How to obtain your user ID: Sign in to Powerdrill
                    Enterprise, click Users in the top navigation bar, and find
                    your user ID in the list of users.
              required:
                - title
                - userId
            example:
              title: My session
              languageType: AUTO
              jobMode: AUTO
              maxMessagesInContext: 10
              userId: tmm-egejgowqg=g=egen
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      Status code. **0** indicates that the operation is
                      successful. Otherwise, the operation fails. Possible error
                      codes include: 

                      - 100: Bad request. 

                      - 201: Request frequency limit.

                      - 9999: Internal error. 

                      - 100001: Invalid operation. 
                  data:
                    description: The returned data object.
                    type: object
                    properties:
                      id:
                        type: string
                        description: The session ID.
                    required:
                      - id
                required:
                  - data
                  - code
              examples:
                '1':
                  summary: Success example
                  value:
                    code: 0
                    data:
                      id: session-dasfasdgasdgfasdgasdg
          headers:
            x-pd-trace-id:
              example: ''
              required: true
              description: The trace ID of Powerdrill.
              schema:
                type: string
      deprecated: false
      security:
        - apikey-header-x-pd-api-key: []
components:
  securitySchemes:
    apikey-header-x-pd-api-key:
      type: apiKey
      in: header
      name: x-pd-api-key

````