In addition to loading files via our web interface, you can follow these steps to load files programmatically via api.

  1. Choose a flat file source node in Pliable

If you already have a flat file source you wish to use, navigate to the source. Otherwise, create a new source with some example data, it’s important to upload the same file type you plan to use (csv/excel).

Once you have the flat file source, grab the node id from the url:

[<https://app.pliable.co/node/**679a86e0362d3d1bd69ee54b>](<https://app.pliable.co/node/679a86e0362d3d1bd69ee54b>)**  
  1. Create new upload request

Using the NODE_ID from the node you selected above and your access token, make a request to the append-file endpoint to obtain an upload url. You will need to send the filename and mime_type of the file with your POST request.

curl -X POST "<https://app.pliable.co/api/v1/node/NODE_ID/append-file>" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN_HERE" \\
  -d '{ 
    "filename": "new_data_file.csv", 
    "mime_type": "text/csv"
}'

You will receive a json response like the following:

{
    "file_id": "666391e811abc1b56a0c9095",
    "upload_url": "<https://uploads.us-east-1.pliable.co/tenant/acme_co/source/666391e811abc1b56a0c9095/filename.csv?signature=mYnsf>"
}

You can now transmit your file by sending a PUT web request to the upload_url. Pliable will begin processing the data once the file is uploaded.

PUT /tenant/acme_co/source/666391e811abc1b56a0c9095/filename.csv?signature=mYntf HTTP/1.1
Host: uploads.us-east-1.pliable.co
Content-Length: 18928
Content-Type: text/csv

{FILE  DATA}

Repeat step 2 for subsequent files.