Rest API
Search the content library
const url = 'https://api.unless.com/api/v1/wiki/search?query=example';const options = { method: 'GET', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.unless.com/api/v1/wiki/search?query=example' \ --header 'x-account-id: example' \ --header 'x-api-key: example' \ --header 'x-user-email: example' \ --header 'x-website-id: example'Find content library pages about a topic with a natural language query, ranked by semantic similarity. Use it to check whether information is already covered before adding new content, then read a page by its path.
Notes
- Scoped to the workspace in
x-website-id - Returns up to 10 pages
Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Your API key from account settings.
The email address of your user.
The ID of your account. You can find this in the account settings.
The ID of the workspace you want to use.
Query Parameters
Section titled “Query Parameters”A natural language description of the content you are looking for, e.g. how do I get a refund.
Responses
Section titled “Responses”The best matching pages, most relevant first.
object
object
The page path, to read the page with the read endpoint.
The first 200 characters of the page.
Example
{ "results": [ { "path": "/billing/refunds.md", "excerpt": "How to request a refund for an invoice you paid by mistake." } ]}Bad request - missing query.
Unauthorized - invalid API key.
Not found - the website does not belong to the account.
Bad request - missing websiteId.