Desk It Developer Docs
Test your saved assistant from an app backend or server. The Preview API returns text answers from that assistant’s own saved business knowledge.
Create a preview key
- Sign in with an active Desk It account.
- Create or open an assistant and add its business knowledge.
- Open Preview API key, create the key and copy it. Save it in a server secret or environment variable.
- Use Test API on the same page to send a question and inspect the HTTP status and JSON.
Each key is scoped to one assistant. Rotating or revoking it stops the old key from working.
Send a message
Use POST with a Bearer key and a JSON body. The message field accepts 2–400 characters. Requests are independent. Import the OpenAPI file into Postman or another API client to test the live endpoint.
curl https://deskit.parmtech.au/developer-api.php \
-H "Authorization: Bearer $DESK_IT_PREVIEW_KEY" \
-H "Content-Type: application/json" \
-d '{"message":"What services do you offer?"}'
Example response
Example only. The reply depends on your assistant’s saved information.
{
"assistant": "Website support",
"answer": "We offer installation and scheduled maintenance.",
"mode": "preview"
}
Limits and errors
401 Missing, revoked or unauthorised preview key.405 Use POST.413 Request body exceeds 8 KB.415 Send JSON.422 Invalid message or the text channel is off.429 Preview limit reached. Retry later.503 Preview temporarily unavailable.
Limits share the account’s preview allowance and include a network limit.
Run the starter examples
Unzip the developer kit and set DESK_IT_PREVIEW_KEY in your terminal. Store the value in your deployment’s secret settings.
node examples/chat.mjs "What services do you offer?"
python3 examples/chat.py "What services do you offer?"
php examples/chat.php "What services do you offer?"
Download OpenAPI JSON to import the endpoint into an API client.
Keep your key on your server
Use the widget or shortcode for public website visitors. Keep private Preview API keys out of browser JavaScript, mobile app builds and shared logs. Preview requests do not publish an assistant or debit customer credits.