> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raydocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Template

> Get a single extraction template with its full schema.

## Authentication & Scope

Requires the `templates-read` ability.

## Request

```http theme={null}
GET /extractions/templates/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
```

### Path Parameters

| Parameter    | Type | Required | Description     |
| ------------ | ---- | -------- | --------------- |
| `templateId` | uuid | Yes      | The template ID |

## Response

`200 OK` – The template with full details.

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Invoice Extraction",
  "description": "Extract key fields from invoices",
  "schema_json": {
    "config": {
      "reasoning_enabled": true
    },
    "groups": {
      "invoice_details": {
        "search_query": "invoice number, date, amount",
        "fields": {
          "invoice_number": {
            "type": "string",
            "extraction_prompt": "Extract the invoice number"
          },
          "total_amount": {
            "type": "number",
            "extraction_prompt": "Extract the total amount"
          }
        }
      }
    }
  },
  "settings": {
    "parsing": {
      "contextual_embedding": false
    }
  },
  "workspace_id": 1,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}
```

`404 Not Found` – Template does not exist or you don't have access.


## OpenAPI

````yaml get /extractions/templates/{templateId}
openapi: 3.0.1
info:
  title: Raydocs API
  description: REST API for document extraction with AI-powered data parsing
  version: 1.0.0
servers:
  - url: https://api.raydocs.com
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Create and manage workspaces.
  - name: Workspace Users
    description: Manage users within a workspace.
  - name: Extraction Templates
    description: Define extraction schemas and settings.
  - name: Extraction Sessions
    description: Manage extraction jobs and documents.
  - name: Batch Operations
    description: Bulk operations on sessions.
  - name: Documents
    description: Upload and manage source documents.
  - name: Workflows
    description: Discover workflow runs and read their public outputs.
  - name: Results
    description: Access extraction results.
paths:
  /extractions/templates/{templateId}:
    get:
      tags:
        - Extraction Templates
      summary: Get Template
      description: Retrieve a single template. Requires `templates-read`.
      operationId: getTemplate
      parameters:
        - name: templateId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExtractionTemplate'
        '404':
          description: Not Found
components:
  schemas:
    ExtractionTemplate:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
        description:
          type: string
        schema_json:
          $ref: '#/components/schemas/ExtractionSchema'
        settings:
          type: object
          properties:
            parsing:
              type: object
              properties:
                contextual_embedding:
                  type: boolean
        workspace_id:
          type: integer
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    ExtractionSchema:
      type: object
      description: JSON schema defining extraction fields and groups
      properties:
        config:
          type: object
          properties:
            reasoning_enabled:
              type: boolean
            system_message:
              type: string
        definitions:
          type: object
          additionalProperties: true
        groups:
          type: object
          additionalProperties:
            type: object
            properties:
              search_query:
                type: string
              extraction_prompt:
                type: string
              fields:
                type: object
                additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Personal Access Token created from the Raydocs dashboard.

        Include in the Authorization header: `Bearer <your_token>`

        See [API Keys](/api-reference/api-keys) for token creation and
        management.

````