Widget
Embeddable support widget for customer websites.
Widget script
Section titled “Widget script”GET /widget.js
Script to include in your website. It injects a floating support button that opens
the ticket form (/widget.html) in an iframe.
<script src="https://exocortex-api.ai-exo-cortex.com/widget.js?tenant=ACME&key=pk_live_3f9a1c2e" async></script>Authentication: None: the request is authenticated by the signature described above.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant |
query | string | yes | |
key |
query | string | yes | Public widget key. |
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 |
JavaScript loader. |
Example 200
(function(){ /* exoCortex widget loader */ })();Example with curl
Section titled “Example with curl”curl -X GET "https://exocortex-api.ai-exo-cortex.com/widget.js?tenant=ACME&key=pk_live_3f9a1c2e"Widget form
Section titled “Widget form”GET /widget.html
The HTML form rendered inside the widget iframe. You normally don’t call it directly; /widget.js loads it.
Authentication: None: the request is authenticated by the signature described above.
Parameters
Section titled “Parameters”| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant |
query | string | yes | |
key |
query | string | yes | Public widget key. |
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 |
HTML document. |
Example 200
<!DOCTYPE html><html>…</html>Example with curl
Section titled “Example with curl”curl -X GET "https://exocortex-api.ai-exo-cortex.com/widget.html?tenant=ACME&key=pk_live_3f9a1c2e"Submit a request from the widget
Section titled “Submit a request from the widget”POST /api/v1/widget/submit
Used by the widget form. Limited to 30 submissions per hour per client IP and tenant.
If the tenant enabled Cloudflare Turnstile, a valid cf_turnstile_token is required.
Authentication: Public widget key: X-NH-Widget-Key: pk_…
Request body
Section titled “Request body”application/json
| Name | Type | Required | Description |
|---|---|---|---|
tenant |
string | yes | Must match the widget key’s tenant. |
email |
string (email) | yes | |
name |
string | no | |
subject |
string | yes | |
description |
string | yes | |
category |
string | no | |
origin |
string | no | Page URL where the widget was used. |
cf_turnstile_token |
string | no | Cloudflare Turnstile token. Required if the tenant enabled Turnstile. You can also send it in the X-NH-Turnstile header. |
{ "tenant": "ACME", "email": "maria.rossi@example.com", "name": "Maria Rossi", "subject": "Cannot download my invoice", "description": "The invoice page shows an empty PDF for October.", "category": "Billing", "origin": "https://www.example.com/account", "cf_turnstile_token": "0.xY2fake-turnstile-token"}Responses
Section titled “Responses”| Status | Description |
|---|---|
200 |
Ticket created. |
400 |
Invalid request. |
401 |
Not authenticated. |
403 |
Authenticated but not allowed (role, tenant or key). |
429 |
Too many submissions from this IP (30 per hour). |
500 |
Unexpected server error. |
Example 200
{ "ok": true, "ticket_key": "ACME-1043", "ingestion_id": "ing_2c71f0aa"}Example with curl
Section titled “Example with curl”curl -X POST "https://exocortex-api.ai-exo-cortex.com/api/v1/widget/submit" \ -H "X-NH-Widget-Key: $EXO_WIDGET_KEY" \ -H "Content-Type: application/json" \ --data '{"tenant":"ACME","email":"maria.rossi@example.com","name":"Maria Rossi","subject":"Cannot download my invoice","description":"The invoice page shows an empty PDF for October.","category":"Billing","origin":"https://www.example.com/account","cf_turnstile_token":"0.xY2fake-turnstile-token"}'Page generated from the OpenAPI specification of the integration API, version 1.1.0.