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

# Quickstart

> Make your first API call to Matil in under 5 minutes.

This guide walks you through making your first document processing request. By the end, you'll have sent a document and received structured data back.

## What you need

1. A Matil account — [sign up here](https://admin.matil.ai)
2. An API key
3. A deployment ID

Don't have these yet? Follow the steps below.

## Get your API key

<Steps>
  <Step title="Open the dashboard">
    Log in to the [Matil Dashboard](https://admin.matil.ai) and go to **Settings > API Keys**.
  </Step>

  <Step title="Create a new key">
    Click **Create New Key**. Give it a name that helps you identify its purpose (e.g., "Development" or "Production").
  </Step>

  <Step title="Copy the key">
    Copy your API key immediately — it won't be shown again.
  </Step>
</Steps>

<Note>
  Store your API key in an environment variable. Never hardcode it in your source code or commit it to version control.
</Note>

## Find your deployment ID

Go to **Deployments** in the dashboard. Select the deployment you want to use and copy its ID.

A deployment ID is a UUID like: `01234567-89ab-cdef-0123-456789abcdef`

<Tip>
  If you don't have a deployment yet, create one in the dashboard first. A deployment defines what data you want to extract and from which type of document.
</Tip>

## Make your first request

Send a document to your deployment:

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST "https://api.matil.ai/v3/deployments/{your-deployment-id}" \
    -H "x-api-key: your-api-key" \
    -H "Content-Type: application/json" \
    -d '{
      "documents": [
        {
          "type": "url",
          "url": "https://example.com/invoice.pdf"
        }
      ]
    }'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

  API_KEY = "your-api-key"
  DEPLOYMENT_ID = "your-deployment-id"

  response = requests.post(
      f"https://api.matil.ai/v3/deployments/{DEPLOYMENT_ID}",
      headers={
          "x-api-key": API_KEY,
          "Content-Type": "application/json"
      },
      json={
          "documents": [
              {
                  "type": "url",
                  "url": "https://example.com/invoice.pdf"
              }
          ]
      }
  )

  result = response.json()
  print(f"Entry ID: {result['entry_id']}")
  print(f"Status: {result['status']}")
  print(f"Extracted Data: {result['data']}")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const API_KEY = "your-api-key";
  const DEPLOYMENT_ID = "your-deployment-id";

  const response = await fetch(
    `https://api.matil.ai/v3/deployments/${DEPLOYMENT_ID}`,
    {
      method: "POST",
      headers: {
        "x-api-key": API_KEY,
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        documents: [
          {
            type: "url",
            url: "https://example.com/invoice.pdf"
          }
        ]
      })
    }
  );

  const result = await response.json();
  console.log("Entry ID:", result.entry_id);
  console.log("Status:", result.status);
  console.log("Extracted Data:", result.data);
  ```
</CodeGroup>

## Understand the response

A successful response looks like this:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "entry_id": "01934b1a-89ab-7def-0123-456789abcdef",
  "resource_type": "structure",
  "resource_id": "01934b1a-1234-7abc-0000-111122223333",
  "resource_version_number": 1,
  "data": {
    "invoice_number": "INV-2024-001",
    "date": "2024-01-15",
    "total": 150.00
  },
  "errors": null,
  "status": "completed",
  "time_ms": 2340,
  "price": 0.05
}
```

| Field                     | Description                                                               |
| ------------------------- | ------------------------------------------------------------------------- |
| `entry_id`                | Unique ID for this result. Use it to retrieve or correct the entry later. |
| `resource_type`           | Always `"structure"`.                                                     |
| `resource_id`             | The structure used for extraction.                                        |
| `resource_version_number` | The version of the structure that was applied.                            |
| `data`                    | The extracted data, structured as JSON.                                   |
| `errors`                  | Validation errors, if any. `null` when everything is correct.             |
| `status`                  | `completed`, `completed_with_errors`, or `failed`.                        |
| `time_ms`                 | How long processing took, in milliseconds.                                |
| `price`                   | Cost of this request.                                                     |

## What's next?

<CardGroup cols={2}>
  <Card title="Deployments" href="/en/guides/deployments">
    Understand how deployments connect structures to API calls.
  </Card>

  <Card title="Document formats" href="/en/guides/documents">
    Learn about all the ways you can send documents to Matil.
  </Card>

  <Card title="Processing modes" href="/en/api-reference/processing">
    Sync, async, and batch processing explained.
  </Card>

  <Card title="Error handling" href="/en/api-reference/error-handling">
    Handle errors gracefully in your integration.
  </Card>
</CardGroup>
