Create an Asset
curl --request POST \
--url https://api.us.lexful.app/v1/assets/{assetTypeName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <api-key>' \
--data '
{
"organization_id": "019983a9-c4bf-77da-a35b-5eb177b7b859",
"first_name": "Jane",
"last_name": "Smith",
"title": "VP of Engineering",
"important": false,
"contact_type": "Influencer",
"contact_methods": [
{
"type": "Email",
"value": "jane.smith@example.com"
}
],
"preferred_contact_method": "Email",
"visibility": "private"
}
'import requests
url = "https://api.us.lexful.app/v1/assets/{assetTypeName}"
payload = {
"organization_id": "019983a9-c4bf-77da-a35b-5eb177b7b859",
"first_name": "Jane",
"last_name": "Smith",
"title": "VP of Engineering",
"important": False,
"contact_type": "Influencer",
"contact_methods": [
{
"type": "Email",
"value": "jane.smith@example.com"
}
],
"preferred_contact_method": "Email",
"visibility": "private"
}
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Account-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
organization_id: '019983a9-c4bf-77da-a35b-5eb177b7b859',
first_name: 'Jane',
last_name: 'Smith',
title: 'VP of Engineering',
important: false,
contact_type: 'Influencer',
contact_methods: [{type: 'Email', value: 'jane.smith@example.com'}],
preferred_contact_method: 'Email',
visibility: 'private'
})
};
fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}', 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}",
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([
'organization_id' => '019983a9-c4bf-77da-a35b-5eb177b7b859',
'first_name' => 'Jane',
'last_name' => 'Smith',
'title' => 'VP of Engineering',
'important' => false,
'contact_type' => 'Influencer',
'contact_methods' => [
[
'type' => 'Email',
'value' => 'jane.smith@example.com'
]
],
'preferred_contact_method' => 'Email',
'visibility' => 'private'
]),
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}"
payload := strings.NewReader("{\n \"organization_id\": \"019983a9-c4bf-77da-a35b-5eb177b7b859\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"VP of Engineering\",\n \"important\": false,\n \"contact_type\": \"Influencer\",\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith@example.com\"\n }\n ],\n \"preferred_contact_method\": \"Email\",\n \"visibility\": \"private\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.us.lexful.app/v1/assets/{assetTypeName}")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"organization_id\": \"019983a9-c4bf-77da-a35b-5eb177b7b859\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"VP of Engineering\",\n \"important\": false,\n \"contact_type\": \"Influencer\",\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith@example.com\"\n }\n ],\n \"preferred_contact_method\": \"Email\",\n \"visibility\": \"private\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Account-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"organization_id\": \"019983a9-c4bf-77da-a35b-5eb177b7b859\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"VP of Engineering\",\n \"important\": false,\n \"contact_type\": \"Influencer\",\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith@example.com\"\n }\n ],\n \"preferred_contact_method\": \"Email\",\n \"visibility\": \"private\"\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>"
}Assets
Create an Asset
Create a new asset of the specified type
POST
/
v1
/
assets
/
{assetTypeName}
Create an Asset
curl --request POST \
--url https://api.us.lexful.app/v1/assets/{assetTypeName} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Account-ID: <api-key>' \
--data '
{
"organization_id": "019983a9-c4bf-77da-a35b-5eb177b7b859",
"first_name": "Jane",
"last_name": "Smith",
"title": "VP of Engineering",
"important": false,
"contact_type": "Influencer",
"contact_methods": [
{
"type": "Email",
"value": "jane.smith@example.com"
}
],
"preferred_contact_method": "Email",
"visibility": "private"
}
'import requests
url = "https://api.us.lexful.app/v1/assets/{assetTypeName}"
payload = {
"organization_id": "019983a9-c4bf-77da-a35b-5eb177b7b859",
"first_name": "Jane",
"last_name": "Smith",
"title": "VP of Engineering",
"important": False,
"contact_type": "Influencer",
"contact_methods": [
{
"type": "Email",
"value": "jane.smith@example.com"
}
],
"preferred_contact_method": "Email",
"visibility": "private"
}
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Account-ID': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
organization_id: '019983a9-c4bf-77da-a35b-5eb177b7b859',
first_name: 'Jane',
last_name: 'Smith',
title: 'VP of Engineering',
important: false,
contact_type: 'Influencer',
contact_methods: [{type: 'Email', value: 'jane.smith@example.com'}],
preferred_contact_method: 'Email',
visibility: 'private'
})
};
fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}', 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}",
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([
'organization_id' => '019983a9-c4bf-77da-a35b-5eb177b7b859',
'first_name' => 'Jane',
'last_name' => 'Smith',
'title' => 'VP of Engineering',
'important' => false,
'contact_type' => 'Influencer',
'contact_methods' => [
[
'type' => 'Email',
'value' => 'jane.smith@example.com'
]
],
'preferred_contact_method' => 'Email',
'visibility' => 'private'
]),
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}"
payload := strings.NewReader("{\n \"organization_id\": \"019983a9-c4bf-77da-a35b-5eb177b7b859\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"VP of Engineering\",\n \"important\": false,\n \"contact_type\": \"Influencer\",\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith@example.com\"\n }\n ],\n \"preferred_contact_method\": \"Email\",\n \"visibility\": \"private\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.us.lexful.app/v1/assets/{assetTypeName}")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"organization_id\": \"019983a9-c4bf-77da-a35b-5eb177b7b859\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"VP of Engineering\",\n \"important\": false,\n \"contact_type\": \"Influencer\",\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith@example.com\"\n }\n ],\n \"preferred_contact_method\": \"Email\",\n \"visibility\": \"private\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Account-ID"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"organization_id\": \"019983a9-c4bf-77da-a35b-5eb177b7b859\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Smith\",\n \"title\": \"VP of Engineering\",\n \"important\": false,\n \"contact_type\": \"Influencer\",\n \"contact_methods\": [\n {\n \"type\": \"Email\",\n \"value\": \"jane.smith@example.com\"\n }\n ],\n \"preferred_contact_method\": \"Email\",\n \"visibility\": \"private\"\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>"
}Authorizations
Bearer token
Account ID
Path Parameters
Asset type name
Body
application/json
Asset data (structure depends on asset type definition)
Asset data (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
Asset unique identifier
Organization ID
Organization name
Asset visibility setting
Available options:
inherit, private, restricted User ID of asset owner
Expanded tags (only present when expand=tags is used)
Show child attributes
Show child attributes
Asset references (IDs or expanded assets)
Deletion timestamp
User ID who created
User ID who last updated
Was this page helpful?
⌘I