Apply session events
curl --request POST \
--url https://api.zelinqa.ai/v1/sessions/{session_id}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"state_version": 1,
"context_update": {
"mode": "summary",
"text": "<string>"
},
"client_updates": {
"data": [
{
"id": "<string>",
"value": "<string>",
"operation": "set"
}
],
"dimensions": [
{
"id": "<string>",
"operation": "set"
}
],
"objective": {
"operation": "set"
}
}
}
'import requests
url = "https://api.zelinqa.ai/v1/sessions/{session_id}/events"
payload = {
"state_version": 1,
"context_update": {
"mode": "summary",
"text": "<string>"
},
"client_updates": {
"data": [
{
"id": "<string>",
"value": "<string>",
"operation": "set"
}
],
"dimensions": [
{
"id": "<string>",
"operation": "set"
}
],
"objective": { "operation": "set" }
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
state_version: 1,
context_update: {mode: 'summary', text: '<string>'},
client_updates: {
data: [{id: '<string>', value: '<string>', operation: 'set'}],
dimensions: [{id: '<string>', operation: 'set'}],
objective: {operation: 'set'}
}
})
};
fetch('https://api.zelinqa.ai/v1/sessions/{session_id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "<string>",
"session_id": "<string>",
"client_reference": "<string>",
"status": "active",
"turn_count": 1,
"max_turns": 2,
"turns_remaining": 1,
"question_state": {
"outcomes": [
{
"question_id": "<string>",
"decision_id": "<string>",
"outcome": "asked_answered",
"source": "client",
"message_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
},
"targets": {},
"progress": {
"objective": {
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
},
"dimensions": [
{
"id": "<string>",
"order_position": 1,
"completion_role": "blocking",
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
}
]
},
"pending_decision": {
"decision_id": "<string>",
"candidates": [
{
"rank": 5,
"question_id": "<string>",
"text": "<string>",
"type": "open",
"choices": [
{
"choice_id": "<string>",
"label": "<string>"
}
],
"target_ids": [
"<string>"
],
"selection_mode": "single"
}
]
},
"degraded": true,
"versions": {
"state_version": 1,
"engine_version": "<string>",
"api_version": "1.0"
}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}Sessions
Apply session events
Apply conversation context or client-known data without consuming a turn. The pending decision is recomputed on the updated state and is replaced when other questions become more useful.
POST
/
v1
/
sessions
/
{session_id}
/
events
Apply session events
curl --request POST \
--url https://api.zelinqa.ai/v1/sessions/{session_id}/events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"state_version": 1,
"context_update": {
"mode": "summary",
"text": "<string>"
},
"client_updates": {
"data": [
{
"id": "<string>",
"value": "<string>",
"operation": "set"
}
],
"dimensions": [
{
"id": "<string>",
"operation": "set"
}
],
"objective": {
"operation": "set"
}
}
}
'import requests
url = "https://api.zelinqa.ai/v1/sessions/{session_id}/events"
payload = {
"state_version": 1,
"context_update": {
"mode": "summary",
"text": "<string>"
},
"client_updates": {
"data": [
{
"id": "<string>",
"value": "<string>",
"operation": "set"
}
],
"dimensions": [
{
"id": "<string>",
"operation": "set"
}
],
"objective": { "operation": "set" }
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
state_version: 1,
context_update: {mode: 'summary', text: '<string>'},
client_updates: {
data: [{id: '<string>', value: '<string>', operation: 'set'}],
dimensions: [{id: '<string>', operation: 'set'}],
objective: {operation: 'set'}
}
})
};
fetch('https://api.zelinqa.ai/v1/sessions/{session_id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"request_id": "<string>",
"session_id": "<string>",
"client_reference": "<string>",
"status": "active",
"turn_count": 1,
"max_turns": 2,
"turns_remaining": 1,
"question_state": {
"outcomes": [
{
"question_id": "<string>",
"decision_id": "<string>",
"outcome": "asked_answered",
"source": "client",
"message_id": "<string>",
"occurred_at": "2023-11-07T05:31:56Z"
}
]
},
"targets": {},
"progress": {
"objective": {
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
},
"dimensions": [
{
"id": "<string>",
"order_position": 1,
"completion_role": "blocking",
"computed_status": "not_started",
"progress": 0.5,
"client_override": {
"status": "achieved",
"updated_at": "2023-11-07T05:31:56Z"
},
"effective_status": "not_started"
}
]
},
"pending_decision": {
"decision_id": "<string>",
"candidates": [
{
"rank": 5,
"question_id": "<string>",
"text": "<string>",
"type": "open",
"choices": [
{
"choice_id": "<string>",
"label": "<string>"
}
],
"target_ids": [
"<string>"
],
"selection_mode": "single"
}
]
},
"degraded": true,
"versions": {
"state_version": 1,
"engine_version": "<string>",
"api_version": "1.0"
}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}{
"code": "unauthorized",
"message": "<string>",
"request_id": "<string>",
"details": {}
}Authorizations
Headers
Path Parameters
Body
application/json
- Option 1
- Option 2
Response
Successful response.