POST
/
v2
/
team
/
file
/
upload-datasource

Introduction

You can use this endpoint to upload your local file and then use the file_key you obtained to create a data source through the Create data source endpoint.

Only files with the following extensions are supported: .csv, .tsv, .md, .mdx, .json, .txt, .pdf, .pptx, .ppt, .doc, .docx, .xls, or .xlsx.

Example request:

Example response:

200
{
  "code": 0,
  "data": {
    "file_object_key": "/tmp/sdgsagdsgsadgasdg.csv"
  }
}

Authorizations

x-pd-api-key
string
header
required

Headers

x-pd-external-trace-id
string

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.

Body

multipart/form-data
file
file
required

The file to be uploaded. This is a required field and should contain the file data. For example, --form 'file=@"/Users/jiaoqi/Downloads/0f9a7ebd-7a2a-454a-8cd9-96accffa3107.csv"'.

user_id
string
required

Your user ID, which uniquely identifies you within your team. To obtain your ID:

Response

200 - application/json
code
integer
required

Status code. 0 indicates that the operation is successful. Otherwise, the operation fails. For error troubleshooting, refer to Error Codes.

data
object
required

The returned data object.