Skip to main content
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.

Get an API Token

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.

Create a Corpus

Every resource must live inside a corpus. Create one with the corpora endpoint and keep the returned id handy for later steps.

Add a Resource

Ingest content so it can be indexed. This example adds a simple string resource, but you can also upload files or URLs.

Run a Query

Once indexing completes, send a query to retrieve answers and citations from your corpus.

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 for more details.