Update an Asset
curl --request PATCH \
--url https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <x-account-id>' \
--data '
{
"title": "Chief Technology Officer",
"important": true,
"contact_methods": [
{
"type": "Email",
"value": "jane.smith.new@example.com"
},
{
"type": "Mobile",
"value": "+1-555-0456"
}
],
"visibility": "restricted"
}
'import requests
url = "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}"
payload = {
"title": "Chief Technology Officer",
"important": True,
"contact_methods": [
{
"type": "Email",
"value": "jane.smith.new@example.com"
},
{
"type": "Mobile",
"value": "+1-555-0456"
}
],
"visibility": "restricted"
}
headers = {
"X-Account-ID": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Account-ID': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Chief Technology Officer',
important: true,
contact_methods: [
{type: 'Email', value: 'jane.smith.new@example.com'},
{type: 'Mobile', value: '+1-555-0456'}
],
visibility: 'restricted'
})
};
fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}', 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}",
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([
'title' => 'Chief Technology Officer',
'important' => true,
'contact_methods' => [
[
'type' => 'Email',
'value' => 'jane.smith.new@example.com'
],
[
'type' => 'Mobile',
'value' => '+1-555-0456'
]
],
'visibility' => 'restricted'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <x-account-id>"
],
]);
$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}"
payload := strings.NewReader("{\n \"title\": \"Chief Technology Officer\",\n \"important\": true,\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith.new@example.com\"\n },\n {\n \"type\": \"Mobile\",\n \"value\": \"+1-555-0456\"\n }\n ],\n \"visibility\": \"restricted\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Account-ID", "<x-account-id>")
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.patch("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}")
.header("X-Account-ID", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Chief Technology Officer\",\n \"important\": true,\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith.new@example.com\"\n },\n {\n \"type\": \"Mobile\",\n \"value\": \"+1-555-0456\"\n }\n ],\n \"visibility\": \"restricted\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Account-ID"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Chief Technology Officer\",\n \"important\": true,\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith.new@example.com\"\n },\n {\n \"type\": \"Mobile\",\n \"value\": \"+1-555-0456\"\n }\n ],\n \"visibility\": \"restricted\"\n}"
response = http.request(request)
puts response.read_body{
"id": "019983a9-c4c0-73af-aec9-463feeadc2e7",
"organization_id": "019983a9-c4bf-77da-a35b-5eb177b7b859",
"organization_name": "Acme Corporation",
"visibility": "inherit",
"owned_by": "019983a9-c4c0-73af-aec9-463feeadc2e7",
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"title": "CTO",
"important": true,
"contact_type": "Decision Maker",
"contact_methods": [
{
"type": "Email",
"value": "john.doe@example.com"
},
{
"type": "Mobile",
"value": "+1-555-0123"
}
],
"preferred_contact_method": "Email",
"references": {
"location": "019983a9-c4c1-7abc-def0-123456789abc"
},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-20T14:45:00.000Z",
"created_by": "019983a9-c4c0-73af-aec9-463feeadc2e7",
"updated_by": "019983a9-c4c0-73af-aec9-463feeadc2e7"
}{
"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>"
}{
"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>"
}Assets
Update an Asset
Update an existing asset
PATCH
/
v1
/
assets
/
{assetTypeName}
/
{assetId}
Update an Asset
curl --request PATCH \
--url https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <x-account-id>' \
--data '
{
"title": "Chief Technology Officer",
"important": true,
"contact_methods": [
{
"type": "Email",
"value": "jane.smith.new@example.com"
},
{
"type": "Mobile",
"value": "+1-555-0456"
}
],
"visibility": "restricted"
}
'import requests
url = "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}"
payload = {
"title": "Chief Technology Officer",
"important": True,
"contact_methods": [
{
"type": "Email",
"value": "jane.smith.new@example.com"
},
{
"type": "Mobile",
"value": "+1-555-0456"
}
],
"visibility": "restricted"
}
headers = {
"X-Account-ID": "<x-account-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'X-Account-ID': '<x-account-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Chief Technology Officer',
important: true,
contact_methods: [
{type: 'Email', value: 'jane.smith.new@example.com'},
{type: 'Mobile', value: '+1-555-0456'}
],
visibility: 'restricted'
})
};
fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}', 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}",
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([
'title' => 'Chief Technology Officer',
'important' => true,
'contact_methods' => [
[
'type' => 'Email',
'value' => 'jane.smith.new@example.com'
],
[
'type' => 'Mobile',
'value' => '+1-555-0456'
]
],
'visibility' => 'restricted'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Account-ID: <x-account-id>"
],
]);
$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}"
payload := strings.NewReader("{\n \"title\": \"Chief Technology Officer\",\n \"important\": true,\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith.new@example.com\"\n },\n {\n \"type\": \"Mobile\",\n \"value\": \"+1-555-0456\"\n }\n ],\n \"visibility\": \"restricted\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Account-ID", "<x-account-id>")
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.patch("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}")
.header("X-Account-ID", "<x-account-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Chief Technology Officer\",\n \"important\": true,\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith.new@example.com\"\n },\n {\n \"type\": \"Mobile\",\n \"value\": \"+1-555-0456\"\n }\n ],\n \"visibility\": \"restricted\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Account-ID"] = '<x-account-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"Chief Technology Officer\",\n \"important\": true,\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith.new@example.com\"\n },\n {\n \"type\": \"Mobile\",\n \"value\": \"+1-555-0456\"\n }\n ],\n \"visibility\": \"restricted\"\n}"
response = http.request(request)
puts response.read_body{
"id": "019983a9-c4c0-73af-aec9-463feeadc2e7",
"organization_id": "019983a9-c4bf-77da-a35b-5eb177b7b859",
"organization_name": "Acme Corporation",
"visibility": "inherit",
"owned_by": "019983a9-c4c0-73af-aec9-463feeadc2e7",
"name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"title": "CTO",
"important": true,
"contact_type": "Decision Maker",
"contact_methods": [
{
"type": "Email",
"value": "john.doe@example.com"
},
{
"type": "Mobile",
"value": "+1-555-0123"
}
],
"preferred_contact_method": "Email",
"references": {
"location": "019983a9-c4c1-7abc-def0-123456789abc"
},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-01-20T14:45:00.000Z",
"created_by": "019983a9-c4c0-73af-aec9-463feeadc2e7",
"updated_by": "019983a9-c4c0-73af-aec9-463feeadc2e7"
}{
"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>"
}{
"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>"
}Headers
Body
application/json
Partial asset data to update (structure depends on asset type definition)
Response
Asset with dynamic properties from asset type definition spread at root level
Asset with dynamic properties from asset type definition spread at root level
Was this page helpful?