Databases
A database holds reference data that an agent can search during a call or a chat, such as your services, locations, or prices. Use it for information that changes more often than your instructions, or that is too large to put in them.
You keep the data in your own system and publish it as a JSON export at an HTTPS URL. Resia reads that export.
Export format
The export must be a JSON object. Every top-level value must be an array of row objects:
{
"services": [
{"name": "Eye exam", "duration_minutes": 30, "price_usd": 120},
{"name": "Contact lens fitting", "duration_minutes": 45, "price_usd": 90}
],
"locations": [
{"name": "Midtown", "address": "100 W 40th St, New York, NY", "phone": "+12125550100"}
]
}
Resia does not support metadata strings or other values beside the arrays.
Create and use one
Register the export URL with POST /v1/databases, or in the portal under Databases. Resia imports the export at once, and ready says whether the first import worked.
Name the database with database_id on POST /v1/calls or POST /v1/chats. A database that is not ready counts as none.
See Let an agent answer from your data for the steps on a call and in a chat.
How refreshes work
Resia fetches the export again before each call or chat that uses the database. To decide whether the data changed, it uses, in order:
- The
ETagresponse header. - A valid
Last-Modifiedresponse header. - A SHA-256 digest of the body.
Neither header is required. If you send one, change it whenever the export changes. With an ETag or Last-Modified header, Resia sends a conditional request, and your server can answer 304 Not Modified to skip the download. A 304 Not Modified answer is valid only after such a conditional request. Without a header, Resia downloads the full export each time. If the version did not change, Resia keeps the imported data and does not replace it.
last_source_version on the database shows the version that Resia accepted. It has one of three forms:
- The accepted
ETagvalue. last-modified:<GMT date>.sha256:<hex digest>.
A failed refresh keeps the previous data.

