curl --request POST \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Coffee Shop C-Corp"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone"
payload = { "name": "Coffee Shop C-Corp" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Coffee Shop C-Corp'})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone', 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.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone",
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([
'name' => 'Coffee Shop C-Corp'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone"
payload := strings.NewReader("{\n \"name\": \"Coffee Shop C-Corp\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Coffee Shop C-Corp\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Coffee Shop C-Corp\"\n}"
response = http.request(request)
puts response.read_body{
"id": "PpvsmFEv14yGDyT6iV6kXw",
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual",
"type": "agent",
"ledger_ids": [
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
],
"ledgers": null
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}Clone a Chart of Accounts Template
Clones a Chart of Accounts Template and all its Ledger Templates.
curl --request POST \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Coffee Shop C-Corp"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone"
payload = { "name": "Coffee Shop C-Corp" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Coffee Shop C-Corp'})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone', 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.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone",
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([
'name' => 'Coffee Shop C-Corp'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone"
payload := strings.NewReader("{\n \"name\": \"Coffee Shop C-Corp\"\n}")
req, _ := http.NewRequest("POST", 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))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Coffee Shop C-Corp\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/clone")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Coffee Shop C-Corp\"\n}"
response = http.request(request)
puts response.read_body{
"id": "PpvsmFEv14yGDyT6iV6kXw",
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual",
"type": "agent",
"ledger_ids": [
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
],
"ledgers": null
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}Authorizations
Bearer authentication header of the form Bearer , where is your auth token.
Path Parameters
The ID of the Chart of Accounts Template to be cloned
Query Parameters
Comma-separated list of expandable paths.
ledgers Body
An arbitrary string on the object, useful for identifying the Chart of Accounts template.
"Coffee Shop C-Corp"
Response
Successful Response
The unique ID of the object.
"PpvsmFEv14yGDyT6iV6kXw"
An arbitrary string on the object, useful for identifying the Chart of Accounts template.
"Coffee Shop Sole Prop"
The accounting basis for this Chart of Accounts template.
cash, accrual "accrual"
Whether this template belongs to an agent or a platform.
agent, platform "agent"
A list of IDs of the Ledger Template objects associated with the Chart of Accounts Template
[
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
]
Expandable. A list of the Ledger Templates associated with the Chart of Accounts Template.
Show child attributes
Show child attributes
null