Skip to main content
PATCH
/
v1
/
assets
/
{assetTypeName}
/
{assetId}
/
files
/
{fileId}
Update a File
curl --request PATCH \
  --url https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Account-ID: <api-key>' \
  --data '
{
  "name": "<string>",
  "property_name": "<string>",
  "is_public": true,
  "indexable": true,
  "data": {}
}
'
import requests

url = "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId}"

payload = {
"name": "<string>",
"property_name": "<string>",
"is_public": True,
"indexable": True,
"data": {}
}
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>",
"Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'X-Account-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
property_name: '<string>',
is_public: true,
indexable: true,
data: {}
})
};

fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId}', 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.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId}",
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([
'name' => '<string>',
'property_name' => '<string>',
'is_public' => true,
'indexable' => true,
'data' => [

]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <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.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId}"

payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"property_name\": \"<string>\",\n \"is_public\": true,\n \"indexable\": true,\n \"data\": {}\n}")

req, _ := http.NewRequest("PATCH", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Account-ID", "<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.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId}")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"property_name\": \"<string>\",\n \"is_public\": true,\n \"indexable\": true,\n \"data\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/files/{fileId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Account-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"property_name\": \"<string>\",\n \"is_public\": true,\n \"indexable\": true,\n \"data\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "original_name": "<string>",
  "file_extension": "<string>",
  "mime_type": "<string>",
  "size": 123,
  "is_public": true,
  "s3_key": "<string>",
  "entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "property_name": "<string>",
  "indexable": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "updated_by": "<string>",
  "data": {},
  "s3_meta": {
    "etag": "<string>",
    "content_length": 123,
    "content_type": "<string>",
    "content_encoding": "<string>",
    "content_disposition": "<string>",
    "last_modified": "<string>"
  }
}
{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}
{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}
{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}
{
"status": 123,
"message": "<string>",
"error_id": "<string>",
"error_code": "<string>",
"developer_message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token

X-Account-ID
string
header
required

Account ID

Path Parameters

assetTypeName
string
required

Asset type name

assetId
string<uuid>
required

Asset ID

fileId
string<uuid>
required

File ID

Body

application/json
name
string

File name

Minimum string length: 1
property_name
string

Property name

is_public
boolean

Whether file is publicly accessible

indexable
boolean

Whether this file should be indexed in the knowledge graph

data
object

Additional metadata

Response

Default Response

id
string<uuid>
required

File unique identifier

organization_id
string<uuid>
required

Organization ID

name
string
required

File name

original_name
string
required

Original filename

file_extension
string
required

File extension (e.g., .pdf, .jpg)

mime_type
string
required

MIME type

size
number
required

File size in bytes

is_public
boolean
required

Whether file is publicly accessible

s3_key
string
required

S3 storage key

upload_status
enum<string>
required

Upload status

Available options:
pending,
uploading,
completed,
failed
entity_id
string<uuid> | null

Associated entity ID

asset_id
string<uuid> | null

Alias for entity_id — same value, preferred for asset-oriented consumers

property_name
string | null

Associated property name

indexable
boolean

Whether this file should be indexed in the knowledge graph

created_at
string<date-time>
updated_at
string<date-time>
created_by
string

User ID who created

updated_by
string

User ID who last updated

data
object

Additional metadata

s3_meta
object

S3 object metadata. Only included when expand=s3_meta is requested.