Files
Update File
deprecated
Updates file metadata (title, type, visibility) and optionally replaces the file content in storage. If the file content is updated, the old file is replaced in Cloudflare R2. Triggers product update events for all items using this file. Deprecated: use PATCH /api/v2///dam/files instead.
PATCH
/
api
/
v1
/
{team_slug}
/
{app_slug}
/
files
/
{file_id}
Update File
curl --request PATCH \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'title=<string>' \
--data 'type=<string>' \
--data 'file=<string>'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}"
payload = {
"title": "<string>",
"type": "<string>",
"file": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.patch(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({title: '<string>', type: '<string>', file: '<string>'})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/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.enad.io/api/v1/{team_slug}/{app_slug}/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 => "title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}"
payload := strings.NewReader("title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": [
{
"created_at": "<string>",
"description": "<string>",
"filterable": true,
"id": "<string>",
"key": "<string>",
"name": "<string>",
"template_key": "<string>",
"template_name": "<string>",
"translatable": true,
"translations": {
"description": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
],
"name": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
]
},
"updated_at": "<string>",
"values": {}
}
],
"created_at": "<string>",
"folder_id": "<string>",
"id": "<string>",
"public": true,
"title": "<string>",
"translations": {
"title": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
],
"type": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
]
},
"type": "<string>",
"updated_at": "<string>",
"url": "<string>"
},
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}Authorizations
Management API token, sent as Authorization: Bearer <token>.
Path Parameters
App slug
Team slug
File ID
Body
application/x-www-form-urlencoded
⌘I
Update File
curl --request PATCH \
--url https://api.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data 'title=<string>' \
--data 'type=<string>' \
--data 'file=<string>'import requests
url = "https://api.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}"
payload = {
"title": "<string>",
"type": "<string>",
"file": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.patch(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({title: '<string>', type: '<string>', file: '<string>'})
};
fetch('https://api.enad.io/api/v1/{team_slug}/{app_slug}/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.enad.io/api/v1/{team_slug}/{app_slug}/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 => "title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/x-www-form-urlencoded"
],
]);
$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.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}"
payload := strings.NewReader("title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
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.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/x-www-form-urlencoded")
.body("title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enad.io/api/v1/{team_slug}/{app_slug}/files/{file_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "title=%3Cstring%3E&type=%3Cstring%3E&file=%3Cstring%3E"
response = http.request(request)
puts response.read_body{
"data": {
"attributes": [
{
"created_at": "<string>",
"description": "<string>",
"filterable": true,
"id": "<string>",
"key": "<string>",
"name": "<string>",
"template_key": "<string>",
"template_name": "<string>",
"translatable": true,
"translations": {
"description": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
],
"name": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
]
},
"updated_at": "<string>",
"values": {}
}
],
"created_at": "<string>",
"folder_id": "<string>",
"id": "<string>",
"public": true,
"title": "<string>",
"translations": {
"title": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
],
"type": [
{
"id": "<string>",
"locale": "<string>",
"value": "<string>"
}
]
},
"type": "<string>",
"updated_at": "<string>",
"url": "<string>"
},
"success": true,
"details": [
"<string>"
]
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}{
"success": true,
"details": [
"<string>"
],
"message": "<string>"
}