Workflows
Upload Workflow File
Upload a CSV or spreadsheet of emails to enrich, and receive a file ID to run through a workflow.
POST
/
api
/
agent
/
workflows
/
files
Upload Workflow File
curl --request POST \
--url https://encrata.com/api/agent/workflows/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workflow_id": "<string>"
}
'import requests
url = "https://encrata.com/api/agent/workflows/files"
payload = { "workflow_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({workflow_id: '<string>'})
};
fetch('https://encrata.com/api/agent/workflows/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://encrata.com/api/agent/workflows/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflow_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://encrata.com/api/agent/workflows/files"
payload := strings.NewReader("{\n \"workflow_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://encrata.com/api/agent/workflows/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://encrata.com/api/agent/workflows/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "file_abc123",
"filename": "emails.csv",
"row_count": 250,
"identifier_type": "email",
"identifier_column": "email"
}
{
"error": "no valid emails found in the file"
}
{
"error": "unauthorized"
}
{
"error": "file uploads are not configured"
}
Authentication
Requires a JWT token or API key in theAuthorization header.
Authorization: Bearer YOUR_TOKEN
Request
Send the file asmultipart/form-data. Emails are extracted from the file
server-side (other identifier types are ignored for now).
file
required
The file to upload. Accepted formats:
.csv, .txt, .xlsx. Maximum 64 MB.string
Optional. Attach the file to an existing workflow.
Example request
curl -X POST "https://encrata.com/api/agent/workflows/files" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@emails.csv"
import requests
with open("emails.csv", "rb") as fh:
resp = requests.post(
"https://encrata.com/api/agent/workflows/files",
headers={"Authorization": "Bearer YOUR_TOKEN"},
files={"file": fh},
)
print(resp.json())
Response
string
The uploaded file’s ID. Pass this to Run Workflow as the file to enrich.
string
The original file name.
number
Number of valid emails extracted from the file.
string
The type of identifier extracted. Currently
email.string
The column the identifiers were read from.
{
"id": "file_abc123",
"filename": "emails.csv",
"row_count": 250,
"identifier_type": "email",
"identifier_column": "email"
}
{
"error": "no valid emails found in the file"
}
{
"error": "unauthorized"
}
{
"error": "file uploads are not configured"
}
Was this page helpful?
⌘I
Upload Workflow File
curl --request POST \
--url https://encrata.com/api/agent/workflows/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workflow_id": "<string>"
}
'import requests
url = "https://encrata.com/api/agent/workflows/files"
payload = { "workflow_id": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({workflow_id: '<string>'})
};
fetch('https://encrata.com/api/agent/workflows/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://encrata.com/api/agent/workflows/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'workflow_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://encrata.com/api/agent/workflows/files"
payload := strings.NewReader("{\n \"workflow_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://encrata.com/api/agent/workflows/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workflow_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://encrata.com/api/agent/workflows/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"workflow_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "file_abc123",
"filename": "emails.csv",
"row_count": 250,
"identifier_type": "email",
"identifier_column": "email"
}
{
"error": "no valid emails found in the file"
}
{
"error": "unauthorized"
}
{
"error": "file uploads are not configured"
}