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"
}
],
"sub_objectives": [
{
"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"
}
],
"sub_objectives": [
{
"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'}],
sub_objectives: [{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"
},
"sub_objectives": [
{
"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>"
]
}
]
},
"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 selecting a new question.
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"
}
],
"sub_objectives": [
{
"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"
}
],
"sub_objectives": [
{
"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'}],
sub_objectives: [{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"
},
"sub_objectives": [
{
"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>"
]
}
]
},
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
8 - 128Path Parameters
Required string length:
1 - 128Body
application/json
Response
Successful response.
Available options:
active, completed, stopped Required range:
x >= 0Required range:
x >= 1Required range:
x >= 0Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes