Create a resource
Creates a resource from a text (type: "text"), one web page ("url") or a whole site ("site", its pages chosen by rules). A site defaults to manual sync on Free and weekly sync on paid plans; recurring intervals require a paid plan. For a file, use POST /v1/resources/file. By default the resource comes back queued and is read and indexed in the background (seconds for a short text, file or page, minutes for a site). Pass ?wait=true to wait up to 15 seconds for it to finish in one call, or poll GET /v1/resources/{id} (?wait=true works there too) until status is ready or failed. Importing costs no credits.
POST/v1/resources
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 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. - Site (
type: "site"): a whole site or one section, chosen withrules. Omitscheduleto use the plan default: manual on Free, weekly on paid plans. Paid plans also support recurring intervals. Run Preview a site first to see what the rules would import. - File: use Upload a 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.
Send an Idempotency-Key header so a retried request does not create a second resource.
Authorizations
Authorizationbearerin headerrequiredQuery parameters
waitboolean | 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-Keystringlength: 1–255 charsA 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/jsonrequiredResponse
Add a text, a web page or a site
dataobjectrequiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked, invalid_access_key
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required, permission_denied
errorobjectrequiredrequest_idstringrequiredPossible codes: conflict, assistant_has_no_resources
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large_for_plan
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequiredPossible codes: service_unavailable
errorobjectrequiredrequest_idstringrequired