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

# Getting Started

> Create your first extraction template and process documents

This guide walks you through creating your first extraction template and processing a document to extract structured data.

## Prerequisites

Before you begin, make sure you have:

* A Raydocs account with access to a workspace
* A document to process (PDF, Word, or image format)

## Step 1: Create an Extraction Template

Extraction templates define what data you want to extract from your documents. They use a JSON schema format with groups and fields.

<Steps>
  <Step title="Navigate to Templates">
    In your workspace, click on **Extraction Templates** in the sidebar.
  </Step>

  <Step title="Create New Template">
    Click **New Template** and give it a descriptive name (e.g., "Invoice Extraction").
  </Step>

  <Step title="Define Your Schema">
    Use the visual editor or JSON editor to define your extraction schema. Here's a simple example:

    ```json theme={null}
    {
      "config": {
        "reasoning_enabled": true
      },
      "groups": {
        "invoice_details": {
          "search_query": "invoice number, date, total amount",
          "fields": {
            "invoice_number": {
              "type": "string",
              "extraction_prompt": "Extract the invoice number"
            },
            "date": {
              "type": "string",
              "extraction_prompt": "Extract the invoice date in YYYY-MM-DD format"
            },
            "total_amount": {
              "type": "number",
              "extraction_prompt": "Extract the total amount due"
            }
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Save Template">
    Click **Save** to store your template.
  </Step>
</Steps>

## Step 2: Create an Extraction Session

An extraction session ties a template to one or more documents for processing.

<Steps>
  <Step title="Open Your Template">
    From the templates list, click on the template you just created.
  </Step>

  <Step title="Create Session">
    Click **New Session** to create an extraction session.
  </Step>

  <Step title="Upload Documents">
    Drag and drop your document(s) or click to browse and upload.
  </Step>
</Steps>

## Step 3: Run the Extraction

<Steps>
  <Step title="Wait for Processing">
    Documents are automatically processed through the RAG pipeline. This includes parsing, chunking, and embedding generation.
  </Step>

  <Step title="Execute Extraction">
    Once processing completes, click **Run Extraction** to start the AI extraction process.
  </Step>

  <Step title="Review Results">
    View your extracted data with full reasoning and source references. Click on any field to see:

    * The extracted value
    * AI reasoning explaining the extraction
    * Source text from the document
  </Step>
</Steps>

## Step 4: Export Your Data

Export your extraction results for use in other systems:

<Tabs>
  <Tab title="Excel Export">
    Click **Export to Excel** to download your data with full audit trails included.
  </Tab>

  <Tab title="API Access">
    Use the REST API to programmatically access your extraction results:

    ```bash theme={null}
    curl -X GET "https://api.raydocs.com/extractions/results/{resultId}" \
      -H "Authorization: Bearer YOUR_API_TOKEN"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="Extraction Schema" icon="code" href="/guides/extraction-schema">
    Learn the full schema syntax for complex extractions.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    Integrate extractions into your workflows.
  </Card>
</CardGroup>
