Upload a file using a publicly accessible URL.
curl --request POST \
--url https://app.timelines.ai/integrations/api/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"download_url": "https://acme.com/somefile.png",
"filename": "anotherfile.jpeg",
"content_type": "image/jpeg"
}
'import requests
url = "https://app.timelines.ai/integrations/api/files"
payload = {
"download_url": "https://acme.com/somefile.png",
"filename": "anotherfile.jpeg",
"content_type": "image/jpeg"
}
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({
download_url: 'https://acme.com/somefile.png',
filename: 'anotherfile.jpeg',
content_type: 'image/jpeg'
})
};
fetch('https://app.timelines.ai/integrations/api/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://app.timelines.ai/integrations/api/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([
'download_url' => 'https://acme.com/somefile.png',
'filename' => 'anotherfile.jpeg',
'content_type' => 'image/jpeg'
]),
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://app.timelines.ai/integrations/api/files"
payload := strings.NewReader("{\n \"download_url\": \"https://acme.com/somefile.png\",\n \"filename\": \"anotherfile.jpeg\",\n \"content_type\": \"image/jpeg\"\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://app.timelines.ai/integrations/api/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"download_url\": \"https://acme.com/somefile.png\",\n \"filename\": \"anotherfile.jpeg\",\n \"content_type\": \"image/jpeg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/integrations/api/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 \"download_url\": \"https://acme.com/somefile.png\",\n \"filename\": \"anotherfile.jpeg\",\n \"content_type\": \"image/jpeg\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"temporary_download_url": "http://acme.com/somefile.png",
"uid": "90d353e6-44c1-48ff-b15b-69b7721e5450",
"filename": "somefile.png",
"size": 10000,
"mimetype": "image/png",
"uploaded_by_email": "john.doe@acme.com",
"uploaded_at": "2023-06-18 15:19:23 +0300"
}
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}Files
Upload File (URL)
Upload a file using a publicly accessible URL. Filename and mime-type are auto-detected.
POST
/
files
Upload a file using a publicly accessible URL.
curl --request POST \
--url https://app.timelines.ai/integrations/api/files \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"download_url": "https://acme.com/somefile.png",
"filename": "anotherfile.jpeg",
"content_type": "image/jpeg"
}
'import requests
url = "https://app.timelines.ai/integrations/api/files"
payload = {
"download_url": "https://acme.com/somefile.png",
"filename": "anotherfile.jpeg",
"content_type": "image/jpeg"
}
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({
download_url: 'https://acme.com/somefile.png',
filename: 'anotherfile.jpeg',
content_type: 'image/jpeg'
})
};
fetch('https://app.timelines.ai/integrations/api/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://app.timelines.ai/integrations/api/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([
'download_url' => 'https://acme.com/somefile.png',
'filename' => 'anotherfile.jpeg',
'content_type' => 'image/jpeg'
]),
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://app.timelines.ai/integrations/api/files"
payload := strings.NewReader("{\n \"download_url\": \"https://acme.com/somefile.png\",\n \"filename\": \"anotherfile.jpeg\",\n \"content_type\": \"image/jpeg\"\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://app.timelines.ai/integrations/api/files")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"download_url\": \"https://acme.com/somefile.png\",\n \"filename\": \"anotherfile.jpeg\",\n \"content_type\": \"image/jpeg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.ai/integrations/api/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 \"download_url\": \"https://acme.com/somefile.png\",\n \"filename\": \"anotherfile.jpeg\",\n \"content_type\": \"image/jpeg\"\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"temporary_download_url": "http://acme.com/somefile.png",
"uid": "90d353e6-44c1-48ff-b15b-69b7721e5450",
"filename": "somefile.png",
"size": 10000,
"mimetype": "image/png",
"uploaded_by_email": "john.doe@acme.com",
"uploaded_at": "2023-06-18 15:19:23 +0300"
}
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}{
"message": "<string>",
"status": "error",
"error_code": "validation_error",
"errors": [
{
"fields": [
"url"
],
"msg": "must be a valid http(s) URL"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
_
A publicly accessible URL for the file (excluding download URLs from services like Google Drive or OneDrive).
Example:
"https://acme.com/somefile.png"
(optional) A filename, to be used instead of the original filename specified by the download URL.
Maximum string length:
1024Example:
"anotherfile.jpeg"
(optional) A mime-type of the file, to be used instead of the original filename specified by the download URL.
Maximum string length:
140Example:
"image/jpeg"
⌘I

