Skip to content

Rest API

Similarity

POST
/api/v1/ai/similarity
curl --request POST \
--url https://api.unless.com/api/v1/ai/similarity \
--header 'Content-Type: application/json' \
--header 'x-account-id: example' \
--header 'x-api-key: example' \
--header 'x-user-email: example' \
--header 'x-website-id: example' \
--data '{ "query": "example", "segmentId": "example", "maxResults": 5, "personalizationId": "example" }'
x-api-key
required
string

Your API key from account settings.

x-user-email
required
string

The email address of your user.

x-account-id
required
string

The ID of your account. You can find this in the account settings.

x-website-id
required
string

The ID of the workspace you want to use.

Media typeapplication/json
object
query
required

The query you want to base the similarity search on.

string
segmentId

The segment to search within.

string
maxResults
integer
default: 5
personalizationId

Optional personalization ID recorded against the search event.

string

Array of similar content pages, ranked by relevance.

Media typeapplication/json
Array<object>
object
source

URL of the matched source page.

string format: uri
title
string
isPublic
boolean
default: true

Example

[
{
"source": "https://unless.zendesk.com/agent/tickets/2",
"title": "Test ticket (#2)",
"isPublic": false
},
{
"source": "faq",
"title": "What is the answer to everything and all?",
"isPublic": false
}
]

Invalid request parameters.