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

# Presign data source 

> If you want to download a data source, you can use this endpoint to generate a presigned URL, which allows you to download the data source via the URL.

Presigned URLs have an expiration period. Be sure to download your data sources before the URL expires.



## OpenAPI

````yaml post /v2/team/datasets/{dataset_id}/datasources/{datasource_id}/presign
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/datasets/{dataset_id}/datasources/{datasource_id}/presign:
    post:
      tags:
        - Data source
      summary: 'Presign data source '
      description: >-
        If you want to download a data source, you can use this endpoint to
        generate a presigned URL, which allows you to download the data source
        via the URL.


        Presigned URLs have an expiration period. Be sure to download your data
        sources before the URL expires.
      parameters:
        - name: dataset_id
          in: path
          description: >-
            The ID of the dataset that contains the target data source.


            To check the datasets you have access to, call [GET
            /v2/team/datasets](/api-reference/v2/list-datasets).
          required: true
          schema:
            type: string
        - name: datasource_id
          in: path
          description: >-
            The ID of the target data source.


            To check data sources existing in a specified dataset, call [GET
            /v2/team/datasets/{id}/datasources](/api-reference/v2/list-data-sources).
          required: true
          schema:
            type: string
        - 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:
                expires_in:
                  type: integer
                  description: >-
                    The duration after which the presigned URL will expire. The
                    value is expressed in seconds. The minimum value is `60` and
                    is default to `600`.
                  default: 600
                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:
                - user_id
            example:
              expires_in: 600
              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:
                    type: object
                    properties:
                      presigned_url:
                        type: string
                        description: The presigned URL to download the data source.
                      expires_at:
                        type: string
                        format: date-time
                        description: The expiration date and time of the presigned URL.
                    required:
                      - presigned_url
                      - expires_at
                    description: The returned data object.
                required:
                  - data
                  - code
              example:
                code: 0
                data:
                  presigned_url: string
                  expires_at: '2024-11-13T14:15:22.123Z'
          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

````