Rest API
Summarization
POST
/api/v1/ai/summarization
const url = 'https://api.unless.com/api/v1/ai/summarization';const options = { method: 'POST', headers: { 'x-api-key': 'example', 'x-user-email': 'example', 'x-account-id': 'example', 'x-website-id': 'example', 'Content-Type': 'application/json' }, body: '{"prompt":"example","filterPII":true,"instructionsTemplate":"EXTRACT_MAIN_QUESTION","responseLanguage":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.unless.com/api/v1/ai/summarization \ --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 '{ "prompt": "example", "filterPII": true, "instructionsTemplate": "EXTRACT_MAIN_QUESTION", "responseLanguage": "example" }'Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”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.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
prompt
required
The input of the content you’d like summarized.
string
filterPII
Deprecated and ignored. PII filtering is no longer applied to this endpoint: detection on document-sized prompts took longer than the request budget.
boolean
instructionsTemplate
Can be either “EXTRACT_MAIN_QUESTION” or “EXTRACT_MULTIPLE_QUESTIONS”. If not set, we will generate a summary of the prompt.
string
responseLanguage
Use this to force a certain response language. If not set, we will automatically detect the language based on the prompt.
string
Responses
Section titled “Responses”Generated summary.
Media typeapplication/json
object
statusCode
integer
body
The generated summary text.
string
Example
{ "statusCode": 200, "body": "Generated response."}Invalid request parameters.