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

# Quickstart

> Get started with the Soar Labs API in minutes.

This guide will walk you through the basics of using the Soar Labs API to create a corpus, add a resource to it, and perform a query.

<Steps titleSize="h3">
  <Step title="Get an API Token" icon="key">
    Before you can use the Soar Labs API, generate a personal access token from the Soar Labs web application's user settings. Include it in every request via the `Authorization` header.

    ```bash theme={null}
    Authorization: Bearer YOUR_API_TOKEN
    ```
  </Step>

  <Step title="Create a Corpus" icon="folder-plus">
    Every resource must live inside a corpus. Create one with the corpora endpoint and keep the returned `id` handy for later steps.

    ```bash theme={null}
    curl -X POST https://your-soar-instance.com/api/corpora/ \
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "corpora_name": "My First Corpus", "description": "A corpus for testing the Soar Labs API." }'
    ```
  </Step>

  <Step title="Add a Resource" icon="plus">
    Ingest content so it can be indexed. This example adds a simple string resource, but you can also upload files or URLs.

    ```bash theme={null}
    curl -X POST https://your-soar-instance.com/api/data/strings/ \
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "corpora": "your-corpus-id", "title": "Test String", "string": "The quick brown fox jumps over the lazy dog." }'
    ```
  </Step>

  <Step title="Run a Query" icon="terminal">
    Once indexing completes, send a query to retrieve answers and citations from your corpus.

    ```bash theme={null}
    curl -X POST https://your-soar-instance.com/api/query/ \
      -H "Authorization: Bearer YOUR_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{ "corpora": "your-corpus-id", "user_query": "What does the fox do?", "is_query": true }'
    ```
  </Step>
</Steps>

## Next Steps

Now that you've got the basics down, you can explore the rest of the API to manage your corpora and resources, and to perform more complex queries. Check out the [API Reference](/api-reference/corpora/list) for more details.
