Restore an Asset to a Revision
curl --request POST \
--url https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore \
--header 'Authorization: Bearer <token>' \
--header 'X-Account-ID: <api-key>'import requests
url = "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore"
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-Account-ID': '<api-key>'}
};
fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore', 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}/revisions/{revisionId}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Account-ID", "<api-key>")
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}/{assetId}/revisions/{revisionId}/restore")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore")
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>'
response = http.request(request)
puts response.read_body{
"data": {
"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"
},
"skipped": [
"<string>"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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
Restore an Asset to a Revision
Overwrite the live asset state with the snapshot captured at the specified revision.
POST
/
v1
/
assets
/
{assetTypeName}
/
{assetId}
/
revisions
/
{revisionId}
/
restore
Restore an Asset to a Revision
curl --request POST \
--url https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore \
--header 'Authorization: Bearer <token>' \
--header 'X-Account-ID: <api-key>'import requests
url = "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore"
headers = {
"Authorization": "Bearer <token>",
"X-Account-ID": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'X-Account-ID': '<api-key>'}
};
fetch('https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore', 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}/revisions/{revisionId}/restore",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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"
"net/http"
"io"
)
func main() {
url := "https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Account-ID", "<api-key>")
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}/{assetId}/revisions/{revisionId}/restore")
.header("Authorization", "Bearer <token>")
.header("X-Account-ID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.us.lexful.app/v1/assets/{assetTypeName}/{assetId}/revisions/{revisionId}/restore")
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>'
response = http.request(request)
puts response.read_body{
"data": {
"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"
},
"skipped": [
"<string>"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"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
Asset ID
Revision ID to restore to
Response
Default Response
Asset with dynamic properties from asset type definition spread at root level
Show child attributes
Show child attributes
Example:
{
"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"
}
Property names present in the revision but no longer in the entity type schema; not restored.
ID of the new revision created by this restore. Clients can use it to navigate to the post-restore state.
Was this page helpful?
⌘I