Skip to main content
PUT
/
extractions
/
templates
/
{templateId}
Update Template
curl --request PUT \
  --url https://api.raydocs.com/extractions/templates/{templateId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "schema_json": {
    "config": {
      "reasoning_enabled": true,
      "system_message": "<string>"
    },
    "definitions": {},
    "groups": {}
  },
  "settings": {}
}
'
{
  "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

PUT /extractions/templates/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Updated Invoice Template",
  "schema_json": {
    "config": {
      "reasoning_enabled": true
    },
    "groups": {
      "invoice_details": {
        "search_query": "invoice number, date, total",
        "fields": {
          "invoice_number": { "type": "string" },
          "date": { "type": "string" },
          "total_amount": { "type": "number" }
        }
      }
    }
  }
}

Path Parameters

ParameterTypeRequiredDescription
templateIduuidYesThe template ID

Body Parameters

ParameterTypeRequiredDescription
namestringNoUpdated name
descriptionstringNoUpdated description
schema_jsonobjectNoUpdated extraction schema
settingsobjectNoUpdated parsing settings

Response

200 OK – The updated template.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Updated Invoice Template",
  "schema_json": { ... },
  "settings": { ... },
  "workspace_id": 1,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-16T09:00:00Z"
}
Template changes are versioned. You can view version history in the dashboard.

Authorizations

Authorization
string
header
required

Personal Access Token

Path Parameters

templateId
string<uuid>
required

Body

application/json
name
string
description
string
schema_json
object

JSON schema defining extraction fields and groups

settings
object

Response

Updated

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>