Update resource
curl --request PUT \
--url https://api.ledgerbeam.com/v1/resources/{id} \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Updated Database",
"description": "Updated production database connection",
"type": "postgresql",
"meta": {}
}
'import requests
url = "https://api.ledgerbeam.com/v1/resources/{id}"
payload = {
"name": "My Updated Database",
"description": "Updated production database connection",
"type": "postgresql",
"meta": {}
}
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Updated Database',
description: 'Updated production database connection',
type: 'postgresql',
meta: {}
})
};
fetch('https://api.ledgerbeam.com/v1/resources/{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.ledgerbeam.com/v1/resources/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My Updated Database',
'description' => 'Updated production database connection',
'type' => 'postgresql',
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json"
],
]);
$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.ledgerbeam.com/v1/resources/{id}"
payload := strings.NewReader("{\n \"name\": \"My Updated Database\",\n \"description\": \"Updated production database connection\",\n \"type\": \"postgresql\",\n \"meta\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("API-KEY", "<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.put("https://api.ledgerbeam.com/v1/resources/{id}")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Updated Database\",\n \"description\": \"Updated production database connection\",\n \"type\": \"postgresql\",\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ledgerbeam.com/v1/resources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Updated Database\",\n \"description\": \"Updated production database connection\",\n \"type\": \"postgresql\",\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "res_123456789",
"name": "My Database",
"description": "Production database connection",
"type": "postgresql",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:35:00Z"
}{
"error": "Unauthorized access"
}Resources
Update Resource
Update a specific resource
PUT
/
resources
/
{id}
Update resource
curl --request PUT \
--url https://api.ledgerbeam.com/v1/resources/{id} \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Updated Database",
"description": "Updated production database connection",
"type": "postgresql",
"meta": {}
}
'import requests
url = "https://api.ledgerbeam.com/v1/resources/{id}"
payload = {
"name": "My Updated Database",
"description": "Updated production database connection",
"type": "postgresql",
"meta": {}
}
headers = {
"API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Updated Database',
description: 'Updated production database connection',
type: 'postgresql',
meta: {}
})
};
fetch('https://api.ledgerbeam.com/v1/resources/{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.ledgerbeam.com/v1/resources/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My Updated Database',
'description' => 'Updated production database connection',
'type' => 'postgresql',
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"API-KEY: <api-key>",
"Content-Type: application/json"
],
]);
$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.ledgerbeam.com/v1/resources/{id}"
payload := strings.NewReader("{\n \"name\": \"My Updated Database\",\n \"description\": \"Updated production database connection\",\n \"type\": \"postgresql\",\n \"meta\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("API-KEY", "<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.put("https://api.ledgerbeam.com/v1/resources/{id}")
.header("API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Updated Database\",\n \"description\": \"Updated production database connection\",\n \"type\": \"postgresql\",\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ledgerbeam.com/v1/resources/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Updated Database\",\n \"description\": \"Updated production database connection\",\n \"type\": \"postgresql\",\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "res_123456789",
"name": "My Database",
"description": "Production database connection",
"type": "postgresql",
"status": "active",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:35:00Z"
}{
"error": "Unauthorized access"
}Overview
Update a specific resource. This endpoint allows you to modify the configuration and metadata of an existing resource.Authorizations
API key for authentication
Path Parameters
Resource ID
Body
application/json
Response
Resource updated successfully
Resource ID
Example:
"res_123456789"
Resource name
Example:
"My Database"
Resource description
Example:
"Production database connection"
Resource type
Example:
"postgresql"
Resource status
Available options:
active, inactive, error Example:
"active"
Creation timestamp
Example:
"2024-01-15T10:30:00Z"
Last update timestamp
Example:
"2024-01-15T10:35:00Z"
⌘I

