# Lookups (/docs/skills/lookups)

Docs explain how your product works in general. They can't say which of a user's invoices are overdue, or why their own campaign didn't send. A lookup gives Skavelo that answer: it's a `GET` request to your API that returns the user's data, and Skavelo writes its answer from what comes back.

## What users see [#what-users-see]

A user asks "Which of my invoices are overdue?". Skavelo replies with a short line saying what it's checking, such as "Checking your invoices.", reads the data, then answers with their own invoice numbers, customers and amounts. Most answers take about two seconds.

Questions about how to do something still get a normal answer or a walkthrough. Skavelo uses a lookup only when the answer depends on the user's own data and a lookup returns it.

## Create a lookup [#create-a-lookup]

On the agent's **Skills** tab, click **New skill** and choose **Lookup**, or add several at once by [importing your OpenAPI file](/docs/skills/import-from-openapi).

- **Name** and **When to offer it**: say what the data contains and which questions it answers, for example "The account's invoices with status and due date. Use for questions about what's overdue." Skavelo reads this to decide when to use it.
- **Path on your app**: a `GET` path, such as `/api/invoices` or `/api/invoices/{invoiceId}`.
- **Inputs**: values Skavelo fills in from the question, such as an invoice number. Path placeholders need a matching input. Other inputs go in the query string.

Lookups can be switched on as soon as you create them, because they only read.

## How it runs [#how-it-runs]

The request goes from the user's browser to your API with their own session, exactly like a page in your app loading data. Your API decides what they can see, so Skavelo never sees more than the user could.

If your API is on another address, or needs a header such as a token, set it once in the widget's code:

```js
Skavelo.init({
  agentId: 'YOUR_AGENT_ID',
  actions: {
    baseUrl: 'https://api.yourproduct.com',
    headers: () => ({ Authorization: `Bearer ${getToken()}` }),
  },
});
```

The same settings apply to lookups and actions.

## Limits [#limits]

| | |
| --- | --- |
| Method | `GET` only |
| Time | 6 seconds, then Skavelo says your app didn't reply |
| Size | The first 12,000 characters of the response are used |
| Per question | One lookup, then Skavelo answers |
| Plans | Free: 1 lookup or action switched on. Starter: up to 5. Growth and Enterprise: unlimited |

Return only the fields that matter. A short list of invoices with status and due date gives better answers than every field on every record.

## What happens to the data [#what-happens-to-the-data]

Skavelo sends the response to its AI model to write the answer, and doesn't store the response itself. The answer is saved in [Conversations](/docs/conversations/conversation-log) like any other, along with a line saying which lookup ran. Text inside the data, such as a contact named "ignore your instructions", is treated as data and never followed.

If your app refuses the request, for example because the user's session expired, Skavelo says so plainly instead of guessing.
