Files
Register a file upload
Registers an image or video in the org’s file library and returns a presigned S3 URL to upload the bytes to. PUT the raw file to upload_url with the declared Content-Type and Content-Length headers before the URL expires, then call the complete endpoint to make it ready. The registered file has source=upload. Uploads are capped per file and per org by total size.
POST
/
files
Register a file upload
curl --request POST \
--url https://api.axilio.ai/api/v1/files \
--header 'Content-Type: application/json' \
--header 'X-Axilio-Api-Key: <api-key>' \
--data '
{
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 52428800
}
'import requests
url = "https://api.axilio.ai/api/v1/files"
payload = {
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 52428800
}
headers = {
"X-Axilio-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Axilio-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>', mime_type: '<string>', size_bytes: 52428800})
};
fetch('https://api.axilio.ai/api/v1/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://api.axilio.ai/api/v1/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([
'filename' => '<string>',
'mime_type' => '<string>',
'size_bytes' => 52428800
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Axilio-Api-Key: <api-key>"
],
]);
$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://api.axilio.ai/api/v1/files"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"size_bytes\": 52428800\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Axilio-Api-Key", "<api-key>")
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://api.axilio.ai/api/v1/files")
.header("X-Axilio-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"size_bytes\": 52428800\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"size_bytes\": 52428800\n}"
response = http.request(request)
puts response.read_body{
"file": {
"created_at": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"mime_type": "<string>",
"on_phone_count": 123,
"preview_state": "processing",
"size_bytes": 123,
"source": "upload",
"status": "uploading",
"attachment_url": "<string>",
"bytes_transferred": 123,
"capture_error": "<string>",
"capture_state": "detected",
"checksum": "<string>",
"download_url": "<string>",
"duration_seconds": 123,
"height": 123,
"reel_url": "<string>",
"session_id": "<string>",
"surface": "phone",
"thumbnail_url": "<string>",
"width": 123
},
"upload_expires_in_seconds": 123,
"upload_url": "<string>"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Authorizations
Customer API key (axl_ prefix).
Body
application/json
Registers an upload and requests a presigned PUT URL.
Display name for the file (also its name on the phone).
Required string length:
1 - 255MIME type of the upload; must be an allowed image or video type.
Minimum string length:
1Exact size of the upload in bytes, up to 100 MiB (the phone-delivery ceiling); the presigned URL pins it.
Required range:
1 <= x <= 104857600Response
Created
The registered file and its presigned upload URL.
⌘I
Register a file upload
curl --request POST \
--url https://api.axilio.ai/api/v1/files \
--header 'Content-Type: application/json' \
--header 'X-Axilio-Api-Key: <api-key>' \
--data '
{
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 52428800
}
'import requests
url = "https://api.axilio.ai/api/v1/files"
payload = {
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 52428800
}
headers = {
"X-Axilio-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Axilio-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>', mime_type: '<string>', size_bytes: 52428800})
};
fetch('https://api.axilio.ai/api/v1/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://api.axilio.ai/api/v1/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([
'filename' => '<string>',
'mime_type' => '<string>',
'size_bytes' => 52428800
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Axilio-Api-Key: <api-key>"
],
]);
$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://api.axilio.ai/api/v1/files"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"size_bytes\": 52428800\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Axilio-Api-Key", "<api-key>")
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://api.axilio.ai/api/v1/files")
.header("X-Axilio-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"size_bytes\": 52428800\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/files")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"mime_type\": \"<string>\",\n \"size_bytes\": 52428800\n}"
response = http.request(request)
puts response.read_body{
"file": {
"created_at": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"mime_type": "<string>",
"on_phone_count": 123,
"preview_state": "processing",
"size_bytes": 123,
"source": "upload",
"status": "uploading",
"attachment_url": "<string>",
"bytes_transferred": 123,
"capture_error": "<string>",
"capture_state": "detected",
"checksum": "<string>",
"download_url": "<string>",
"duration_seconds": 123,
"height": 123,
"reel_url": "<string>",
"session_id": "<string>",
"surface": "phone",
"thumbnail_url": "<string>",
"width": 123
},
"upload_expires_in_seconds": 123,
"upload_url": "<string>"
}{
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}