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

> 返回您创建的会话列表。

# List sessions

**请求示例：**

<CodeGroup>
  ```curl cURL theme={null}
  curl --request GET \
    --url https://app.ai.relyt.cn/app/api/v2/team/sessions?user_id=tmm-dafasdfasdfasdf \
    --header 'x-pd-api-key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://app.ai.relyt.cn/app/api/v2/team/sessions?user_id=tmm-dafasdfasdfasdf"

  headers = {"x-pd-api-key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```
</CodeGroup>

**返回示例：**

```json 200 theme={null}
{
  "code": 0,
  "data": {
    "page_number": 1,
    "page_size": 10,
    "total_items": 1,
    "records": [
      {
        "id": "dataset-dasfadsgadsgas",
        "name": "mysql",
        "description": "mysql databases"
      }
    ]
  }
}
```


## OpenAPI

````yaml get /v2/team/sessions
openapi: 3.0.1
info:
  title: Team Open API Version 2 中文版本
  description: ''
  version: 1.0.0
servers:
  - url: https://app.ai.relyt.cn/app/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:
    get:
      tags:
        - Session
      summary: List sessions
      description: |
        返回您创建的会话列表。
      parameters:
        - name: page_number
          in: query
          description: 分页返回的起始页码。如不指定，则使用默认值 `1`。
          required: false
          schema:
            type: integer
            default: 1
        - name: page_size
          in: query
          description: 每页返回的记录数量。如不指定，则使用默认值 `10`。
          required: false
          schema:
            type: integer
            default: 10
        - name: search
          in: query
          description: |-
            搜索关键词，最多支持 128 个字符。所有名称中包含该关键词的会话将被返回。

            如果省略此项，将列出所有会话。
          required: false
          schema:
            type: string
        - name: user_id
          in: query
          description: 用户 ID，即您在组织中的唯一身份标识。
          required: true
          schema:
            type: string
        - name: x-pd-external-trace-id
          in: header
          description: >-
            您本地系统中设置的 Trace ID，至多支持 128 个字符。当请求发生错误时，可以将此 ID 提供给 Relyt AI
            团队，协助进行故障排查。
          required: false
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      状态码。**0** 表示操作成功。其它值则表示操作失败。如需进行错误排查，请参阅
                      [错误码](/introduction/error-codes)。
                  data:
                    type: object
                    properties:
                      total_items:
                        type: integer
                        description: 返回的会话总数量。
                      page_number:
                        type: integer
                        description: 当前页面的页码。
                      page_size:
                        type: integer
                        description: 每页返回的会话数量。
                      records:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: 会话 ID，会话在当前项目中的唯一标识。
                            name:
                              type: string
                              description: 会话名称。如名称长度超过 128 个字符，将仅返回前 128 个字符。
                            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: |-
                                Relyt AI 的返回语言。可能值包括：

                                - `AUTO`：根据提示词自动识别
                                - `EN`：英语
                                - `ES`：西班牙语
                                - `AR`：阿拉伯语
                                - `PT`：葡萄牙语
                                - `ID`：印尼语
                                - `JA`：日语
                                - `RU`：俄语
                                - `HI`：印地语
                                - `FR`：法语
                                - `DE`：德语
                                - `VI`：越南语
                                - `TR`：土耳其语
                                - `PL`：波兰语
                                - `IT`：意大利语
                                - `KO`：韩语
                                - `ZH-CN`：简体中文
                                - `ZH-TW`：繁体中文
                            job_mode:
                              type: string
                              description: >-
                                任务类型。可能值包括：


                                - `AUTO`：Relyt AI
                                根据您的提问进行意图判断，决定任务是数据分析任务还是信息检索任务。

                                - `DATA_ANALYTICS`：Relyt AI 根据您的输入进行数据分析。
                              enum:
                                - AUTO
                                - DATA_ANALYTICS
                              default: DATA_ANALYTICS
                            max_contextual_job_history:
                              type: integer
                              description: >-
                                在会话中保留作为下一个任务上下文的任务数量，取值范围为 `0` 到 `10`，默认值为
                                `10`。值为 `0` 时表示会话中的任务在执行时不会使用历史任务执行结果作为上下文信息。
                            agent_id:
                              type: string
                              enum:
                                - DATA_ANALYSIS_AGENT
                              default: DATA_ANALYSIS_AGENT
                              description: AI 智能体的 ID。该参数为保留参数，无实际意义，请忽略。
                          description: 会话对象。
                          required:
                            - id
                            - name
                        description: 当前页面返回的会话列表。
                    required:
                      - total_items
                      - page_number
                      - page_size
                      - records
                    description: 会话的分页列表。
                required:
                  - data
                  - code
              examples:
                '1':
                  summary: 成功示例
                  value:
                    code: 0
                    data:
                      total_items: 8
                      page_size: 10
                      page_number: 1
                      records:
                        - id: 04b69928-532d-408a-8716-8f5e70fcacc6
                          name: Finding Your Inner Spark
                          output_language: AUTO
                          job_mode: AUTO
                          max_contextual_job_history: 10
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: 7e9941af-ad1b-4834-a421-4b37b54aae19
                          name: session_trade_analyze_001
                          output_language: EN
                          job_mode: AUTO
                          max_contextual_job_history: 1
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: a137ecc8-9554-42c3-b042-2458dd2aeb36
                          name: My first session
                          output_language: AUTO
                          job_mode: AUTO
                          max_contextual_job_history: 10
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: 4440ab38-3df0-465b-a66c-bf6acb0f1bc2
                          name: New name
                          output_language: EN
                          job_mode: AUTO
                          max_contextual_job_history: 10
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: 3eb5e294-11eb-4bf0-8854-7177c415d15c
                          name: trade_analyze_001
                          output_language: ZH-CN
                          job_mode: AUTO
                          max_contextual_job_history: 10
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: ccca6d34-894f-4f6f-a8b5-c9df93126309
                          name: lhtest-old
                          output_language: ZH-CN
                          job_mode: AUTO
                          max_contextual_job_history: 5
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: c28a1f47-da68-4456-bb0b-e85bf5a0e98e
                          name: lhtest-newest
                          output_language: ZH-TW
                          job_mode: AUTO
                          max_contextual_job_history: 6
                          agent_id: DATA_ANALYSIS_AGENT
                        - id: fbde9b45-69cd-408e-97d1-f874236aadac
                          name: General-session
                          output_language: ZH-CN
                          job_mode: AUTO
                          max_contextual_job_history: 10
                          agent_id: DATA_ANALYSIS_AGENT
          headers:
            x-pd-trace-id:
              example: ''
              required: true
              description: Relyt AI 返回的 Trace ID。当请求发生错误时，可以将此 ID 提供给 Relyt AI 团队，协助进行故障排查。
              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

````