Duplicate Template
curl --request POST \
--url https://api.raydocs.com/extractions/templates/{templateId}/duplicate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.raydocs.com/extractions/templates/{templateId}/duplicate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.raydocs.com/extractions/templates/{templateId}/duplicate', 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.raydocs.com/extractions/templates/{templateId}/duplicate",
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>"
],
]);
$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.raydocs.com/extractions/templates/{templateId}/duplicate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.raydocs.com/extractions/templates/{templateId}/duplicate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/extractions/templates/{templateId}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"schema_json": {
"config": {
"reasoning_enabled": true,
"system_message": "<string>"
},
"definitions": {},
"groups": {}
},
"settings": {
"parsing": {
"contextual_embedding": true
}
},
"workspace_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Extraction Templates
Duplicate Template
Create a copy of an existing extraction template.
POST
/
extractions
/
templates
/
{templateId}
/
duplicate
Duplicate Template
curl --request POST \
--url https://api.raydocs.com/extractions/templates/{templateId}/duplicate \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.raydocs.com/extractions/templates/{templateId}/duplicate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.raydocs.com/extractions/templates/{templateId}/duplicate', 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.raydocs.com/extractions/templates/{templateId}/duplicate",
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>"
],
]);
$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.raydocs.com/extractions/templates/{templateId}/duplicate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.raydocs.com/extractions/templates/{templateId}/duplicate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raydocs.com/extractions/templates/{templateId}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"schema_json": {
"config": {
"reasoning_enabled": true,
"system_message": "<string>"
},
"definitions": {},
"groups": {}
},
"settings": {
"parsing": {
"contextual_embedding": true
}
},
"workspace_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authentication & Scope
Requires thetemplates-write ability.
Request
POST /extractions/templates/550e8400-e29b-41d4-a716-446655440000/duplicate HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Invoice Extraction (Copy)"
}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
templateId | uuid | Yes | The template ID to duplicate |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | No | Name for the new template. Defaults to original name with ” (Copy)” suffix |
Response
201 Created – The newly created template copy.
{
"id": "660e8400-e29b-41d4-a716-446655440001",
"name": "Invoice Extraction (Copy)",
"description": "Extract key fields from invoices",
"schema_json": { ... },
"settings": { ... },
"workspace_id": 1,
"created_at": "2024-01-16T10:30:00Z",
"updated_at": "2024-01-16T10:30:00Z"
}
Duplicating a template is useful for creating variations or testing schema changes without affecting the original.
Authorizations
Path Parameters
⌘I
