Files
Rename a file
Updates the file’s display name. Metadata only: storage is keyed by id, so the object never moves and existing URLs keep working, and past deliveries keep the name they were sent under. Only an uploaded file can be renamed; a captured file’s name is part of its provenance, so renaming one is rejected.
PATCH
/
files
/
{file_id}
Rename a file
curl --request PATCH \
--url https://api.axilio.ai/api/v1/files/{file_id} \
--header 'Content-Type: application/json' \
--header 'X-Axilio-Api-Key: <api-key>' \
--data '
{
"filename": "<string>"
}
'import requests
url = "https://api.axilio.ai/api/v1/files/{file_id}"
payload = { "filename": "<string>" }
headers = {
"X-Axilio-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Axilio-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>'})
};
fetch('https://api.axilio.ai/api/v1/files/{file_id}', 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/{file_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'filename' => '<string>'
]),
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/{file_id}"
payload := strings.NewReader("{\n \"filename\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.axilio.ai/api/v1/files/{file_id}")
.header("X-Axilio-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/files/{file_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\"\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
}
}{
"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).
Path Parameters
file identifier to rename
Body
application/json
Updates an upload's display name.
New display name for the file.
Required string length:
1 - 255Response
OK
One file in the org's library.
Show child attributes
Show child attributes
⌘I
Rename a file
curl --request PATCH \
--url https://api.axilio.ai/api/v1/files/{file_id} \
--header 'Content-Type: application/json' \
--header 'X-Axilio-Api-Key: <api-key>' \
--data '
{
"filename": "<string>"
}
'import requests
url = "https://api.axilio.ai/api/v1/files/{file_id}"
payload = { "filename": "<string>" }
headers = {
"X-Axilio-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Axilio-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>'})
};
fetch('https://api.axilio.ai/api/v1/files/{file_id}', 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/{file_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'filename' => '<string>'
]),
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/{file_id}"
payload := strings.NewReader("{\n \"filename\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.axilio.ai/api/v1/files/{file_id}")
.header("X-Axilio-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.axilio.ai/api/v1/files/{file_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\"\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
}
}{
"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"
}