> ## 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 represents a continuous interaction between a user and Powerdrill within a single conversation. Each user can have up to 150 active sessions simultaneously. If this limit is reached, you can remove unused sessions to free up space for new ones.



## OpenAPI

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

        A session represents a continuous interaction between a user and
        Powerdrill within a single conversation. Each user can have up to 150
        active sessions simultaneously. If this limit is reached, you can remove
        unused sessions to free up space for new ones.
      parameters:
        - name: x-pd-external-trace-id
          in: header
          description: >-
            The trace ID you set in your system to trace this request. It can be
            up to 128 characters in length. If the request fails, you can
            provide it to the Powerdrill team to help with troubleshooting.
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: >-
                    The session name, which can be up to 128 characters in
                    length. If it exceeds this limit, it will be truncated.
                output_language:
                  type: string
                  enum:
                    - AUTO
                    - EN
                    - ES
                    - AR
                    - PT
                    - ID
                    - JA
                    - RU
                    - HI
                    - FR
                    - DE
                    - VI
                    - TR
                    - PL
                    - IT
                    - KO
                    - ZH-CN
                    - ZH-TW
                  default: AUTO
                  description: >-
                    The language in which the output is generated. For example,
                    if set to `EN`, the output will be in English. If not
                    specified, the default setting `AUTO` will be used, which
                    allows Powerdrill Enterprise to automatically detect the
                    appropriate language for the output based on your question.
                    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
                job_mode:
                  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.


                    If not specified, the default setting `AUTO` will be used.
                    However, if your intent is clearly data analysis, we
                    recommend specifying the value as **DATA_ANALYSIS**. This
                    helps Powerdrill skip the intention detection step, enabling
                    faster question processing.
                  enum:
                    - AUTO
                    - DATA_ANALYTICS
                  default: DATA_ANALYTICS
                max_contextual_job_history:
                  type: integer
                  description: >-
                    The maximum number of recent jobs retained as context for
                    the next job, with a value range of `0` to `10`. The default
                    value is `10`. If set to `0`, jobs will be run without any
                    context from previous jobs.
                agent_id:
                  type: string
                  enum:
                    - DATA_ANALYSIS_AGENT
                  default: DATA_ANALYSIS_AGENT
                  description: >-
                    The ID of the agent. This is a reserved parameter, don't
                    specify it or set it to **DATA_ANALYSIS_AGENT**.
                user_id:
                  type: string
                  description: >-
                    Your user ID, which uniquely identifies you within your
                    team. To obtain your ID:


                    - If you're the team admin, refer to [Check user
                    information](/enterprise/users#check-user-information).

                    - If you're a system or virtual user, ask your team admin to
                    check your user ID by referring to [Check user
                    information](/enterprise/users#check-user-information).
              required:
                - name
                - user_id
            example:
              name: My session
              output_language: FR
              job_mode: AUTO
              max_contextual_job_history: 10
              agent_id: DATA_ANALYSIS_AGENT
              user_id: tmm-dafasdfasdfasdf
      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. For error
                      troubleshooting, refer to [Error
                      Codes](/api-reference/error-codes).
                  data:
                    description: The returned data object.
                    type: object
                    properties:
                      id:
                        type: string
                        description: >-
                          The session ID.


                          Save it if you want to use this session to [run your
                          jobs](/api-reference/v2/create-job) later.
                    required:
                      - id
                required:
                  - data
                  - code
              example:
                code: 0
                data:
                  id: session-dasfasdgasdgfasdgasdg
          headers:
            x-pd-trace-id:
              example: ''
              required: true
              description: >-
                The trace ID returned by Powerdrill. If a failure occurs, you
                can provide it to the Powerdrill team to assist with
                troubleshooting.
              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

````