> ## 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.

# Presign data source 

> 该接口用于为指定数据源生成一个预签名 URL（Presigned URL），从而您可以通过该 URL 下载对应的数据源。

预签名 URL 具有有效期，请确保在 URL 过期之前完成数据源的下载。



## OpenAPI

````yaml post /v2/team/datasets/{dataset_id}/datasources/{datasource_id}/presign
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/datasets/{dataset_id}/datasources/{datasource_id}/presign:
    post:
      tags:
        - Data source
      summary: 'Presign data source '
      description: |-
        该接口用于为指定数据源生成一个预签名 URL（Presigned URL），从而您可以通过该 URL 下载对应的数据源。

        预签名 URL 具有有效期，请确保在 URL 过期之前完成数据源的下载。
      parameters:
        - name: dataset_id
          in: path
          description: >-
            目标数据源所在的数据集 ID。


            如需查询您有访问权限的数据集列表，请调用 [GET
            /v2/team/datasets](/api-reference/list-datasets) 接口。
          required: true
          schema:
            type: string
        - name: datasource_id
          in: path
          description: >-
            目标数据源 ID。


            如需查询指定数据集中的数据源，请调用 [GET
            /v2/team/datasets/{id}/datasources](/api-reference/list-data-sources)
            接口。
          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
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                expires_in:
                  type: integer
                  description: 预签名 URL 的过期时间，单位为秒（s）。最小值为 `60`，默认值为 `600`。
                  default: 600
                user_id:
                  type: string
                  description: 用户 ID，即您在组织中的唯一身份标识。
              required:
                - user_id
            examples:
              '1':
                value:
                  expires_in: 600
                  user_id: tmm-dafasdfasdfasdf
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: >-
                      状态码。**0** 表示操作成功。其它值则表示操作失败。如需进行错误排查，请参阅
                      [错误码](/introduction/error-codes)。
                  data:
                    type: object
                    properties:
                      presigned_url:
                        type: string
                        description: 预签名 URL，用于下载对应数据源。
                      expires_at:
                        type: string
                        format: date-time
                        description: 预签名 URL 的过期日期和时间。
                    required:
                      - presigned_url
                      - expires_at
                    description: 返回的数据对象。
                required:
                  - data
                  - code
              examples:
                '1':
                  summary: 成功示例
                  value:
                    code: 0
                    data:
                      presigned_url: string
                      expires_at: '2024-11-13T14:15:22.123Z'
          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

````