Resolve API integration
Overview
One endpoint answers the question you saved on the Resolve. Send text. Get a Choice or a Score, plus how the probability was split.
Base URL
https://predict.heimdallapp.org/resolve/
Authentication
- X-api-key — key from the Resolve API tab
- X-username — your Heimdall username
- X-resolve-id — the Resolve id
Getting your credentials
- Open the Resolve in the dashboard.
- API tab → Enable API. Copy the key. It is shown once.
- The Resolve id is in the URL (
/resolve/{id}) and in the sample request on that tab.
Request
POST /resolve/
{
"state": "Customer was charged twice."
}
state is the text to answer. It is required.
Choice response
Returned when the Resolve was created as Choice.
{
"type": "choice",
"choice": "Billing",
"confidence": 0.91,
"probabilities": {
"Billing": 0.91,
"Support": 0.09
},
"confidence_threshold": null
}
| Field | Meaning |
|---|---|
type | "choice" |
choice | The answer it picked. One of the names you defined |
confidence | How sure that pick is, from 0 to 1 |
probabilities | A number for every answer. They sum to 1 |
confidence_threshold | The cutoff you saved, or null |
Score response
Returned when the Resolve was created as Score.
{
"type": "score",
"score": 2.4,
"confidence": 0.7,
"probabilities": {
"1": 0.1,
"2": 0.5,
"3": 0.4
},
"legend": {
"1": "Can wait",
"2": "Soon",
"3": "Needs someone now"
},
"confidence_threshold": 0.8
}
| Field | Meaning |
|---|---|
type | "score" |
score | Position on your scale. It can fall between two levels |
confidence | How sure that score is, from 0 to 1 |
probabilities | Weight on each level |
legend | The level descriptions you wrote |
confidence_threshold | The cutoff you saved, or null |
Confidence cutoff
If you set a cutoff, it is echoed as confidence_threshold. The response still includes the choice or score and the full probabilities. Compare confidence to confidence_threshold in your application when you want to send unsure text to a person.
cURL
curl -X POST 'https://predict.heimdallapp.org/resolve/' \
-H 'Content-Type: application/json' \
-H 'X-api-key: $HEIMDALL_API_KEY' \
-H 'X-username: YOUR_USERNAME' \
-H 'X-resolve-id: YOUR_RESOLVE_ID' \
-d '{"state":"Customer was charged twice."}'
Python
import os
import requests
url = "https://predict.heimdallapp.org/resolve/"
headers = {
"X-api-key": os.environ["HEIMDALL_API_KEY"],
"X-username": "YOUR_USERNAME",
"X-resolve-id": "YOUR_RESOLVE_ID",
}
data = {"state": "Customer was charged twice."}
response = requests.post(url, headers=headers, json=data)
print(response.json())