---
title: "Create a resource"
description: "Add a text, one web page or a whole website as a resource. The resource is read and indexed in the background, for free."
canonical: "https://lookio.app/docs/api/resources/create-resource"
updated: "2026-10-25"
---

# Create a resource

Requires `resources:write`.

Importing is free. The resource comes back `queued` and is read in the background, in seconds for a page and minutes for a site. Poll [Get a resource](/docs/api/resources/get-resource) until `status` is `ready` or `failed`, and stop there.

- **Text** (`type: "text"`): up to 100,000 characters. Markdown headings become the sections that answers cite.
- **Web page** (`type: "url"`): one public address. Pages built with JavaScript are read too. See [Websites](/docs/platform/websites).
- **Site** (`type: "site"`): a whole site or one section, chosen with `rules`. Omit `schedule` to use the plan default: manual on Free, weekly on paid plans. Paid plans also support recurring intervals. Run [Preview a site](/docs/api/sites/preview-site) first to see what the rules would import.
- **File**: use [Upload a file](/docs/api/resources/upload-file) instead.

An address must be public: `localhost`, private ranges and non-HTTP schemes are refused. Adding content that would pass the plan's words-stored limit fails with `request_too_large_for_plan`. See [Word allowance](/docs/platform/resources#word-allowance).

Send an `Idempotency-Key` header so a retried request does not create a second resource.

```http
POST https://api.lookio.app/v1/resources
```

## Authorizations

- `Authorization` (bearer, in header, required)

## Query parameters

- `wait` (`boolean | enum<string>`): Wait up to 15 seconds for reading and indexing to finish before returning. Short texts, files and pages usually come back `ready` (or `failed`) in one call; larger imports return their current status (`queued` or `processing`) when the window ends, never an error.

## Header parameters

- `Idempotency-Key` (`string`, length: `1–255 chars`): A unique key for this request, such as a UUID, 1 to 255 visible ASCII characters. Send the same key when you retry: the first response is returned (with `Idempotent-Replayed: true`) instead of running the request again, for 24 hours, per credential. The same key on a different request is a 409 `conflict`. A streamed answer is not recorded.

## Body

`application/json`, required

## Response

**201**: Add a text, a web page or a site

- `data` (`object`, required)
- `data.id` (`string`, required, pattern: `^res_[abcdefghjkmnpqrstuvwxyz23456789]{12}$`)
- `data.title` (`string`, required)
- `data.type` (`enum<string>`, required, one of: `text, file, url, site`)
- `data.status` (`enum<string>`, required, one of: `queued, processing, ready, failed, stale, ready_simulated`): `queued` and `processing`: being read and indexed (pass `wait=true` or poll until it changes). `ready`: searchable. `failed`: see `status_detail`, then fix and call reindex.
- `data.status_detail` (`string,null`, required)
- `data.tags` (`string[]`, required)
- `data.source_url` (`string,null`, required): The page or site address, for `url` and `site` resources.
- `data.source` (`string,null`, required): Where it comes from, as shown with its citations.
- `data.site` (`object | null`, required): A site's page rules and schedule; null for other types.
- `data.site.rules` (`object`, required, default: `{"include":[],"exclude":[],"excluded_urls":[]}`)
- `data.site.rules.include` (`string[]`, required, default: `[]`, items: `≤ 50 items`): Path patterns to keep, such as `/docs/**`. `*` is one level, `**` everything below. Empty keeps the whole site.
- `data.site.rules.exclude` (`string[]`, required, default: `[]`, items: `≤ 50 items`): Path patterns to leave out, such as `/blog/**`.
- `data.site.rules.regex` (`string`, length: `≤ 500 chars`): Advanced: a regular expression on the path; matching pages are left out.
- `data.site.rules.excluded_urls` (`string[]`, required, default: `[]`, items: `≤ 5000 items`): Single pages to leave out, by full address.
- `data.site.schedule` (`string`, required, length: `≤ 40 chars`, pattern: `^(?:manual|daily|weekly|monthly|every_\d+_(?:day|days|week|weeks|month|months))$`): `manual` syncs only on request. Recurring schedules accept `daily`, `weekly`, `monthly`, or `every_N_days`, `every_N_weeks` and `every_N_months` (1-90 days, 1-52 weeks, 1-12 months). Recurring schedules require a paid plan.
- `data.site.last_synced_at` (`string,null`, required)
- `data.created_at` (`string`, required)
- `data.updated_at` (`string`, required)
- `request_id` (`string`, required)

```json
{
  "data": {
    "id": "res_thk6smb5nvts",
    "title": "Refund policy",
    "type": "text",
    "status": "queued",
    "status_detail": null,
    "tags": [
      "legal",
      "faq"
    ],
    "source_url": null,
    "source": "Employee handbook, 2026 edition",
    "site": null,
    "created_at": "2026-10-12T09:30:00.000Z",
    "updated_at": "2026-10-12T09:30:00.000Z"
  },
  "request_id": "req_01K9X7M2Q4"
}
```

**400**: Possible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**401**: Possible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked, invalid_access_key

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**403**: Possible codes: insufficient_scope, feature_not_available, admin_required, permission_denied

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**409**: Possible codes: conflict, assistant_has_no_resources

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**413**: Possible codes: request_too_large

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**422**: Possible codes: request_too_large_for_plan

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**429**: Possible codes: rate_limited

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**500**: Possible codes: internal_error

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**503**: Possible codes: service_unavailable

- `error` (`object`, required)
- `error.type` (`string`, required)
- `error.code` (`string`, required)
- `error.message` (`string`, required)
- `error.param` (`string`)
- `error.docs_url` (`string`, required)
- `error.action_url` (`string<uri>`)
- `request_id` (`string`, required)

```json
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "docs_url": "<string>",
    "action_url": "<string>"
  },
  "request_id": "<string>"
}
```

**Example request**

```bash
curl --request POST \
  --url 'https://api.lookio.app/v1/resources' \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "text",
  "title": "<string>",
  "text": "<string>"
}'
```
