> ## 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.

# List Templates

> List all extraction templates in a workspace.

## Authentication & Scope

Requires the `templates-read` ability.

## Request

```http theme={null}
GET /workspaces/1/extractions/templates HTTP/1.1
Host: api.raydocs.com
Authorization: Bearer <token>
```

### Path Parameters

| Parameter     | Type    | Required | Description      |
| ------------- | ------- | -------- | ---------------- |
| `workspaceId` | integer | Yes      | The workspace ID |

### Query Parameters

| Parameter | Type    | Default | Description                |
| --------- | ------- | ------- | -------------------------- |
| `page`    | integer | 1       | Page number for pagination |

## Response

`200 OK` – Paginated list of templates.

```json theme={null}
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Invoice Extraction",
      "description": "Extract invoice details",
      "workspace_id": 1,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "last_page": 1,
    "per_page": 15,
    "total": 1
  }
}
```


## OpenAPI

````yaml get /workspaces/{workspaceId}/extractions/templates
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:
  /workspaces/{workspaceId}/extractions/templates:
    get:
      tags:
        - Extraction Templates
      summary: List Templates
      description: List all extraction templates in a workspace. Requires `templates-read`.
      operationId: listTemplates
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: integer
        - name: page
          in: query
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ExtractionTemplate'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '403':
          description: Forbidden
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
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
        last_page:
          type: integer
        per_page:
          type: integer
        total:
          type: integer
    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.

````