Skip to main content
POST
/
extractions
/
templates
/
{templateId}
/
duplicate
Duplicate Template
curl --request POST \
  --url https://api.raydocs.com/extractions/templates/{templateId}/duplicate \
  --header 'Authorization: Bearer <token>'
{
  "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 the templates-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

ParameterTypeRequiredDescription
templateIduuidYesThe template ID to duplicate

Body Parameters

ParameterTypeRequiredDescription
namestringNoName 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

Authorization
string
header
required

Personal Access Token created from the Raydocs dashboard. Include in the Authorization header: Bearer <your_token> See API Keys for token creation and management.

Path Parameters

templateId
string<uuid>
required

Response

Duplicated

id
string<uuid>
name
string
description
string
schema_json
object

JSON schema defining extraction fields and groups

settings
object
workspace_id
integer
created_at
string<date-time>
updated_at
string<date-time>