PATCH /v1/account-types/{name}
Rename an account type everywhere it is used
Auth. Send the token in the X-Ledger-Token header.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
name | path | string | required |
Request body
application/json: object
| Field | Type | Required | Description |
|---|---|---|---|
name | string | required |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | Renamed | object |
400 | Request rejected | Error |
404 | Request rejected | Error |
409 | Request rejected | Error |
429 | Too many requests from this client address. Wait the number of seconds in Retry-After, then try again. | Error |
Example response
{
"name": "string"
}
Code samples
Set KEY to your own token first.
curl
curl \
-X PATCH \
-H X-Ledger-Token:$KEY \
-H "Content-Type: application/json" \
-d '{"name": "string"}' \
"https://api.sasek.org/ledger/v1/account-types/{name}"
JavaScript
const res = await fetch("https://api.sasek.org/ledger/v1/account-types/{name}", {
method: "PATCH",
headers: { "X-Ledger-Token": KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"name": "string"
}),
});
const data = await res.json();
Python
import json
import os
import urllib.request
payload = {'name': 'string'}
request = urllib.request.Request(
"https://api.sasek.org/ledger/v1/account-types/{name}",
method="PATCH",
headers={
"X-Ledger-Token": os.environ["KEY"],
"Content-Type": "application/json",
},
data=json.dumps(payload).encode(),
)
with urllib.request.urlopen(request) as response:
print(json.load(response))