Skip to main content
POST
/
api
/
v1
/
cta-selection
Select a CTA
curl --request POST \
  --url https://api.webless.ai/api/v1/cta-selection \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "What does Webless do?"
}
'
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: 'What does Webless do?'})
};

fetch('https://api.webless.ai/api/v1/cta-selection', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
import requests

url = "https://api.webless.ai/api/v1/cta-selection"

payload = { "query": "What does Webless do?" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "text": "<string>",
  "url": "<string>"
}
{
"detail": [
{}
]
}
Call this after you create the requestId for the user action. The response returns CTA text and a target URL for the same context.

Body

application/json
query
string
required
Example:

"What does Webless do?"

company
string
default:sigma
Example:

"YOUR_COMPANY"

version
enum<string>
default:published

Runtime package pointer. Omit this field or use published for production traffic. Use unpublished only when testing an unpublished runtime package.

Available options:
published,
unpublished
requestId
string
Example:

"1f7c5f74-7b9e-4a0a-9b7d-4e3e2a5e3b60"

sessionId
string
Example:

"a1c2d3e4-1111-2222-3333-444455556666"

is_private_session
boolean
default:false

Response

CTA result

text
string
url
string<uri>
open_type
enum<string>

Determines how the CTA URL should be opened. self opens in the same tab, blank opens in a new tab, and form triggers an in-page form interaction.

Available options:
self,
form,
blank