Update a segment
curl --request PATCH \
--url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"name": "My Segment Updated",
"status": {
"code": "ACTIVE",
"description": "Active status"
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id}"
payload := strings.NewReader("{\n \"metadata\": {},\n \"name\": \"My Segment Updated\",\n \"status\": {\n \"code\": \"ACTIVE\",\n \"description\": \"Active status\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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))
}const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {},
name: 'My Segment Updated',
status: {code: 'ACTIVE', description: 'Active status'}
})
};
fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id}"
payload = {
"metadata": {},
"name": "My Segment Updated",
"status": {
"code": "ACTIVE",
"description": "Active status"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"id": "00000000-0000-0000-0000-000000000000",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"name": "My Segment",
"organizationId": "00000000-0000-0000-0000-000000000000",
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"updatedAt": "2021-01-01T00:00:00Z",
"metadata": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}Update a segment
deprecated
PATCH
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
segments
/
{id}
Update a segment
curl --request PATCH \
--url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"metadata": {},
"name": "My Segment Updated",
"status": {
"code": "ACTIVE",
"description": "Active status"
}
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id}"
payload := strings.NewReader("{\n \"metadata\": {},\n \"name\": \"My Segment Updated\",\n \"status\": {\n \"code\": \"ACTIVE\",\n \"description\": \"Active status\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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))
}const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metadata: {},
name: 'My Segment Updated',
status: {code: 'ACTIVE', description: 'Active status'}
})
};
fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/segments/{id}"
payload = {
"metadata": {},
"name": "My Segment Updated",
"status": {
"code": "ACTIVE",
"description": "Active status"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"createdAt": "2021-01-01T00:00:00Z",
"deletedAt": "2021-01-01T00:00:00Z",
"id": "00000000-0000-0000-0000-000000000000",
"ledgerId": "00000000-0000-0000-0000-000000000000",
"name": "My Segment",
"organizationId": "00000000-0000-0000-0000-000000000000",
"status": {
"code": "ACTIVE",
"description": "Active status"
},
"updatedAt": "2021-01-01T00:00:00Z",
"metadata": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}{
"code": "0065",
"message": "<string>",
"title": "Invalid Path Parameter",
"entityType": "Account",
"fields": {}
}Authorizations
JWT bearer token issued by the identity provider.
Path Parameters
Organization ID (UUID)
Ledger ID (UUID)
Segment ID (UUID)
Body
application/json
Response
OK
Example:
"2021-01-01T00:00:00Z"
Example:
"2021-01-01T00:00:00Z"
Example:
"00000000-0000-0000-0000-000000000000"
Example:
"00000000-0000-0000-0000-000000000000"
Maximum string length:
256Example:
"My Segment"
Example:
"00000000-0000-0000-0000-000000000000"
Show child attributes
Show child attributes
Example:
"2021-01-01T00:00:00Z"
Show child attributes
Show child attributes
Was this page helpful?

